Skip to content

Commit fa3c55e

Browse files
committed
[dev] rename module name when built as a dynamic module.
1 parent 90bef0c commit fa3c55e

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

README.CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ nginx-http-flv-module包含了[nginx-rtmp-module](https://github.com/arut/nginx-
199199
#如果此模块被编译为动态模块并且要使用与RTMP相关的功
200200
#能时,必须指定下面的配置项并且它必须位于events配置
201201
#项之前,否则NGINX启动时不会加载此模块或者加载失败
202-
#load_module modules/ngx_rtmp_module.so;
202+
#load_module modules/ngx_http_flv_live_module.so;
203203

204204
events {
205205
worker_connections 1024;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ The directive `worker_processes` of value 1 is preferable to other values, becau
200200
#to RTMP are needed, the command below MUST be specified and MUST be
201201
#located before events directive, otherwise the module won't be loaded
202202
#or will be loaded unsuccessfully when NGINX is started
203-
#load_module modules/ngx_rtmp_module.so;
203+
#load_module modules/ngx_http_flv_live_module.so;
204204

205205
events {
206206
worker_connections 1024;

config

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ngx_addon_name="ngx_http_flv_module"
1+
ngx_addon_name="ngx_http_flv_live_module"
22

33
RTMP_CORE_MODULES=" \
44
ngx_rtmp_module \
@@ -47,6 +47,7 @@ RTMP_DEPS=" \
4747
$ngx_addon_dir/ngx_rtmp_notify_module.h \
4848
$ngx_addon_dir/ngx_rtmp_gop_cache_module.h \
4949
$ngx_addon_dir/ngx_rtmp_relay_module.h \
50+
$ngx_addon_dir/ngx_rtmp_exec_module.h \
5051
$ngx_addon_dir/ngx_rtmp_streams.h \
5152
$ngx_addon_dir/ngx_rtmp_bitop.h \
5253
$ngx_addon_dir/ngx_rtmp_proxy_protocol.h \
@@ -108,11 +109,21 @@ if [ -f auto/module ] ; then
108109
ngx_module_deps=$RTMP_DEPS
109110

110111
if [ $ngx_module_link = DYNAMIC ] ; then
111-
ngx_module_name="$RTMP_CORE_MODULES $RTMP_HTTP_MODULES"
112+
ngx_module_name="$ngx_addon_name $RTMP_CORE_MODULES $RTMP_HTTP_MODULES"
112113
ngx_module_srcs="$RTMP_CORE_SRCS $RTMP_HTTP_SRCS"
113114

114115
. auto/module
115116

117+
dynamic_modules=`eval echo '$'"${ngx_module}_MODULES" | sed -e "s/\s\{0,\}$ngx_addon_name//"`
118+
eval ${ngx_module}_MODULES=\"$dynamic_modules\"
119+
unset dynamic_modules
120+
121+
order_modules=`eval echo '$'"${ngx_module}_ORDER"`
122+
if [ -n "$order_modules" ]
123+
then
124+
eval ${ngx_module}_ORDER=\"`echo "$order_modules" | sed -e "s/ \{0,\}$ngx_addon_name//"`\"
125+
unset order_modules
126+
fi
116127
else
117128
ngx_module_type=CORE
118129
ngx_module_name=$RTMP_CORE_MODULES

0 commit comments

Comments
 (0)