comparison auto/module @ 6382:392959224560

Dynamic modules: auto/module script. This script simplifies configuration of additional modules, including 3rd party ones. The script is extensible, and will be used to introduce dynamic linking of modules in upcoming changes. 3rd party module config scripts are called with ngx_module_link preset to "ADDON" - this allows config scripts to call auto/module without ngx_module_link explicitly defined, as well as testing if new interface is in place if compatibility with older nginx versions is desired. In collaboration with Ruslan Ermilov.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 04 Feb 2016 18:30:21 +0300
parents
children 85dea406e18f
comparison
equal deleted inserted replaced
6381:c529555949b7 6382:392959224560
1
2 # Copyright (C) Ruslan Ermilov
3 # Copyright (C) Nginx, Inc.
4
5
6 case $ngx_module_type in
7 HTTP_*) ngx_var=HTTP ;;
8 *) ngx_var=$ngx_module_type ;;
9 esac
10
11
12 if [ "$ngx_module_link" = YES ]; then
13
14 eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
15 $ngx_module_name\"
16
17 eval ${ngx_var}_SRCS=\"\$${ngx_var}_SRCS $ngx_module_srcs\"
18
19 if test -n "$ngx_module_incs"; then
20 eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
21 fi
22
23 if test -n "$ngx_module_deps"; then
24 eval ${ngx_var}_DEPS=\"\$${ngx_var}_DEPS $ngx_module_deps\"
25 fi
26
27 for lib in $ngx_module_libs
28 do
29 case $lib in
30
31 PCRE | OPENSSL | MD5 | SHA1 | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
32 eval USE_${lib}=YES
33 ;;
34
35 *)
36 CORE_LIBS="$CORE_LIBS $lib"
37 ;;
38
39 esac
40 done
41
42 elif [ "$ngx_module_link" = ADDON ]; then
43
44 eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
45 $ngx_module_name\"
46
47 NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_module_srcs"
48
49 if test -n "$ngx_module_incs"; then
50 eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
51 fi
52
53 if test -n "$ngx_module_deps"; then
54 NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_module_deps"
55 fi
56
57 for lib in $ngx_module_libs
58 do
59 case $lib in
60
61 PCRE | OPENSSL | MD5 | SHA1 | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
62 eval USE_${lib}=YES
63 ;;
64
65 *)
66 CORE_LIBS="$CORE_LIBS $lib"
67 ;;
68
69 esac
70 done
71 fi