When I run "perl Makefile.PL" to configure a static mod_perl2 build and have an older version of Apache already installed in the --prefix directory, I get the following error message:


Configuring Apache/2.0.52 mod_perl/1.999.21 Perl/v5.8.5
[  error] Can't find apr include/ directory,
[  error] use MP_APR_CONFIG=/path/to/apr-config

Looking at lib/Apache/Build.pm the following code in subroutine dir seems to be the culprit:

    if (IS_MOD_PERL_BUILD) {
        my $build = $self->build_config;

        if ($dir = $build->{'dir'}) {
            for ($dir, "../$dir", "../../$dir") {
                last if -d ($dir = $_);
            }
        }
    }

    $dir ||= $self->{MP_AP_PREFIX};

If the right directory isn't found in the for loop $dir still contains a value, so the ||= has no effect.

Everything works as expected with the attached patch.

Nick


-- aevum gmbh leopoldstr. 41 80802 münchen germany

fon: +4989 38380653
[EMAIL PROTECTED]
http://aevum.de/
--- mod_perl-2.0.0-RC4/lib/Apache/Build.pm      2005-01-11 09:33:07.000000000 
+0100
+++ mod_perl-2.0.0-RC4-nik/lib/Apache/Build.pm  2005-01-22 21:05:56.638188739 
+0100
@@ -905,11 +905,14 @@
     return $self->{dir} if $self->{dir};
 
     if (IS_MOD_PERL_BUILD) {
-        my $build = $self->build_config;
+        my $bdir = $self->build_config->{dir};
 
-        if ($dir = $build->{'dir'}) {
-            for ($dir, "../$dir", "../../$dir") {
-                last if -d ($dir = $_);
+        if ($bdir) {
+            for ($bdir, "../$bdir", "../../$bdir") {
+                if (-d $_) {
+                    $dir = $_;
+                    last;
+               }
             }
         }
     }

Reply via email to