summaryrefslogtreecommitdiffhomepage
path: root/auto/module
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-02-04 18:30:21 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-02-04 18:30:21 +0300
commit0805ba14e7a25bc61627d6ece2a79243fe0b640a (patch)
tree90d561ef5b132d5ad1f84c1f3d4e8882bd0b7b68 /auto/module
parent359803e457b85fd931f182bcdab6eaf953426449 (diff)
downloadnginx-0805ba14e7a25bc61627d6ece2a79243fe0b640a.tar.gz
nginx-0805ba14e7a25bc61627d6ece2a79243fe0b640a.tar.bz2
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.
Diffstat (limited to 'auto/module')
-rw-r--r--auto/module71
1 files changed, 71 insertions, 0 deletions
diff --git a/auto/module b/auto/module
new file mode 100644
index 000000000..33ee18126
--- /dev/null
+++ b/auto/module
@@ -0,0 +1,71 @@
+
+# Copyright (C) Ruslan Ermilov
+# Copyright (C) Nginx, Inc.
+
+
+case $ngx_module_type in
+ HTTP_*) ngx_var=HTTP ;;
+ *) ngx_var=$ngx_module_type ;;
+esac
+
+
+if [ "$ngx_module_link" = YES ]; then
+
+ eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
+ $ngx_module_name\"
+
+ eval ${ngx_var}_SRCS=\"\$${ngx_var}_SRCS $ngx_module_srcs\"
+
+ if test -n "$ngx_module_incs"; then
+ eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
+ fi
+
+ if test -n "$ngx_module_deps"; then
+ eval ${ngx_var}_DEPS=\"\$${ngx_var}_DEPS $ngx_module_deps\"
+ fi
+
+ for lib in $ngx_module_libs
+ do
+ case $lib in
+
+ PCRE | OPENSSL | MD5 | SHA1 | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
+ eval USE_${lib}=YES
+ ;;
+
+ *)
+ CORE_LIBS="$CORE_LIBS $lib"
+ ;;
+
+ esac
+ done
+
+elif [ "$ngx_module_link" = ADDON ]; then
+
+ eval ${ngx_module_type}_MODULES=\"\$${ngx_module_type}_MODULES \
+ $ngx_module_name\"
+
+ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_module_srcs"
+
+ if test -n "$ngx_module_incs"; then
+ eval ${ngx_var}_INCS=\"\$${ngx_var}_INCS $ngx_module_incs\"
+ fi
+
+ if test -n "$ngx_module_deps"; then
+ NGX_ADDON_DEPS="$NGX_ADDON_DEPS $ngx_module_deps"
+ fi
+
+ for lib in $ngx_module_libs
+ do
+ case $lib in
+
+ PCRE | OPENSSL | MD5 | SHA1 | ZLIB | LIBXSLT | LIBGD | PERL | GEOIP)
+ eval USE_${lib}=YES
+ ;;
+
+ *)
+ CORE_LIBS="$CORE_LIBS $lib"
+ ;;
+
+ esac
+ done
+fi