Skip to content

Commit 4e90f0e

Browse files
authored
Merge pull request #1359 from MengqiWu/master
fix some for dubbo dynamic module
2 parents 6b5f7be + 1a635b0 commit 4e90f0e

File tree

4 files changed

+73
-14
lines changed

4 files changed

+73
-14
lines changed

docs/modules/ngx_http_dubbo_module.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,20 @@ This is a [QuickStart for Tengine Dubbo](https://github.com/apache/dubbo-samples
7979
Install
8080
=======
8181

82-
* Build Tengine with this module from source:
82+
Build Tengine with this module from source:
8383

8484
```
8585
$ ./configure --add-module=./modules/mod_dubbo --add-module=./modules/ngx_multi_upstream_module --add-module=./modules/mod_config
8686
$ make && make install
8787
```
8888

89+
Dynamic module support
90+
91+
* mod_dubbo: ```support``` build as a dynamic module
92+
* ngx_multi_upstream_module: ```no support``` build as a dynamic module
93+
* mod_config: ```support but no need``` build as a dynamic module
94+
95+
8996
Directive
9097
=========
9198

docs/modules/ngx_http_dubbo_module_cn.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,19 @@ QuickStart
7676
Install
7777
=======
7878

79-
* 源码安装此模块:
79+
源码安装此模块:
8080

8181
```
8282
$ ./configure --add-module=./modules/mod_dubbo --add-module=./modules/ngx_multi_upstream_module --add-module=./modules/mod_config
8383
$ make && make install
8484
```
8585

86+
Dynamic module 支持
87+
* mod_dubbo: ```支持```编译成 dynamic module
88+
* ngx_multi_upstream_module: ```不支持```编译成 dynamic module
89+
* mod_config: ```支持但无需```编译成 dynamic module
90+
91+
8692
Directive
8793
=========
8894

modules/mod_dubbo/config

+38-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
1-
HTTP_MODULES="$HTTP_MODULES ngx_http_dubbo_module"
2-
CORE_DEPS="$CORE_DEPS $ngx_addon_dir/ngx_http_dubbo_module.h $ngx_addon_dir/ngx_dubbo.h"
3-
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_dubbo_util.cpp $ngx_addon_dir/utils/objects.cc $ngx_addon_dir/utils/utils.cc $ngx_addon_dir/hessian2/hessian2_ext.cc $ngx_addon_dir/hessian2/hessian2_input.cc $ngx_addon_dir/hessian2/hessian2_output.cc $ngx_addon_dir/ngx_dubbo.c $ngx_addon_dir/ngx_http_dubbo_module.c"
4-
HTTP_INCS="$HTTP_INCS $ngx_addon_dir $ngx_addon_dir/utils $ngx_addon_dir/hessian $ngx_addon_dir/hessian2"
5-
have=T_NGX_DUBBO . auto/have
1+
ngx_addon_name=ngx_http_dubbo_module
2+
3+
HTTP_DUBBO_DEPS=" \
4+
$ngx_addon_dir/ngx_http_dubbo_module.h \
5+
$ngx_addon_dir/ngx_dubbo.h"
6+
7+
HTTP_DUBBO_SRCS=" \
8+
$ngx_addon_dir/ngx_dubbo_util.cpp \
9+
$ngx_addon_dir/utils/objects.cc \
10+
$ngx_addon_dir/utils/utils.cc \
11+
$ngx_addon_dir/hessian2/hessian2_ext.cc \
12+
$ngx_addon_dir/hessian2/hessian2_input.cc \
13+
$ngx_addon_dir/hessian2/hessian2_output.cc \
14+
$ngx_addon_dir/ngx_dubbo.c \
15+
$ngx_addon_dir/ngx_http_dubbo_module.c"
16+
17+
ngx_module_incs=" \
18+
$ngx_addon_dir \
19+
$ngx_addon_dir/utils \
20+
$ngx_addon_dir/hessian2"
621

722
CORE_LIBS="$CORE_LIBS -lstdc++"
23+
24+
if test -n "$ngx_module_link"; then
25+
ngx_module_type=HTTP
26+
ngx_module_name=$ngx_addon_name
27+
ngx_module_deps="$HTTP_DUBBO_DEPS"
28+
ngx_module_srcs="$HTTP_DUBBO_SRCS"
29+
30+
. auto/module
31+
else
32+
HTTP_MODULES="$HTTP_MODULES $ngx_addon_name"
33+
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $HTTP_DUBBO_DEPS"
34+
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $HTTP_DUBBO_SRCS"
35+
36+
CORE_INCS="$CORE_INCS $ngx_module_incs"
37+
fi
38+
39+
have=T_NGX_DUBBO . auto/have
40+
+20-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
1+
if [ "$ngx_module_link" = DYNAMIC ]; then
2+
cat << END
3+
$0: error: ngx_multi_upstream not support build as a dynamic module.
4+
END
5+
exit 1
6+
fi
7+
8+
ngx_addon_name=ngx_http_multi_upstream_module
9+
HTTP_MODULES="$HTTP_MODULES ngx_http_multi_upstream_module"
10+
CORE_DEPS="$CORE_DEPS $ngx_addon_dir/ngx_multi_upstream_module.h $ngx_addon_dir/ngx_http_multi_upstream_module.h $ngx_addon_dir/ngx_http_multi_upstream.c"
11+
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_multi_upstream_module.c $ngx_addon_dir/ngx_multi_upstream_module.c"
12+
HTTP_INCS="$HTTP_INCS $ngx_addon_dir"
13+
114
if [ $STREAM != NO ]; then
215
ngx_module_name=ngx_stream_multi_upstream_module
316
ngx_module_type=STREAM
417
ngx_module_link=ADDON
518
ngx_module_incs=$ngx_addon_dir
619
ngx_module_deps=$ngx_addon_dir/ngx_stream_multi_upstream_module.h
720
ngx_module_srcs=$ngx_addon_dir/ngx_stream_multi_upstream_module.c
8-
21+
22+
if [ $STREAM = DYNAMIC ]; then
23+
ngx_module_link=DYNAMIC
24+
else
25+
ngx_module_link=ADDON
26+
fi
27+
928
. auto/module
1029
fi
1130

12-
ngx_addon_name=ngx_http_multi_upstream_module
13-
HTTP_MODULES="$HTTP_MODULES ngx_http_multi_upstream_module"
14-
CORE_DEPS="$CORE_DEPS $ngx_addon_dir/ngx_multi_upstream_module.h $ngx_addon_dir/ngx_http_multi_upstream_module.h $ngx_addon_dir/ngx_http_multi_upstream.c"
15-
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_multi_upstream_module.c $ngx_addon_dir/ngx_multi_upstream_module.c"
16-
HTTP_INCS="$HTTP_INCS $ngx_addon_dir"
17-
1831
have=T_NGX_MULTI_UPSTREAM . auto/have

0 commit comments

Comments
 (0)