1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-28 10:08:24 +00:00

Fix an autoconf-2.61->2.62 piece of fallout

PR:		126830
Submitted by:	pgollucci@
Hat:		autotools dude
This commit is contained in:
Ade Lovett 2008-08-26 18:59:39 +00:00
parent 43fb4e70c3
commit 85a0fbb52a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=219239
2 changed files with 96 additions and 21 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= libapreq2
PORTVERSION= 2.08
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= www devel
MASTER_SITES= ${MASTER_SITE_APACHE_HTTPD}
MASTER_SITE_SUBDIR=libapreq

View File

@ -1,29 +1,104 @@
--- glue/perl/Makefile.PL.orig Wed Aug 9 06:26:45 2006
+++ glue/perl/Makefile.PL Wed Oct 3 11:48:26 2007
@@ -69,6 +69,7 @@
$config =~ /^s,\@APR_INCLUDES\@,([^,]+)/m or
die "Can't find apache include directory";
$apache_includes .= " $1";
+ $apache_includes =~ s,\|\#_!!_\#\|,,g;
--- glue/perl/Makefile.PL.orig 2006-08-09 04:26:45.000000000 +0000
+++ glue/perl/Makefile.PL 2008-08-25 18:07:08.000000000 +0000
@@ -37,6 +37,50 @@
read $file, $_[0], -s $file;
}
# $config =~ m/^s,\@APR_LDFLAGS\@,([^,]+)/m or
# die "Can't find apr ldflags";
@@ -82,12 +83,11 @@
+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";
+
+ 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);
$config =~ m/^s,\@APREQ_LIBNAME\@,([^,]+)/m or
die "Can't find apreq libname";
- $apreq_libname = $1;
+ $apreq_libname = $1; $apreq_libname =~ s,^\|\#_!!_\#\|,,;
$config =~ m/^s,\@PACKAGE_VERSION\@,([^,]+)/m or
die "Can't find package version";
- $version = $1;
if (WIN32) {
@@ -63,31 +107,22 @@
}
else {
slurp my $config => "$base_dir/config.status";
- $config =~ /^s,\@APACHE2_INCLUDES\@,([^,]+)/m or
- die "Can't find apache include directory";
- $apache_includes = $1;
- $config =~ /^s,\@APR_INCLUDES\@,([^,]+)/m or
- die "Can't find apache include directory";
- $apache_includes .= " $1";
-
+ $version = $1; $version =~ s,^\|\#_!!_\#\|,,;
-# $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 =~ m/^s,\@APREQ_LIBNAME\@,([^,]+)/m or
- die "Can't find apreq libname";
- $apreq_libname = $1;
-
- $config =~ m/^s,\@PACKAGE_VERSION\@,([^,]+)/m or
- die "Can't find package version";
- $version = $1;
+ $config =~ /GNU Autoconf (\d+\.\d+)/;
+ my $autoconf_ver = $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/[^,]+/);
+ }
}
my $apreq_libs = WIN32 ?
@@ -415,8 +415,8 @@
@@ -415,8 +450,8 @@
'NAME' => '$class',
'VERSION' => '$version',
'TYPEMAPS' => [qw(@$mp2_typemaps $typemap)],