Skip to content

Commit ee7cd5e

Browse files
LinuxJediFelipe Zimmerle
authored andcommitted
Make sure the linking happens in the right place
Now the module will link to libmodsecurity when compiled as a dynamic module rather than the NGINX binary. Tested with NGINX 1.9.11 in dyanmic and static mode.
1 parent 7bde762 commit ee7cd5e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

config

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,7 @@ fi
6161

6262

6363

64-
if [ $ngx_found = yes ]; then
65-
# from: https://github.com/openresty/lua-nginx-module/blob/master/config#L56
66-
# this is a hack to persuade nginx's build system to favor
67-
# the paths set by our user environments:
68-
CFLAGS="$ngx_modsecurity_opt_I $CFLAGS"
69-
NGX_LD_OPT="$ngx_modsecurity_opt_L $NGX_LD_OPT"
70-
71-
CORE_INCS="$CORE_INCS $ngx_feature_path"
72-
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
73-
else
64+
if [ $ngx_found = no ]; then
7465
cat << END
7566
$0: error: ngx_http_modsecurity requires the ModSecurity library.
7667
END
@@ -98,8 +89,17 @@ if test -n "$ngx_module_link"; then
9889
$ngx_addon_dir/src/ngx_http_modsecurity_body_filter.h \
9990
$ngx_addon_dir/src/ngx_http_modsecurity_log.h \
10091
"
92+
ngx_module_libs="$ngx_feature_libs"
93+
ngx_module_incs="$ngx_feature_path"
94+
10195
. auto/module
10296
else
97+
CFLAGS="$ngx_modsecurity_opt_I $CFLAGS"
98+
NGX_LD_OPT="$ngx_modsecurity_opt_L $NGX_LD_OPT"
99+
100+
CORE_INCS="$CORE_INCS $ngx_feature_path"
101+
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
102+
103103
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_modsecurity"
104104
NGX_ADDON_SRCS="\
105105
$NGX_ADDON_SRCS \

0 commit comments

Comments
 (0)