-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathngx_postgres-dynamic-module.patch
65 lines (64 loc) · 3.04 KB
/
ngx_postgres-dynamic-module.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/config b/config
index 4b4caa4..8d60434 100644
--- a/config
+++ b/config
@@ -203,14 +203,49 @@ if [ $ngx_version -lt 9000 ]; then
have=NGX_POSTGRES_LIBRARY_VERSION value=$lib_version . auto/define
fi
-ngx_addon_name=ngx_postgres
-
-HTTP_MODULES="$HTTP_MODULES ngx_postgres_module"
-
-CORE_INCS="$CORE_INCS $ngx_feature_path"
-CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
-
-NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_postgres_escape.c $ngx_addon_dir/src/ngx_postgres_handler.c $ngx_addon_dir/src/ngx_postgres_keepalive.c $ngx_addon_dir/src/ngx_postgres_module.c $ngx_addon_dir/src/ngx_postgres_output.c $ngx_addon_dir/src/ngx_postgres_processor.c $ngx_addon_dir/src/ngx_postgres_rewrite.c $ngx_addon_dir/src/ngx_postgres_upstream.c $ngx_addon_dir/src/ngx_postgres_util.c $ngx_addon_dir/src/ngx_postgres_variable.c"
-NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_addon_dir/src/ngx_postgres_escape.h $ngx_addon_dir/src/ngx_postgres_handler.h $ngx_addon_dir/src/ngx_postgres_keepalive.h $ngx_addon_dir/src/ngx_postgres_module.h $ngx_addon_dir/src/ngx_postgres_output.h $ngx_addon_dir/src/ngx_postgres_processor.h $ngx_addon_dir/src/ngx_postgres_rewrite.h $ngx_addon_dir/src/ngx_postgres_upstream.h $ngx_addon_dir/src/ngx_postgres_util.h $ngx_addon_dir/src/ngx_postgres_variable.h $ngx_addon_dir/src/ngx_postgres_ddebug.h $ngx_addon_dir/src/resty_dbd_stream.h"
-
-have=NGX_POSTGRES_MODULE . auto/have
+ngx_addon_name=ngx_postgres_module
+
+POSTGRES_SRCS=" \
+ $ngx_addon_dir/src/ngx_postgres_escape.c \
+ $ngx_addon_dir/src/ngx_postgres_handler.c \
+ $ngx_addon_dir/src/ngx_postgres_keepalive.c \
+ $ngx_addon_dir/src/ngx_postgres_module.c \
+ $ngx_addon_dir/src/ngx_postgres_output.c \
+ $ngx_addon_dir/src/ngx_postgres_processor.c \
+ $ngx_addon_dir/src/ngx_postgres_rewrite.c \
+ $ngx_addon_dir/src/ngx_postgres_upstream.c \
+ $ngx_addon_dir/src/ngx_postgres_util.c \
+ $ngx_addon_dir/src/ngx_postgres_variable.c \
+ "
+
+POSTGRES_DEPS=" \
+ $ngx_addon_dir/src/ngx_postgres_escape.h \
+ $ngx_addon_dir/src/ngx_postgres_handler.h \
+ $ngx_addon_dir/src/ngx_postgres_keepalive.h \
+ $ngx_addon_dir/src/ngx_postgres_module.h \
+ $ngx_addon_dir/src/ngx_postgres_output.h \
+ $ngx_addon_dir/src/ngx_postgres_processor.h \
+ $ngx_addon_dir/src/ngx_postgres_rewrite.h \
+ $ngx_addon_dir/src/ngx_postgres_upstream.h \
+ $ngx_addon_dir/src/ngx_postgres_util.h \
+ $ngx_addon_dir/src/ngx_postgres_variable.h \
+ $ngx_addon_dir/src/ngx_postgres_ddebug.h \
+ $ngx_addon_dir/src/resty_dbd_stream.h \
+ "
+
+if [ -n "$ngx_module_link" ]; then
+ ngx_module_type=HTTP
+ ngx_module_name=$ngx_addon_name
+ ngx_module_srcs="$POSTGRES_SRCS"
+ ngx_module_deps="$POSTGRES_DEPS"
+ ngx_module_incs=$ngx_feature_path
+ ngx_module_libs=$ngx_feature_libs
+
+ . auto/module
+else
+ HTTP_MODULES="$HTTP_MODULES $ngx_addon_name"
+ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $POSTGRES_SRCS"
+ NGX_ADDON_DEPS="$NGX_ADDON_DEPS $POSTGRES_DEPS"
+ CORE_INCS="$CORE_INCS $ngx_feature_path"
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+fi