]> granicus.if.org Git - apache/blobdiff - support/apxs.in
Follow up to r1837822: typo.
[apache] / support / apxs.in
index 5ea3e22147156fc866b48757c1372d418b856311..ad1287ffb1369ee277e650c9295ab75a1a2b2101 100644 (file)
@@ -39,6 +39,8 @@ my $CFG_TARGET     = get_vars("progname");
 my $CFG_SYSCONFDIR = get_vars("sysconfdir");
 my $CFG_CFLAGS     = join ' ', map { get_vars($_) }
   qw(SHLTCFLAGS CFLAGS NOTEST_CPPFLAGS EXTRA_CPPFLAGS EXTRA_CFLAGS);
+my $CFG_LDFLAGS    = join ' ', map { get_vars($_) }
+  qw(LDFLAGS NOTEST_LDFLAGS SH_LDFLAGS);
 my $includedir     = get_vars("includedir");
 my $CFG_INCLUDEDIR = eval qq("$includedir");
 my $CFG_CC         = get_vars("CC");
@@ -236,7 +238,6 @@ sub get_vars {
         }
     }
     $result =~ s|;;$||;
-    $result =~ s|:| |;
     return $result;
 }
 
@@ -449,6 +450,7 @@ if ($opt_c) {
         $opt .= " -l$opt_l";
     }
 
+    my $ldflags = "$CFG_LDFLAGS";
     if ($opt_p == 1) {
         
         my $apr_libs=`$apr_config --cflags --ldflags --link-libtool --libs`;
@@ -467,7 +469,7 @@ if ($opt_c) {
         $opt .= " -rpath $CFG_LIBEXECDIR -module -avoid-version $apr_ldflags";
     }
 
-    push(@cmds, "$libtool $ltflags --mode=link $CFG_CC -o $dso_file $opt $lo");
+    push(@cmds, "$libtool $ltflags --mode=link $CFG_CC $ldflags -o $dso_file $opt $lo");
 
     #   execute the commands
     &execute_cmds(@cmds);
@@ -514,7 +516,7 @@ if ($opt_i or $opt_e) {
                 open(FP, "<$base.c");
                 my $content = join('', <FP>);
                 close(FP);
-                if ($content =~ m|.*module\s+(?:AP_MODULE_DECLARE_DATA\s+)?([a-zA-Z0-9_]+)_module\s*=\s*.*|s) {
+                if ($content =~ m|.*AP_DECLARE_MODULE\s*\(\s*([a-zA-Z0-9_]+)\s*\)\s*=.*|s || $content =~ m|.*module\s+(?:AP_MODULE_DECLARE_DATA\s+)?([a-zA-Z0-9_]+)_module\s*=\s*.*|s) {
                     $name = "$1";
                     $filename = "$base.c";
                     $filename =~ s|^[^/]+/||;
@@ -568,7 +570,10 @@ if ($opt_i or $opt_e) {
         $c = '#' if ($opt_A);
         foreach $lmd (@lmd) {
             my $what = $opt_A ? "preparing" : "activating";
-            if ($content !~ m|\n#?\s*$lmd|) {
+            my $lmd_re = $lmd;
+            $lmd_re =~ s/\s+/\\s+/g;
+
+            if ($content !~ m|\n#?\s*$lmd_re|) {
                 # check for open <containers>, so that the new LoadModule
                 # directive always appears *outside* of an <container>.
 
@@ -631,7 +636,7 @@ if ($opt_i or $opt_e) {
                 }
             } else {
                 # replace already existing LoadModule line
-                $content =~ s|^(.*\n)#?\s*$lmd[^\n]*\n|$1$c$lmd\n|s;
+                $content =~ s|^(.*\n)#?\s*$lmd_re[^\n]*\n|$1$c$lmd\n|s;
             }
             $lmd =~ m|LoadModule\s+(.+?)_module.*|;
             notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]");
@@ -671,7 +676,6 @@ top_builddir=%PREFIX%
 include %INSTALLBUILDDIR%/special.mk
 
 #   the used tools
-APXS=apxs
 APACHECTL=apachectl
 
 #   additional defines, includes and libraries