Author: gozer
Date: Fri Dec 23 18:20:27 2011
New Revision: 1222775

URL: http://svn.apache.org/viewvc?rev=1222775&view=rev
Log:
Discover apr-2-config from Apache 2.4 onwards.


Modified:
    perl/modperl/trunk/Changes
    perl/modperl/trunk/lib/Apache2/Build.pm

Modified: perl/modperl/trunk/Changes
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/Changes?rev=1222775&r1=1222774&r2=1222775&view=diff
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Fri Dec 23 18:20:27 2011
@@ -12,6 +12,8 @@ Also refer to the Apache::Test changes l
 
 =item 2.0.6-dev
 
+Discover apr-2-config from Apache 2.4 onwards. [Gozer]
+
 Apache 2.4 and onwards doesn't require linking the MPM module directly in
 the httpd binary anymore. APXS lost the MPM_NAME query, so we can't assume
 a given MPM anymore. Introduce a fake MPM 'dynamic' to represent this. 

Modified: perl/modperl/trunk/lib/Apache2/Build.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/lib/Apache2/Build.pm?rev=1222775&r1=1222774&r2=1222775&view=diff
==============================================================================
--- perl/modperl/trunk/lib/Apache2/Build.pm (original)
+++ perl/modperl/trunk/lib/Apache2/Build.pm Fri Dec 23 18:20:27 2011
@@ -1153,7 +1153,18 @@ sub apr_bindir {
 
 sub apr_generation {
     my ($self) = @_;
-    return $self->httpd_version_as_int =~ m/2[1-9]\d+/ ? 1 : 0;
+
+    my $httpd_v = $self->httpd_version_as_int;
+
+    if ($httpd_v =~ m/2[4-9]\d+/) {
+        return 2;
+    }
+    elsif ($httpd_v =~ m/2[1-3]\d+/) {
+        return 1;
+    }
+    else {
+        return;
+    }
 }
 
 # returns an array of apr/apu linking flags (--link-ld --libs) if found
@@ -1213,7 +1224,8 @@ sub apru_config_path {
         $self->{$key} = $self->{$mp_key};
     }
 
-    my $config = $self->apr_generation ? "$what-1-config" : "$what-config";
+    my $apr_generation = $self->apr_generation;
+    my $config = $apr_generation ? "$what-${apr_generation}-config" : 
"$what-config";
 
     if (!$self->{$key}) {
         my @tries = ();


Reply via email to