Skip to content

Commit f2515a2

Browse files
akatrevorjayxiaokai-wang
authored andcommitted
Build fixes for compiling as a dynamic module (#12)
Allow build as a dynamic module.
1 parent 251109e commit f2515a2

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

config

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1-
have=NGX_STREAM_UPSYNC . auto/have
21
ngx_addon_name=ngx_stream_upsync_module
3-
STREAM_MODULES="$STREAM_MODULES ngx_stream_upsync_module"
4-
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_stream_upsync_module.c $ngx_addon_dir/src/ngx_stream_json.c $ngx_addon_dir/src/ngx_stream_http_parser.c"
5-
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ngx_stream_upsync_module.h $ngx_addon_dir/src/ngx_stream_json.h $ngx_addon_dir/src/ngx_stream_http_parser.h"
2+
63
ngx_feature_libs="-lm"
7-
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
4+
5+
ngx_module_incs=$ngx_addon_dir/src
6+
7+
_STREAM_UPSYNC_SRCS="\
8+
$ngx_addon_dir/src/ngx_stream_upsync_module.c \
9+
$ngx_addon_dir/src/ngx_stream_json.c \
10+
$ngx_addon_dir/src/ngx_stream_http_parser.c \
11+
"
12+
13+
have=NGX_STREAM_UPSYNC . auto/have
14+
15+
if test -n "$ngx_module_link"; then
16+
ngx_module_type=STREAM
17+
ngx_module_name=$ngx_addon_name
18+
ngx_module_srcs="$_STREAM_UPSYNC_SRCS"
19+
ngx_module_libs=$ngx_feature_libs
20+
. auto/module
21+
else
22+
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $_STREAM_UPSYNC_SRCS"
23+
CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
24+
CORE_INCS="$CORE_INCS $ngx_module_incs"
25+
STREAM_MODULES="$STREAM_MODULES $ngx_addon_name"
26+
fi
27+

0 commit comments

Comments
 (0)