geoff 2004/08/06 05:55:48
Modified: . Makefile.PL
lib/Apache Build.pm
lib/ModPerl Config.pm
xs/APR/APR Makefile.PL
Log:
find apr-config or apr-1-config, depending on
which version of httpd we're building against,
so we can compile against httpd 2.1.
this still needs work. some things to consider are:
- not depending on httpd version, since APR can be built without httpd
- using httpd version if MP_APXS or MP_AP_PREFIX, and requiring
MP_APR_CONFIG for APR-only builds
- somehow calling APR APR_FIND_APR function (or equivalent utility)
to dig out the APR version
also, all of this should be refactored into one place so that everyone
calls $build->apr_config_executable() or somesuch.
Revision Changes Path
1.152 +5 -1 modperl-2.0/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -r1.151 -r1.152
--- Makefile.PL 1 Aug 2004 19:44:00 -0000 1.151
+++ Makefile.PL 6 Aug 2004 12:55:47 -0000 1.152
@@ -101,10 +101,14 @@
# top-level Makefile.PL overrides MY::pasthru, and defines DEFINE= which
# overrides any local definition, not sure what's the right fix, for
# now just define it here (should it define PASTHRU_DEFINE instead?)
+ my @configs = $build->httpd_version_as_int =~ m/21\d+/
+ ? qw(apr-1 apu-1)
+ : qw(apr apu);
+
if (my $apr_bindir = $build->apr_bindir()) {
my $ext = WIN32 ? '.bat' : '';
my @apr_libs = grep $_, map { -x $_ && qx{$_ --link-ld} }
- map { qq{$apr_bindir/$_-config$ext} } qw(apr apu);
+ map { qq{$apr_bindir/$_-config$ext} } @configs;
$opt_define = '-DMP_HAVE_APR_LIBS' if @apr_libs;
}
1.168 +6 -2 modperl-2.0/lib/Apache/Build.pm
Index: Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -r1.167 -r1.168
--- Build.pm 6 Aug 2004 00:54:35 -0000 1.167
+++ Build.pm 6 Aug 2004 12:55:48 -0000 1.168
@@ -945,6 +945,10 @@
$self->{apr_config_path} = $self->{MP_APR_CONFIG};
}
+ my $config = $self->httpd_version_as_int =~ m/21\d+/
+ ? 'apr-1-config'
+ : 'apr-config';
+
if (!$self->{apr_config_path}) {
my @tries = ();
if ($self->httpd_is_source_tree) {
@@ -960,7 +964,7 @@
if exists $self->{MP_AP_PREFIX} and -d $self->{MP_AP_PREFIX};
}
- @tries = map { catfile $_, "apr-config" } @tries;
+ @tries = map { catfile $_, $config } @tries;
if (WIN32) {
my $ext = '.bat';
for (@tries) {
@@ -974,7 +978,7 @@
}
}
- $self->{apr_config_path} ||= Apache::TestConfig::which('apr-config');
+ $self->{apr_config_path} ||= Apache::TestConfig::which($config);
# apr_bindir makes sense only if httpd/apr is installed, if we are
# building against the source tree we can't link against
1.13 +5 -1 modperl-2.0/lib/ModPerl/Config.pm
Index: Config.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Config.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Config.pm 2 Jul 2004 01:28:36 -0000 1.12
+++ Config.pm 6 Aug 2004 12:55:48 -0000 1.13
@@ -59,9 +59,13 @@
# apr
$cfg .= "\n\n*** (apr|apu)-config linking info\n\n";
if (my $apr_bindir = $build_config->apr_bindir()) {
+ my @configs = $build_config->httpd_version_as_int =~ m/21\d+/
+ ? qw(apr-1 apu-1)
+ : qw(apr apu);
+
my $ext = WIN32 ? '.bat' : '';
my @libs = grep $_, map { -x $_ && qx{$_ --link-ld --libs} }
- map { qq{$apr_bindir/$_-config$ext} } qw(apr apu);
+ map { qq{$apr_bindir/$_-config$ext} } @configs;
chomp @libs;
my $libs = join "\n", @libs;
$cfg .= "$libs\n\n";
1.27 +5 -1 modperl-2.0/xs/APR/APR/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- Makefile.PL 1 Aug 2004 19:44:01 -0000 1.26
+++ Makefile.PL 6 Aug 2004 12:55:48 -0000 1.27
@@ -22,10 +22,14 @@
if (my $apr_bindir = $build->apr_bindir()) {
+ my @configs = $build->httpd_version_as_int =~ m/21\d+/
+ ? qw(apr-1 apu-1)
+ : qw(apr apu);
+
# XXX: this works only with libapr 0.9.2+
my $ext = WIN32 ? '.bat' : '';
my @libs = grep $_, map { -x $_ && qx{$_ --link-ld --libs} }
- map { qq{$apr_bindir/$_-config$ext} } qw(apr apu);
+ map { qq{$apr_bindir/$_-config$ext} } @configs;
chomp @libs;
$libs = join ' ', @libs;
}