Browse Source

fix some for dubbo dynamic module

pull/1359/head
mengqi.wmq 6 years ago
parent
commit
1a635b0df9
  1. 9
      docs/modules/ngx_http_dubbo_module.md
  2. 8
      docs/modules/ngx_http_dubbo_module_cn.md
  3. 43
      modules/mod_dubbo/config
  4. 27
      modules/ngx_multi_upstream_module/config

9
docs/modules/ngx_http_dubbo_module.md

@ -79,13 +79,20 @@ This is a [QuickStart for Tengine Dubbo](https://github.com/apache/dubbo-samples
Install
=======
* Build Tengine with this module from source:
Build Tengine with this module from source:
```
$ ./configure --add-module=./modules/mod_dubbo --add-module=./modules/ngx_multi_upstream_module --add-module=./modules/mod_config
$ make && make install
```
Dynamic module support
* mod_dubbo: ```support``` build as a dynamic module
* ngx_multi_upstream_module: ```no support``` build as a dynamic module
* mod_config: ```support but no need``` build as a dynamic module
Directive
=========

8
docs/modules/ngx_http_dubbo_module_cn.md

@ -76,13 +76,19 @@ QuickStart
Install
=======
* 源码安装此模块:
源码安装此模块:
```
$ ./configure --add-module=./modules/mod_dubbo --add-module=./modules/ngx_multi_upstream_module --add-module=./modules/mod_config
$ make && make install
```
Dynamic module 支持
* mod_dubbo: ```支持```编译成 dynamic module
* ngx_multi_upstream_module: ```不支持```编译成 dynamic module
* mod_config: ```支持但无需```编译成 dynamic module
Directive
=========

43
modules/mod_dubbo/config

@ -1,7 +1,40 @@
HTTP_MODULES="$HTTP_MODULES ngx_http_dubbo_module"
CORE_DEPS="$CORE_DEPS $ngx_addon_dir/ngx_http_dubbo_module.h $ngx_addon_dir/ngx_dubbo.h"
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"
HTTP_INCS="$HTTP_INCS $ngx_addon_dir $ngx_addon_dir/utils $ngx_addon_dir/hessian $ngx_addon_dir/hessian2"
have=T_NGX_DUBBO . auto/have
ngx_addon_name=ngx_http_dubbo_module
HTTP_DUBBO_DEPS=" \
$ngx_addon_dir/ngx_http_dubbo_module.h \
$ngx_addon_dir/ngx_dubbo.h"
HTTP_DUBBO_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"
ngx_module_incs=" \
$ngx_addon_dir \
$ngx_addon_dir/utils \
$ngx_addon_dir/hessian2"
CORE_LIBS="$CORE_LIBS -lstdc++"
if test -n "$ngx_module_link"; then
ngx_module_type=HTTP
ngx_module_name=$ngx_addon_name
ngx_module_deps="$HTTP_DUBBO_DEPS"
ngx_module_srcs="$HTTP_DUBBO_SRCS"
. auto/module
else
HTTP_MODULES="$HTTP_MODULES $ngx_addon_name"
NGX_ADDON_DEPS="$NGX_ADDON_DEPS $HTTP_DUBBO_DEPS"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $HTTP_DUBBO_SRCS"
CORE_INCS="$CORE_INCS $ngx_module_incs"
fi
have=T_NGX_DUBBO . auto/have

27
modules/ngx_multi_upstream_module/config

@ -1,3 +1,16 @@
if [ "$ngx_module_link" = DYNAMIC ]; then
cat << END
$0: error: ngx_multi_upstream not support build as a dynamic module.
END
exit 1
fi
ngx_addon_name=ngx_http_multi_upstream_module
HTTP_MODULES="$HTTP_MODULES ngx_http_multi_upstream_module"
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"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_multi_upstream_module.c $ngx_addon_dir/ngx_multi_upstream_module.c"
HTTP_INCS="$HTTP_INCS $ngx_addon_dir"
if [ $STREAM != NO ]; then
ngx_module_name=ngx_stream_multi_upstream_module
ngx_module_type=STREAM
@ -5,14 +18,14 @@ if [ $STREAM != NO ]; then
ngx_module_incs=$ngx_addon_dir
ngx_module_deps=$ngx_addon_dir/ngx_stream_multi_upstream_module.h
ngx_module_srcs=$ngx_addon_dir/ngx_stream_multi_upstream_module.c
if [ $STREAM = DYNAMIC ]; then
ngx_module_link=DYNAMIC
else
ngx_module_link=ADDON
fi
. auto/module
fi
ngx_addon_name=ngx_http_multi_upstream_module
HTTP_MODULES="$HTTP_MODULES ngx_http_multi_upstream_module"
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"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_multi_upstream_module.c $ngx_addon_dir/ngx_multi_upstream_module.c"
HTTP_INCS="$HTTP_INCS $ngx_addon_dir"
have=T_NGX_MULTI_UPSTREAM . auto/have
Loading…
Cancel
Save