]> git.kaiwu.me - njs.git/commitdiff
Implemented support for dynamic modules.
authorRuslan Ermilov <ru@nginx.com>
Thu, 25 Feb 2016 13:32:47 +0000 (16:32 +0300)
committerRuslan Ermilov <ru@nginx.com>
Thu, 25 Feb 2016 13:32:47 +0000 (16:32 +0300)
nginx/config

index a6251000751ec399168a123196ff9047cff5462b..57e9631dc04aafe357432cee92e549689168c8a4 100644 (file)
@@ -2,9 +2,19 @@ ngx_addon_name="ngx_http_js_module"
 
 USE_PCRE=YES
 
-HTTP_MODULES="$HTTP_MODULES ngx_http_js_module"
-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_js_module.c"
+if test -n "$ngx_module_link"; then
+    ngx_module_type=HTTP
+    ngx_module_name=ngx_http_js_module
+    ngx_module_incs="$ngx_addon_dir/../nxt $ngx_addon_dir/../njs"
+    ngx_module_srcs="$ngx_addon_dir/ngx_http_js_module.c"
+    ngx_module_libs="$ngx_addon_dir/../build/libnjs.a -lm"
+
+    . auto/module
+else
+    HTTP_MODULES="$HTTP_MODULES ngx_http_js_module"
+    CORE_INCS="$CORE_INCS $ngx_addon_dir/../nxt $ngx_addon_dir/../njs"
+    NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_js_module.c"
+    CORE_LIBS="$CORE_LIBS $ngx_addon_dir/../build/libnjs.a -lm"
+fi
 
 LINK_DEPS="$LINK_DEPS $ngx_addon_dir/../build/libnjs.a"
-CORE_LIBS="$CORE_LIBS $ngx_addon_dir/../build/libnjs.a -lm"
-CORE_INCS="$CORE_INCS $ngx_addon_dir/../nxt $ngx_addon_dir/../njs"