httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgollu...@apache.org
Subject svn commit: r688788 - in /httpd/apreq/trunk: CHANGES glue/perl/Makefile.PL
Date Mon, 25 Aug 2008 17:39:17 GMT
Author: pgollucci
Date: Mon Aug 25 10:39:17 2008
New Revision: 688788

URL: http://svn.apache.org/viewvc?rev=688788&view=rev
Log:
Fix the build with autoconf >= 2.62


Modified:
    httpd/apreq/trunk/CHANGES
    httpd/apreq/trunk/glue/perl/Makefile.PL

Modified: httpd/apreq/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/CHANGES?rev=688788&r1=688787&r2=688788&view=diff
==============================================================================
--- httpd/apreq/trunk/CHANGES (original)
+++ httpd/apreq/trunk/CHANGES Mon Aug 25 10:39:17 2008
@@ -4,6 +4,9 @@
 
 @section v2_10 Changes with libapreq2-2.10 (under developement)
 
+- Perl Glue Build [Philip M. Gollucci]
+  config.status format changed format yet again in autoconf 2.62+.
+
 - License [Mladen Turk]
   Add libapreq.rc and generate libapreq.res
 

Modified: httpd/apreq/trunk/glue/perl/Makefile.PL
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/glue/perl/Makefile.PL?rev=688788&r1=688787&r2=688788&view=diff
==============================================================================
--- httpd/apreq/trunk/glue/perl/Makefile.PL (original)
+++ httpd/apreq/trunk/glue/perl/Makefile.PL Mon Aug 25 10:39:17 2008
@@ -37,6 +37,51 @@
     read $file, $_[0], -s $file;
 }
 
+sub cmp_tuples {
+    my ($num_a, $num_b) = @_;
+
+    while (@$num_a && @$num_b) {
+        my $cmp = shift @$num_a <=> shift @$num_b;
+        return $cmp if $cmp;
+    }  
+
+    return @$num_a <=> @$num_b;
+}
+
+sub autoconf_foo {
+    my ($config, $re_start, $re_end, $re_match) = @_;
+
+    $$config =~ /^${re_start}APACHE2_INCLUDES${re_end}($re_match)/m or
+        die "Can't find apache include directory";
+    my $apache_includes = $1;
+    $$config =~ /^${re_start}APR_INCLUDES${re_end}($re_match)/m or
+        die "Can't find apache include directory";
+    $apache_includes .= " $1";
+
+    my $apr_libs ="";
+
+    $$config =~ m/^${re_start}APREQ_LIBNAME${re_end}($re_match)/m or
+        die "Can't find apreq libname";
+
+    ## XXX: 2.60 bug/hack
+    my $apreq_libname = $1;
+
+    $$config =~ m/^${re_start}PACKAGE_VERSION${re_end}($re_match)/m or
+        die "Can't find package version";
+    my $version = $1;
+
+	## Code around an autoconf 2.60 bug
+	## http://lists.gnu.org/archive/html/bug-autoconf/2006-06/msg00127.html
+	## $ grep @PACKAGE_VERSION config.status-2.59 config.status-2.60 
+	## config.status-2.59:s,@PACKAGE_VERSION@,2.09,;t t
+	## config.status-2.60:s,@PACKAGE_VERSION@,|#_!!_#|2.09,g
+	foreach ($apache_includes, $apreq_libname, $version) {
+	    s/\|#_!!_#\|//g;
+	}
+
+    return ($apache_includes, $apr_libs, $apreq_libname, $version);
+}
+
 my ($apache_includes, $apache_dir, $apr_libs, $apreq_libname, $perl_lib);
 
 if (WIN32) {
@@ -63,43 +108,23 @@
 }
 else {
     slurp my $config => "$base_dir/config.status";
-    $config =~ /^s,\@APACHE2_INCLUDES\@,([^,]+)/m or
-    $config =~ /^S\["APACHE2_INCLUDES"\]="([^"]+)/m or
-        die "Can't find apache include directory";
-    $apache_includes = $1;
-    $config =~ /^s,\@APR_INCLUDES\@,([^,]+)/m or
-    $config =~ /^S\["APR_INCLUDES"\]="([^"]+)/m or
-        die "Can't find apache include directory";
-    $apache_includes .= " $1";
-
-#    $config =~ m/^s,\@APR_LDFLAGS\@,([^,]+)/m or
-#        die "Can't find apr ldflags";
-#    $apr_libs = $1;
-
-#    $config =~ m/^s,\@APR_LIBS\@,([^,]+)/m or
-#        die "Can't find apr libraries";
-#    $apr_libs .= " $1";
 
-    $apr_libs ="";
+    $config =~ /GNU Autoconf (\d+\.\d+)/;
+    my $autoconf_ver = $1;
 
-    $config =~ m/^s,\@APREQ_LIBNAME\@,([^,]+)/m or
-    $config =~ m/^S\["APREQ_LIBNAME"\]="([^"]+)/m or
-        die "Can't find apreq libname";
-    $apreq_libname = $1;
-
-    $config =~ m/^s,\@PACKAGE_VERSION\@,([^,]+)/m or
-    $config =~ m/^S\["PACKAGE_VERSION"\]="([^"]+)/m or
-        die "Can't find package version";
-    $version = $1;
+    ### XXX: Lord have mercy on us.....
+    if (cmp_tuples([split /\./, $autoconf_ver], [qw(2 61)]) > 0) {
+        ### Autoconf >=2.62 changed the format of the file
+        ### I.E.: S["APACHE2_INCLUDES"]="-I/usr/local/include/apache2"
+        ($apache_includes, $apr_libs, $apreq_libname, $version) = 
+           autoconf_foo(\$config, qr/S\[\"/, qr/\"\]=\"/, qr/[^\"]+/);
+    }
+    else {
+       ### I.E.: s,@APACHE2_INCLUDES@,-I/usr/local/include/apache22,;t t
+       ($apache_includes, $apr_libs, $apreq_libname, $version) = 
+          autoconf_foo(\$config, qr/s,\@/, qr/\@,/, qr/[^,]+/);
+    }
 
-		## Code around an autoconf 2.60 bug
-		## http://lists.gnu.org/archive/html/bug-autoconf/2006-06/msg00127.html
-		## $ grep @PACKAGE_VERSION config.status-2.59 config.status-2.60 
-		## config.status-2.59:s,@PACKAGE_VERSION@,2.09,;t t
-		## config.status-2.60:s,@PACKAGE_VERSION@,|#_!!_#|2.09,g
-		foreach ($apache_includes, $apreq_libname, $version) {
-		    s/\|#_!!_#\|//g;
-		}
 }
 
 my $apreq_libs = WIN32 ?



Mime
View raw message