From 892bdb2f6427122d47322613de45ae0bee61144d Mon Sep 17 00:00:00 2001 From: 99999 Date: Sun, 24 Apr 2016 00:22:18 +1000 Subject: [PATCH 1/2] nginx-clojure can now be compiled as a dynamic module --- src/c/config | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/c/config b/src/c/config index ee125435..7a9f7ad3 100644 --- a/src/c/config +++ b/src/c/config @@ -1,8 +1,9 @@ ngx_addon_name=ngx_http_clojure_module -HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_clojure_module" -#HTTP_MODULES="$HTTP_MODULES ngx_http_clojure_module" -NGX_ADDON_SRCS="$NGX_ADDON_SRCS \ - $ngx_addon_dir/ngx_http_clojure_mem.c \ + +if test -n "$ngx_module_link"; then + ngx_module_type=HTTP_AUX_FILTER + ngx_module_name=ngx_http_clojure_module + ngx_module_srcs="$ngx_addon_dir/ngx_http_clojure_mem.c \ $ngx_addon_dir/ngx_http_clojure_jvm.c \ $ngx_addon_dir/ngx_http_clojure_module.c \ $ngx_addon_dir/ngx_http_clojure_socket.c \ @@ -10,14 +11,29 @@ NGX_ADDON_SRCS="$NGX_ADDON_SRCS \ $ngx_addon_dir/ngx_http_clojure_shared_map_hashmap.c \ $ngx_addon_dir/ngx_http_clojure_shared_map_tinymap.c \ " -NGX_ADDON_DEPS="$NGX_ADDON_DEPS \ - $ngx_addon_dir/ngx_http_clojure_jvm.h \ - $ngx_addon_dir/ngx_http_clojure_mem.h \ - $ngx_addon_dir/ngx_http_clojure_socket.h \ - $ngx_addon_dir/ngx_http_clojure_shared_map.h \ - $ngx_addon_dir/ngx_http_clojure_shared_map_hashmap.h \ - $ngx_addon_dir/ngx_http_clojure_shared_map_tinymap.h \ -" + + . auto/module +else + HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_clojure_module" + #HTTP_MODULES="$HTTP_MODULES ngx_http_clojure_module" + NGX_ADDON_SRCS="$NGX_ADDON_SRCS \ + $ngx_addon_dir/ngx_http_clojure_mem.c \ + $ngx_addon_dir/ngx_http_clojure_jvm.c \ + $ngx_addon_dir/ngx_http_clojure_module.c \ + $ngx_addon_dir/ngx_http_clojure_socket.c \ + $ngx_addon_dir/ngx_http_clojure_shared_map.c \ + $ngx_addon_dir/ngx_http_clojure_shared_map_hashmap.c \ + $ngx_addon_dir/ngx_http_clojure_shared_map_tinymap.c \ + " + NGX_ADDON_DEPS="$NGX_ADDON_DEPS \ + $ngx_addon_dir/ngx_http_clojure_jvm.h \ + $ngx_addon_dir/ngx_http_clojure_mem.h \ + $ngx_addon_dir/ngx_http_clojure_socket.h \ + $ngx_addon_dir/ngx_http_clojure_shared_map.h \ + $ngx_addon_dir/ngx_http_clojure_shared_map_hashmap.h \ + $ngx_addon_dir/ngx_http_clojure_shared_map_tinymap.h \ + " +fi HTTP_INCS="$HTTP_INCS $ngx_addon_dir" USE_SHA1=YES From dbc63fddf12ff2784fc79c3cf905b0f7cde632e1 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 25 May 2016 13:40:38 +0100 Subject: [PATCH 2/2] Cleanup conversion to dynamic modules --- src/c/config | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/c/config b/src/c/config index 7a9f7ad3..836f84e6 100644 --- a/src/c/config +++ b/src/c/config @@ -1,9 +1,6 @@ ngx_addon_name=ngx_http_clojure_module -if test -n "$ngx_module_link"; then - ngx_module_type=HTTP_AUX_FILTER - ngx_module_name=ngx_http_clojure_module - ngx_module_srcs="$ngx_addon_dir/ngx_http_clojure_mem.c \ +CLOJURE_SRCS="$ngx_addon_dir/ngx_http_clojure_mem.c \ $ngx_addon_dir/ngx_http_clojure_jvm.c \ $ngx_addon_dir/ngx_http_clojure_module.c \ $ngx_addon_dir/ngx_http_clojure_socket.c \ @@ -11,28 +8,27 @@ if test -n "$ngx_module_link"; then $ngx_addon_dir/ngx_http_clojure_shared_map_hashmap.c \ $ngx_addon_dir/ngx_http_clojure_shared_map_tinymap.c \ " - - . auto/module -else - HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_clojure_module" - #HTTP_MODULES="$HTTP_MODULES ngx_http_clojure_module" - NGX_ADDON_SRCS="$NGX_ADDON_SRCS \ - $ngx_addon_dir/ngx_http_clojure_mem.c \ - $ngx_addon_dir/ngx_http_clojure_jvm.c \ - $ngx_addon_dir/ngx_http_clojure_module.c \ - $ngx_addon_dir/ngx_http_clojure_socket.c \ - $ngx_addon_dir/ngx_http_clojure_shared_map.c \ - $ngx_addon_dir/ngx_http_clojure_shared_map_hashmap.c \ - $ngx_addon_dir/ngx_http_clojure_shared_map_tinymap.c \ - " - NGX_ADDON_DEPS="$NGX_ADDON_DEPS \ +CLOJURE_DEPS="$NGX_ADDON_DEPS \ $ngx_addon_dir/ngx_http_clojure_jvm.h \ $ngx_addon_dir/ngx_http_clojure_mem.h \ $ngx_addon_dir/ngx_http_clojure_socket.h \ $ngx_addon_dir/ngx_http_clojure_shared_map.h \ $ngx_addon_dir/ngx_http_clojure_shared_map_hashmap.h \ $ngx_addon_dir/ngx_http_clojure_shared_map_tinymap.h \ - " +" + +if test -n "$ngx_module_link"; then + ngx_module_type=HTTP_AUX_FILTER + ngx_module_name=ngx_http_clojure_module + ngx_module_srcs=$CLOJURE_SRCS + ngx_module_deps=$CLOJURE_DEPS + + . auto/module +else + HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES ngx_http_clojure_module" + #HTTP_MODULES="$HTTP_MODULES ngx_http_clojure_module" + NGX_ADDON_SRCS="$NGX_ADDON_SRCS $CLOJURE_SRCS" + NGX_ADDON_DEPS="$NGX_ADDON_DEPS $CLOJURE_DEPS" fi HTTP_INCS="$HTTP_INCS $ngx_addon_dir"