stream-lua-nginx-module
stream-lua-nginx-module copied to clipboard
feature: this module can now be built as a dynamic module
// ping @agentzh, just in case 😸
@msva this PR is quite outdated and can't be applied to current master. Care to provide the fix?
Hello,
How I can provide a fix for this?. I've modified my config to be compiled as dynamic module and looks like is working, but I'm not really a programmer and I don't know how to do it. Also the fix is very similar to this one (maybe just changing one line will work).
index f524267..7f52aa0 100644
--- a/config
+++ b/config
@@ -228,7 +228,7 @@ fi
# ----------------------------------------
ngx_addon_name=ngx_stream_lua_module
-NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
+STREAM_LUA_SRCS="$STREAM_LUA_SRCS \
$ngx_addon_dir/src/ngx_stream_lua_api.c \
$ngx_addon_dir/src/ngx_stream_lua_request.c \
$ngx_addon_dir/src/ngx_stream_lua_module.c \
@@ -274,7 +274,7 @@ NGX_ADDON_SRCS="$NGX_ADDON_SRCS \
$ngx_addon_dir/src/ngx_stream_lua_input_filters.c \
"
-NGX_ADDON_DEPS="$NGX_ADDON_DEPS \
+STREAM_LUA_DEPS="$STREAM_LUA_DEPS \
$ngx_addon_dir/src/ddebug.h \
$ngx_addon_dir/src/api/ngx_stream_lua_api.h \
$ngx_addon_dir/src/ngx_stream_lua_request.h \
@@ -316,7 +316,6 @@ NGX_ADDON_DEPS="$NGX_ADDON_DEPS \
$ngx_addon_dir/src/ngx_stream_lua_input_filters.h \
"
-STREAM_MODULES="$STREAM_MODULES $ngx_addon_name"
# ----------------------------------------
@@ -424,7 +423,23 @@ USE_SHA1=YES
#NGX_DTRACE_PROVIDERS="$NGX_DTRACE_PROVIDERS $ngx_addon_dir/dtrace/ngx_lua_provider.d"
#NGX_TAPSET_SRCS="$NGX_TAPSET_SRCS $ngx_addon_dir/tapset/ngx_lua.stp"
-CORE_INCS="$CORE_INCS $ngx_addon_dir/src/api"
-
#CFLAGS=$"$CFLAGS -DLUA_DEFAULT_PATH='\"/usr/local/openresty/lualib/?.lua\"'"
#CFLAGS=$"$CFLAGS -DLUA_DEFAULT_CPATH='\"/usr/local/openresty/lualib/?.so\"'"
+
+if test -n "$ngx_module_link"; then
+ ngx_module_type=STREAM
+ ngx_module_name="$ngx_addon_name"
+ ngx_module_deps="$STREAM_LUA_DEPS"
+ ngx_module_srcs="$STREAM_LUA_SRCS"
+
+ . auto/module
+else
+ STREAM_MODULES="$STREAM_MODULES $ngx_addon_name"
+ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $STREAM_LUA_SRCS"
+ NGX_ADDON_DEPS="$NGX_ADDON_DEPS $STREAM_LUA_DEPS"
+
+ CORE_INCS="$CORE_INCS $ngx_module_incs"
+ CORE_LIBS="$CORE_LIBS $ngx_module_libs"
+fi
+
+CORE_INCS="$CORE_INCS $ngx_addon_dir/src/api"
Greetings!