|
Lines 1-29
Link Here
|
| 1 |
--- glue/perl/Makefile.PL.orig Wed Aug 9 06:26:45 2006 |
1 |
--- glue/perl/Makefile.PL.orig 2006-08-09 04:26:45.000000000 +0000 |
| 2 |
+++ glue/perl/Makefile.PL Wed Oct 3 11:48:26 2007 |
2 |
+++ glue/perl/Makefile.PL 2008-08-25 18:07:08.000000000 +0000 |
| 3 |
@@ -69,6 +69,7 @@ |
3 |
@@ -37,6 +37,50 @@ |
| 4 |
$config =~ /^s,\@APR_INCLUDES\@,([^,]+)/m or |
4 |
read $file, $_[0], -s $file; |
| 5 |
die "Can't find apache include directory"; |
5 |
} |
| 6 |
$apache_includes .= " $1"; |
|
|
| 7 |
+ $apache_includes =~ s,\|\#_!!_\#\|,,g; |
| 8 |
|
6 |
|
| 9 |
# $config =~ m/^s,\@APR_LDFLAGS\@,([^,]+)/m or |
7 |
+sub cmp_tuples { |
| 10 |
# die "Can't find apr ldflags"; |
8 |
+ my ($num_a, $num_b) = @_; |
| 11 |
@@ -82,12 +83,11 @@ |
9 |
+ |
|
|
10 |
+ while (@$num_a && @$num_b) { |
| 11 |
+ my $cmp = shift @$num_a <=> shift @$num_b; |
| 12 |
+ return $cmp if $cmp; |
| 13 |
+ } |
| 14 |
+ |
| 15 |
+ return @$num_a <=> @$num_b; |
| 16 |
+} |
| 17 |
+ |
| 18 |
+sub autoconf_foo { |
| 19 |
+ my ($config, $re_start, $re_end, $re_match) = @_; |
| 20 |
+ |
| 21 |
+ $$config =~ /^${re_start}APACHE2_INCLUDES${re_end}($re_match)/m or |
| 22 |
+ die "Can't find apache include directory"; |
| 23 |
+ my $apache_includes = $1; |
| 24 |
+ $$config =~ /^${re_start}APR_INCLUDES${re_end}($re_match)/m or |
| 25 |
+ die "Can't find apache include directory"; |
| 26 |
+ $apache_includes .= " $1"; |
| 27 |
+ |
| 28 |
+ my $apr_libs =""; |
| 29 |
+ |
| 30 |
+ $$config =~ m/^${re_start}APREQ_LIBNAME${re_end}($re_match)/m or |
| 31 |
+ die "Can't find apreq libname"; |
| 32 |
+ |
| 33 |
+ my $apreq_libname = $1; |
| 34 |
+ |
| 35 |
+ $$config =~ m/^${re_start}PACKAGE_VERSION${re_end}($re_match)/m or |
| 36 |
+ die "Can't find package version"; |
| 37 |
+ my $version = $1; |
| 38 |
+ |
| 39 |
+ ## Code around an autoconf 2.60 bug |
| 40 |
+ ## http://lists.gnu.org/archive/html/bug-autoconf/2006-06/msg00127.html |
| 41 |
+ ## $ grep @PACKAGE_VERSION config.status-2.59 config.status-2.60 |
| 42 |
+ ## config.status-2.59:s,@PACKAGE_VERSION@,2.09,;t t |
| 43 |
+ ## config.status-2.60:s,@PACKAGE_VERSION@,|#_!!_#|2.09,g |
| 44 |
+ foreach ($apache_includes, $apreq_libname, $version) { |
| 45 |
+ s/\|#_!!_#\|//g; |
| 46 |
+ } |
| 47 |
+ |
| 48 |
+ return ($apache_includes, $apr_libs, $apreq_libname, $version); |
| 49 |
+} |
| 50 |
+ |
| 51 |
my ($apache_includes, $apache_dir, $apr_libs, $apreq_libname, $perl_lib); |
| 12 |
|
52 |
|
| 13 |
$config =~ m/^s,\@APREQ_LIBNAME\@,([^,]+)/m or |
53 |
if (WIN32) { |
| 14 |
die "Can't find apreq libname"; |
54 |
@@ -63,31 +107,22 @@ |
|
|
55 |
} |
| 56 |
else { |
| 57 |
slurp my $config => "$base_dir/config.status"; |
| 58 |
- $config =~ /^s,\@APACHE2_INCLUDES\@,([^,]+)/m or |
| 59 |
- die "Can't find apache include directory"; |
| 60 |
- $apache_includes = $1; |
| 61 |
- $config =~ /^s,\@APR_INCLUDES\@,([^,]+)/m or |
| 62 |
- die "Can't find apache include directory"; |
| 63 |
- $apache_includes .= " $1"; |
| 64 |
- |
| 65 |
-# $config =~ m/^s,\@APR_LDFLAGS\@,([^,]+)/m or |
| 66 |
-# die "Can't find apr ldflags"; |
| 67 |
-# $apr_libs = $1; |
| 68 |
- |
| 69 |
-# $config =~ m/^s,\@APR_LIBS\@,([^,]+)/m or |
| 70 |
-# die "Can't find apr libraries"; |
| 71 |
-# $apr_libs .= " $1"; |
| 72 |
- |
| 73 |
- $apr_libs =""; |
| 74 |
- |
| 75 |
- $config =~ m/^s,\@APREQ_LIBNAME\@,([^,]+)/m or |
| 76 |
- die "Can't find apreq libname"; |
| 15 |
- $apreq_libname = $1; |
77 |
- $apreq_libname = $1; |
| 16 |
+ $apreq_libname = $1; $apreq_libname =~ s,^\|\#_!!_\#\|,,; |
|
|
| 17 |
|
| 18 |
$config =~ m/^s,\@PACKAGE_VERSION\@,([^,]+)/m or |
| 19 |
die "Can't find package version"; |
| 20 |
- $version = $1; |
| 21 |
- |
78 |
- |
| 22 |
+ $version = $1; $version =~ s,^\|\#_!!_\#\|,,; |
79 |
- $config =~ m/^s,\@PACKAGE_VERSION\@,([^,]+)/m or |
|
|
80 |
- die "Can't find package version"; |
| 81 |
- $version = $1; |
| 82 |
|
| 83 |
+ $config =~ /GNU Autoconf (\d+\.\d+)/; |
| 84 |
+ my $autoconf_ver = $1; |
| 85 |
+ |
| 86 |
+ ### XXX: Lord have mercy on us..... |
| 87 |
+ if (cmp_tuples([split /\./, $autoconf_ver], [qw(2 61)]) > 0) { |
| 88 |
+ ### Autoconf >=2.62 changed the format of the file |
| 89 |
+ ### I.E.: S["APACHE2_INCLUDES"]="-I/usr/local/include/apache2" |
| 90 |
+ ($apache_includes, $apr_libs, $apreq_libname, $version) = |
| 91 |
+ autoconf_foo(\$config, qr/S\[\"/, qr/\"\]=\"/, qr/[^\"]+/); |
| 92 |
+ } |
| 93 |
+ else { |
| 94 |
+ ### I.E.: s,@APACHE2_INCLUDES@,-I/usr/local/include/apache22,;t t |
| 95 |
+ ($apache_includes, $apr_libs, $apreq_libname, $version) = |
| 96 |
+ autoconf_foo(\$config, qr/s,\@/, qr/\@,/, qr/[^,]+/); |
| 97 |
+ } |
| 23 |
} |
98 |
} |
| 24 |
|
99 |
|
| 25 |
my $apreq_libs = WIN32 ? |
100 |
my $apreq_libs = WIN32 ? |
| 26 |
@@ -415,8 +415,8 @@ |
101 |
@@ -415,8 +450,8 @@ |
| 27 |
'NAME' => '$class', |
102 |
'NAME' => '$class', |
| 28 |
'VERSION' => '$version', |
103 |
'VERSION' => '$version', |
| 29 |
'TYPEMAPS' => [qw(@$mp2_typemaps $typemap)], |
104 |
'TYPEMAPS' => [qw(@$mp2_typemaps $typemap)], |