diff --git a/apache2/Makefile.win b/apache2/Makefile.win
index 31a83a9..1061279 100644
--- a/apache2/Makefile.win
+++ b/apache2/Makefile.win
@@ -6,12 +6,55 @@
!ERROR NMAKE arguments: APACHE=dir PCRE=dir LIBXML2=dir are required to build mod_security2 for Windows
!ENDIF
+# Supported PCRE Layouts:
+# Referencing PCRE build tree:
+# $(PCRE)/include/pcre*.h and $(PCRE)/pcre.lib
+# Referencing PCRE install (PCRE's CMAKE_INSTALL_PREFIX):
+# $(PCRE)/include/pcre*.h and $(PCRE)/lib/pcre.lib
+# Note that pcre.lib will be renamed to pcred.lib when using a debug build.
+
+!IF EXISTS($(PCRE)\pcre.lib)
+PCRELIB = $(PCRE)\pcre.lib
+!ELSE IF EXISTS($(PCRE)\pcred.lib)
+PCRELIB = $(PCRE)\pcred.lib
+!ELSE IF EXISTS($(PCRE)\lib\pcre.lib)
+PCRELIB = $(PCRE)\lib\pcre.lib
+!ELSE IF EXISTS($(PCRE)\lib\pcred.lib)
+PCRELIB = $(PCRE)\lib\pcred.lib
+!ELSE
+!ERROR Neither pcre.lib nor pcred.lib was found relative to $(PCRE)
+!ENDIF
+
+# Supported Libxml2 Layouts:
+# Referencing Libxml2 build tree:
+# $(LIBXML2)\include\libxml\*.h
+# $(LIBXML2)\win32\bin.msvc\libxml2.lib
+# Referencing Libxml2 install (configure.js prefix=xxx):
+# $(LIBXML2)\include\libxml2\libxml\*.h
+# $(LIBXML2)\lib\libxml2.lib
+
+!IF EXISTS($(LIBXML2)\win32\bin.msvc\libxml2.lib)
+LIBXML2LIB = $(LIBXML2)\win32\bin.msvc\libxml2.lib
+!ELSE IF EXISTS($(LIBXML2)\lib\libxml2.lib)
+LIBXML2LIB = $(LIBXML2)\lib\libxml2.lib
+!ELSE
+!ERROR libxml2.lib was not found relative to $(LIBXML2)
+!ENDIF
+
+!IF EXISTS($(LIBXML2)\include\libxml\xpath.h)
+LIBXML2INC = $(LIBXML2)\include
+!ELSE IF EXISTS($(LIBXML2)\include\libxml2\libxml\xpath.h)
+LIBXML2INC = $(LIBXML2)\include\libxml2
+!ELSE
+!ERROR Libxml2 include files were not found relative to $(LIBXML2)
+!ENDIF
+
# Linking libraries
LIBS = $(APACHE)\lib\libhttpd.lib \
$(APACHE)\lib\libapr-1.lib \
$(APACHE)\lib\libaprutil-1.lib \
- $(PCRE)\pcre.lib \
- $(LIBXML2)\win32\bin.msvc\libxml2.lib \
+ $(PCRELIB) \
+ $(LIBXML2LIB) \
Ws2_32.lib
###########################################################################
@@ -27,7 +70,7 @@ DLL = mod_security2.so
INCLUDES = -I. -I.. \
-I$(PCRE)\include -I$(PCRE) \
- -I$(LIBXML2)\include \
+ -I$(LIBXML2INC) \
-I$(APACHE)\include
# Lua is optional
|