]> git.kaiwu.me - nginx.git/commitdiff
Dynamic modules: perl.
authorRuslan Ermilov <ru@nginx.com>
Fri, 26 Feb 2016 11:27:04 +0000 (14:27 +0300)
committerRuslan Ermilov <ru@nginx.com>
Fri, 26 Feb 2016 11:27:04 +0000 (14:27 +0300)
auto/install
auto/lib/conf
auto/lib/make
auto/lib/perl/conf
auto/lib/perl/make
auto/make
auto/module
auto/modules
auto/options

index 36226ade4d5e9c9337ced488bc10e9e98fdb1eb7..6efa92f735d6616e449875a8da765351d2f70f1a 100644 (file)
@@ -3,7 +3,7 @@
 # Copyright (C) Nginx, Inc.
 
 
-if [ $USE_PERL = YES ]; then
+if [ $USE_PERL != NO ]; then
 
     cat << END                                                >> $NGX_MAKEFILE
 
index 6aaa43a5f910cfa1ddb38306c5f3be6d9f359a87..a6242e7819cab28aae09801658ee68655a9140f3 100644 (file)
@@ -66,7 +66,7 @@ if [ $USE_LIBGD != NO ]; then
     . auto/lib/libgd/conf
 fi
 
-if [ $USE_PERL = YES ]; then
+if [ $USE_PERL != NO ]; then
     . auto/lib/perl/conf
 fi
 
index 58a84a34cac9bcfa185874c39d584e724b033e10..6298b940ffa1d999b424246df07fb4660cebb0fc 100644 (file)
@@ -27,6 +27,6 @@ if [ $NGX_LIBATOMIC != NO -a $NGX_LIBATOMIC != YES ]; then
     . auto/lib/libatomic/make
 fi
 
-if [ $USE_PERL = YES ]; then
+if [ $USE_PERL != NO ]; then
     . auto/lib/perl/make
 fi
index 4d1bcf128f6095cbdf8bb7432e17af94373011f7..f5f5d3e57ee871c26310bc3ea8f7a8ecfd04bf99 100644 (file)
@@ -60,8 +60,11 @@ if test -n "$NGX_PERL_VER"; then
                          | sed -e 's/-arch i386//' -e 's/-arch x86_64//'`
     fi
 
-    CORE_LINK="$CORE_LINK $ngx_perl_ldopts"
-    LINK_DEPS="$LINK_DEPS $NGX_OBJS/$ngx_perl_module"
+    if [ $USE_PERL = YES ]; then
+        CORE_LINK="$CORE_LINK $ngx_perl_ldopts"
+    fi
+
+    NGX_LIB_PERL="$ngx_perl_ldopts"
 
     if test -n "$NGX_PERL_MODULES"; then
         have=NGX_PERL_MODULES value="(u_char *) \"$NGX_PERL_MODULES\""
index d1c1b9e48c1e8ccf21ab26f5483ae59d6552cba9..8af8902f5c0b8f5b2fe3c154c5a99fad11a28751 100644 (file)
@@ -8,7 +8,10 @@ v=`grep 'define NGINX_VERSION' src/core/nginx.h | sed -e 's/^.*"\(.*\)".*/\1/'`
 
 cat << END                                                    >> $NGX_MAKEFILE
 
-$NGX_OBJS/src/http/modules/perl/blib/arch/auto/nginx/nginx.$ngx_perl_dlext: \\
+$NGX_OBJS/src/http/modules/perl/ngx_http_perl_module.o: \\
+               $NGX_OBJS/$ngx_perl_module
+
+$NGX_OBJS/$ngx_perl_module: \\
                \$(CORE_DEPS) \$(HTTP_DEPS) \\
                src/http/modules/perl/ngx_http_perl_module.h \\
                $NGX_OBJS/src/http/modules/perl/Makefile
index e2e8e29831bf368d2ee0d5151bd83e9b8a3f2f61..87218e955c4a479ebfb3fe2fa5cb0fa1c777f394 100644 (file)
--- a/auto/make
+++ b/auto/make
@@ -281,7 +281,7 @@ if [ $HTTP = YES ]; then
         ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
     else
         ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)"
-        ngx_perl_cc="\$(CC) $ngx_compile_opt \$(NGX_PERL_CFLAGS) "
+        ngx_perl_cc="\$(CC) $ngx_compile_opt \$(NGX_PERL_CFLAGS)"
         ngx_perl_cc="$ngx_perl_cc \$(CORE_INCS) \$(HTTP_INCS)"
     fi
 
@@ -494,6 +494,8 @@ if test -n "$NGX_PCH"; then
     ngx_cc="\$(CC) $ngx_compile_opt $ngx_pic_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
 else
     ngx_cc="\$(CC) $ngx_compile_opt $ngx_pic_opt \$(CFLAGS) \$(ALL_INCS)"
+    ngx_perl_cc="\$(CC) $ngx_compile_opt $ngx_pic_opt \$(NGX_PERL_CFLAGS)"
+    ngx_perl_cc="$ngx_perl_cc \$(ALL_INCS)"
 fi
 
 ngx_obj_deps="\$(CORE_DEPS)"
@@ -639,15 +641,15 @@ $ngx_modules_obj: \$(CORE_DEPS)$ngx_cont$ngx_modules_c
 
 END
 
-    for ngx_src in $ngx_module_srcs
+    for ngx_source in $ngx_module_srcs
     do
-        case "$ngx_src" in
+        case "$ngx_source" in
             src/*)
-                ngx_obj=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
+                ngx_obj=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
                 ;;
             *)
-                ngx_obj="addon/`basename \`dirname $ngx_src\``"
-                ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
+                ngx_obj="addon/`basename \`dirname $ngx_source\``"
+                ngx_obj=`echo $ngx_obj/\`basename $ngx_source\` \
                     | sed -e "s/\//$ngx_regex_dirsep/g"`
                 ;;
         esac
@@ -658,14 +660,25 @@ END
                   -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
                   -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
 
-        ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
+        ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
 
-        cat << END                                        >> $NGX_MAKEFILE
+        if [ $ngx_source = src/http/modules/perl/ngx_http_perl_module.c ]; then
+
+            cat << END                                        >> $NGX_MAKEFILE
+
+$ngx_obj:      $ngx_obj_deps$ngx_cont$ngx_src
+       $ngx_perl_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
+
+END
+        else
+
+            cat << END                                        >> $NGX_MAKEFILE
 
 $ngx_obj:      $ngx_obj_deps$ngx_cont$ngx_src
        $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
 
 END
 
+        fi
     done
 done
index 908f0c6e6d27b9e4d79a88657d13005799da64d3..16a816f67a4040ef3567f37f878a71f4207fd434 100644 (file)
@@ -40,7 +40,7 @@ if [ "$ngx_module_link" = DYNAMIC ]; then
     do
         case $lib in
 
-            LIBXSLT | LIBGD | GEOIP)
+            LIBXSLT | LIBGD | GEOIP | PERL)
                 libs="$libs \$NGX_LIB_$lib"
 
                 if eval [ "\$USE_${lib}" = NO ] ; then
@@ -48,7 +48,7 @@ if [ "$ngx_module_link" = DYNAMIC ]; then
                 fi
             ;;
 
-            PCRE | OPENSSL | MD5 | SHA1 | ZLIB | PERL)
+            PCRE | OPENSSL | MD5 | SHA1 | ZLIB)
                 eval USE_${lib}=YES
             ;;
 
index ebfc91ddf9677cd448822e6e37711a89691e5def..22ff6d946fb6897163d9be106b44fadde5606ade 100644 (file)
@@ -727,14 +727,12 @@ if [ $HTTP_SCGI = YES ]; then
     . auto/module
 fi
 
-if [ $HTTP_PERL = YES ]; then
-    USE_PERL=YES
-
+if [ $HTTP_PERL != NO ]; then
     ngx_module_name=ngx_http_perl_module
     ngx_module_incs=src/http/modules/perl
     ngx_module_deps=src/http/modules/perl/ngx_http_perl_module.h
     ngx_module_srcs=src/http/modules/perl/ngx_http_perl_module.c
-    ngx_module_libs=
+    ngx_module_libs=PERL
     ngx_module_link=$HTTP_PERL
 
     . auto/module
index 36b34bc310cdbddf9707f23fbc7443f753ebb0e2..8ac6aa4373373bb83572fb5d611c18347d715700 100644 (file)
@@ -271,6 +271,7 @@ do
         --without-http_upstream_zone_module) HTTP_UPSTREAM_ZONE=NO  ;;
 
         --with-http_perl_module)         HTTP_PERL=YES              ;;
+        --with-http_perl_module=dynamic) HTTP_PERL=DYNAMIC          ;;
         --with-perl_modules_path=*)      NGX_PERL_MODULES="$value"  ;;
         --with-perl=*)                   NGX_PERL="$value"          ;;
 
@@ -452,6 +453,7 @@ cat << END
                                      disable ngx_http_upstream_zone_module
 
   --with-http_perl_module            enable ngx_http_perl_module
+  --with-http_perl_module=dynamic    enable dynamic ngx_http_perl_module
   --with-perl_modules_path=PATH      set Perl modules path
   --with-perl=PATH                   set perl binary pathname