perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick *** <>
Subject Re: Some small fixes...
Date Thu, 12 May 2005 09:28:50 GMT
 >> Why MP_AP_PREFIX and MP_APR_CONFIG cannot be used together? I guess 
 >> this is valid only when MP_AP_PREFIX is pointing to an installed httpd,
 >>  because when MP_AP_PREFIX is pointing to a source tree, I can get
 >> around this check by adding MP_AP_CONFIGURE="--with-apr=...". It's
 >> logical to me that this check should work only when MP_AP_PREFIX is not
 >> pointing to a source tree, because, I think, it shouldn't be possible
 >> to build mod_perl with different apr than the one httpd was build with.
 >> But then again, if the above is true, there should be the same check
 >> for MP_APR_CONFIG and MP_APXS, because as I see in Apache2::Build,
 >> MP_APR_CONFIG will take precedence over the value supplied by apxs. Is
 >> my guess a good one?
 >While MP_AP_PREFIX originally was used to point to the install tree, it's 
 >no longer the case. MP_AP_PREFIX should only be used when building a 
 >statically linked httpd/mod_perl. In which case you don't need 
 >MP_APR_CONFIG, since all the needed sources live under MP_AP_PREFIX.

But if I have previously installed apr in /usr/apr,
and when I want to build a static MP and want both apache and MP to use /usr/apr instead of
srclib/apr, I'd like to use
perl Makefile.PL MP_AP_PREFIX=../httpd MP_APR_CONFIG=/usr/apr/apr-config

 >Why would you want to use a different libapr? If you do that you will end 
 >up with Apache linking against one libapr and mod_perl against another, 
 >which is a certain way to get things crashed.
Yes, the following patch fixes that. What it does is:
1. Allow the use of both MP_AP_PREFIX and MP_AP(R|U)_CONFIG when MP_AP_PREFIX is pointing
to a source tree.
2. Currently, if it's a static build and MP_AP(R|U)_CONFIG is set, mod_perl will use it, but
apache won't. It's fixed now. Note that
if both MP_APR_CONFIG and MP_AP_CONFIGURE="--with-apr=..." are set, MP_APR_CONFIG will take
3. A better check whether --with-apr=/path is a file

Index: lib/ModPerl/
--- lib/ModPerl/	(revision 169434)
+++ lib/ModPerl/	(working copy)
@@ -43,8 +43,9 @@
         error "You need to pass either MP_AP_PREFIX or MP_APXS, but not both";
         die "\n";
-    if ($build->{MP_AP_PREFIX} and $build->{MP_APR_CONFIG}) {
-        error "You need to pass either MP_AP_PREFIX or MP_APR_CONFIG, " .
+    if ($build->{MP_AP_PREFIX} and !$build->httpd_is_source_tree  and
+    ($build->{MP_APR_CONFIG} or $build->{MP_APU_CONFIG})) {
+        error "You need to pass either MP_AP_PREFIX or MP_AP(R|U)_CONFIG, " .
             "but not both";
         die "\n";
Index: lib/Apache2/
--- lib/Apache2/	(revision 169434)
+++ lib/Apache2/	(working copy)
@@ -323,7 +323,18 @@
         system("$cd && $cmd") == 0 or die "httpd: $cmd failed";

-    my $cmd = qq(./configure $self->{MP_AP_CONFIGURE});
+    my $apru_args = '';
+    if ($self->{MP_APR_CONFIG} and -x $self->{MP_APR_CONFIG}) {
+        $self->{MP_AP_CONFIGURE} =~ s/--with-apr=\S+//g;
+        $apru_args .= "--with-apr=$self->{MP_APR_CONFIG} ";
+    }
+    if ($self->{MP_APU_CONFIG} and -x $self->{MP_APU_CONFIG}) {
+        $self->{MP_AP_CONFIGURE} =~ s/--with-apr-util=\S+//g;
+        $apru_args .= "--with-apr-util=$self->{MP_APU_CONFIG} ";
+    }
+    my $cmd = qq(./configure $self->{MP_AP_CONFIGURE} $apru_args);
     debug "Running $cmd";
     system("$cd && $cmd") == 0 or die "httpd: $cmd failed";

@@ -1116,7 +1127,7 @@
             if ($self->{MP_AP_CONFIGURE} &&
                 $self->{MP_AP_CONFIGURE} =~ /--with-${what_long}=(\S+)/) {
                 my $dir = $1;
-                $dir =~ s/$config$// unless -d $dir;
+                $dir = dirname($dir) if -e $dir and !-d $dir;
                 push @tries, grep -d $_, $dir, catdir $dir, 'bin';

----------------------------------------------------------------- - Избери твоят web дизайн. Каталог от над
5000 професионални темплейта

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message