Skip to content

Commit d686d13

Browse files
author
Marc Stern
authored
Merge pull request #2931 from leancz/leancz-patch-1-pcre2-windows
Adding PCRE2 support for windows build in Makefile.win
2 parents f7e8369 + 5bb58b8 commit d686d13

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

apache2/Makefile.win

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
###########################################################################
22
#
3-
# Usage: NMAKE -f Makefile.win APACHE={httpd installion dir} PCRE={pcre dir} LIBXML2={LibXML2 dir} [ LUA={Lua dir} ]
3+
# Usage: NMAKE -f Makefile.win APACHE={httpd installion dir} PCRE|PCRE2={pcre dir} LIBXML2={LibXML2 dir} [ LUA={Lua dir} ]
44
#
5+
!IF "$(PCRE2)" != ""
6+
PCRE = $(PCRE2)
7+
!ENDIF
8+
59
!IF "$(APACHE)" == "" || "$(PCRE)" == "" || "$(LIBXML2)" == "" || "$(CURL)" == ""
6-
!ERROR NMAKE arguments: APACHE=dir PCRE=dir LIBXML2=dir CURL=dir are required to build mod_security2 for Windows
10+
!ERROR NMAKE arguments: APACHE=dir PCRE|PCRE2=dir LIBXML2=dir CURL=dir are required to build mod_security2 for Windows
711
!ENDIF
812

913
# Linking libraries
1014
LIBS = $(APACHE)\lib\libhttpd.lib \
1115
$(APACHE)\lib\libapr-1.lib \
1216
$(APACHE)\lib\libaprutil-1.lib \
13-
$(PCRE)\pcre.lib \
14-
$(CURL)\libcurl.lib \
17+
$(CURL)\libcurl.lib \
1518
$(LIBXML2)\win32\bin.msvc\libxml2.lib \
1619
Ws2_32.lib \
1720
"iphlpapi.lib"
1821

22+
!IF "$(PCRE2)" != ""
23+
LIBS =$(LIBS) $(PCRE2)\lib\pcre2-8.lib
24+
!ELSE
25+
LIBS =$(LIBS) $(PCRE)\lib\pcre.lib
26+
!ENDIF
1927
###########################################################################
2028
###########################################################################
2129

22-
23-
!IF "$(IIS_BUILD)" == "yes"
24-
DEFS=$(DEFS) -DVERSION_IIS
25-
!ENDIF
26-
30+
31+
!IF "$(IIS_BUILD)" == "yes"
32+
DEFS=$(DEFS) -DVERSION_IIS
33+
!ENDIF
34+
2735
CC = CL
2836

2937
MT = mt
@@ -37,9 +45,14 @@ INCLUDES = -I. -I.. \
3745
-I$(PCRE)\include -I$(PCRE) \
3846
-I$(LIBXML2)\include \
3947
-I$(APACHE)\include
40-
41-
# Enables support for SecRemoteRules and external resources.
42-
DEFS=$(DEFS) -DWITH_CURL -DWITH_REMOTE_RULES
48+
49+
# Enables support for SecRemoteRules and external resources.
50+
DEFS=$(DEFS) -DWITH_CURL -DWITH_REMOTE_RULES
51+
52+
# Enable PCRE2
53+
!IF "$(PCRE2)" != ""
54+
DEFS =$(DEFS) -DWITH_PCRE2
55+
!ENDIF
4356

4457
# Lua is optional
4558
!IF "$(LUA)" != ""
@@ -65,8 +78,8 @@ OBJS = mod_security2.obj apache2_config.obj apache2_io.obj apache2_util.obj \
6578
msc_parsers.obj msc_util.obj msc_pcre.obj persist_dbm.obj \
6679
msc_reqbody.obj msc_geo.obj msc_gsb.obj msc_crypt.obj msc_tree.obj msc_unicode.obj acmp.obj msc_lua.obj \
6780
msc_release.obj \
68-
msc_status_engine.obj \
69-
msc_remote_rules.obj \
81+
msc_status_engine.obj \
82+
msc_remote_rules.obj \
7083
msc_json.obj \
7184
libinjection/libinjection_html5.obj \
7285
libinjection/libinjection_sqli.obj \

0 commit comments

Comments
 (0)