You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Joe Orton <jo...@redhat.com> on 2004/08/18 14:53:53 UTC

[PATCH] 2.1 build foo

This supports building against a separate apr-util (i.e. where the
apr-util installed $includedir != apr $includedir), and also uses the
output of `apxs -q APR_CONFIG` where available to pick up ap[ru]-config.

I haven't tested that this doesn't break the build against 2.0.x but it
Should Be OK Really (TM).

Index: Build.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.170
diff -u -r1.170 Build.pm
--- Build.pm	15 Aug 2004 00:18:42 -0000	1.170
+++ Build.pm	18 Aug 2004 12:48:12 -0000
@@ -976,6 +976,16 @@
         $self->{$key} = $self->{$mp_key};
     }
 
+    # 2.1 has apxs -q AP[RU]_CONFIG as the definitive location
+    my $apxs_key = uc($what) . "_CONFIG";
+    if (!$self->{$key} && !$self->httpd_is_source_tree) {
+        my $try = $self->apxs('-q' => $apxs_key);
+        
+        if (-x $try) {
+            $self->{$key} = $try;
+        }
+    }
+
     my $config = $self->apr_generation ? "$what-1-config" : "$what-config";
 
     if (!$self->{$key}) {
@@ -1717,6 +1727,13 @@
 
     unless ($self->httpd_is_source_tree) {
         push @inc, $self->apr_includedir;
+
+        my $apuc = $self->apu_config_path;
+        if ($apuc && -x $apuc) {
+            chomp(my $apuincs = qx($apuc --includes));
+            $apuincs =~ s|-I||;
+            push @inc, $apuincs;
+        }
 
         my $ainc = $self->apxs('-q' => 'INCLUDEDIR');
         if (-d $ainc) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> On Wed, Aug 25, 2004 at 09:31:27AM -0700, Stas Bekman wrote:
> 
>>Joe Orton wrote:
>>
>>>The thing I really want is to fix out-of-tree apr-util builds anyway,
>>>can someone commit that half of the patch if it's OK?
>>
>>What problem does it solve? Is this something needed for httpd 2.1?
> 
> 
> If fixes any installation of 2.0 or 2.1 where httpd has been built
> against separate installations of apr-util and apr, where apr-util has
> been installed with a different includedir to apr.
> 
> e.g. build apr with --prefix=/path/1, apr-util with --prefix=/path/2 and
> then httpd against both; the apr-util include path(s) are not picked up
> by mod_perl in that case.

that's better :) Will commit in a moment. thanks Joe.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Aug 25, 2004 at 09:31:27AM -0700, Stas Bekman wrote:
> Joe Orton wrote:
> >The thing I really want is to fix out-of-tree apr-util builds anyway,
> >can someone commit that half of the patch if it's OK?
> 
> What problem does it solve? Is this something needed for httpd 2.1?

If fixes any installation of 2.0 or 2.1 where httpd has been built
against separate installations of apr-util and apr, where apr-util has
been installed with a different includedir to apr.

e.g. build apr with --prefix=/path/1, apr-util with --prefix=/path/2 and
then httpd against both; the apr-util include path(s) are not picked up
by mod_perl in that case.

joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> On Tue, Aug 24, 2004 at 11:52:15PM -0700, Stas Bekman wrote:
> 
>>but Joe, don't let this discussion get on your way, commit the thing 
>>(after the 2.0 way) and we will optimise it later.
> 
> 
> But re-ordering the tests really defeats the point of the change (which
> was to *skip* all the messy 2.0 tests and get straight to the point
> using -q APR_CONFIG).  Let's forget about this change, it's just a
> cleanup anyway, the current code works OK.
> 
> The thing I really want is to fix out-of-tree apr-util builds anyway,
> can someone commit that half of the patch if it's OK?

What problem does it solve? Is this something needed for httpd 2.1?

> Index: Build.pm
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/lib/Apache/Build.pm,v
> retrieving revision 1.171
> diff -u -r1.171 Build.pm
> --- Build.pm	22 Aug 2004 17:57:40 -0000	1.171
> +++ Build.pm	25 Aug 2004 10:04:01 -0000
> @@ -1724,6 +1724,13 @@
>      unless ($self->httpd_is_source_tree) {
>          push @inc, $self->apr_includedir;
>  
> +        my $apuc = $self->apu_config_path;
> +        if ($apuc && -x $apuc) {
> +            chomp(my $apuincs = qx($apuc --includes));
> +            $apuincs =~ s|-I||;
> +            push @inc, $apuincs;
> +        }
> +
>          my $ainc = $self->apxs('-q' => 'INCLUDEDIR');
>          if (-d $ainc) {
>              push @inc, $ainc;
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
> For additional commands, e-mail: dev-help@perl.apache.org


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Joe Orton <jo...@redhat.com>.
On Tue, Aug 24, 2004 at 11:52:15PM -0700, Stas Bekman wrote:
> but Joe, don't let this discussion get on your way, commit the thing 
> (after the 2.0 way) and we will optimise it later.

But re-ordering the tests really defeats the point of the change (which
was to *skip* all the messy 2.0 tests and get straight to the point
using -q APR_CONFIG).  Let's forget about this change, it's just a
cleanup anyway, the current code works OK.

The thing I really want is to fix out-of-tree apr-util builds anyway,
can someone commit that half of the patch if it's OK?

Index: Build.pm
===================================================================
RCS file: /home/cvspublic/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.171
diff -u -r1.171 Build.pm
--- Build.pm	22 Aug 2004 17:57:40 -0000	1.171
+++ Build.pm	25 Aug 2004 10:04:01 -0000
@@ -1724,6 +1724,13 @@
     unless ($self->httpd_is_source_tree) {
         push @inc, $self->apr_includedir;
 
+        my $apuc = $self->apu_config_path;
+        if ($apuc && -x $apuc) {
+            chomp(my $apuincs = qx($apuc --includes));
+            $apuincs =~ s|-I||;
+            push @inc, $apuincs;
+        }
+
         my $ainc = $self->apxs('-q' => 'INCLUDEDIR');
         if (-d $ainc) {
             push @inc, $ainc;


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Stas Bekman <st...@stason.org>.
Philippe M. Chiasson wrote:
[...]
>> No, I suggested to figure out whether we are running under 2.0 or 2.1 
>> and then use the appropriate method, without trying both. e.g.:
>>
>>    if (httpd 2.0) {
>>       # the current way
>>    } else {
>>       #  2.1 has apxs -q AP[RU]_CONFIG as the definitive location
>>       my $apxs_key = uc($what) . "_CONFIG";
>>       ...
>>    }
>>
>> will that work?
>>
>> As a solution for too many shell calls (unrelated to your proposal, 
>> Joe) I think we should use a dbm file to cache all the values, so it 
>> can be reused across many Makefile.PL calls (or may be something else).
> 
> 
> Worth noting that you can call apxs -q for many values (they are ;; 
> separated)
> $>/usr/sbin/apxs -q EXTRA_CFLAGS EXTRA_CPPFLAGS MPM_NAME
> -pthread;;-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE;;prefork

True.

but Joe, don't let this discussion get on your way, commit the thing 
(after the 2.0 way) and we will optimise it later.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.

Stas Bekman wrote:
> Joe Orton wrote:
> 
>>On Wed, Aug 18, 2004 at 12:34:01PM -0700, Stas Bekman wrote:
>>
>>
>>>Joe Orton wrote:
>>>
>>>
>>>>On Wed, Aug 18, 2004 at 07:55:25PM +0100, Joe Orton wrote:
>>>>
>>>>
>>>>
>>>>>On Wed, Aug 18, 2004 at 10:54:13AM -0700, Stas Bekman wrote:
>>>>>
>>>>>
>>>>>
>>>>>>Joe Orton wrote:
>>>>>>Thanks Joe.
>>>>>>
>>>>>>Any chance this can be rewritten to find out what syntax to use (2.0 or 
>>>>>>2.1) once and not do that repeatedly? This function is the cause of the 
>>>>>>slow  configuration (too many shell calls), so trying to minimize it 
>>>>>>will be a great thing.
>>>>>
>>>>>Why "repeatedly"? Surely since the value is cached it's only done twice,
>>>>>once for apr-config and once for apu-config?
>>>
>>>No, I meant to have two branches: one for 2.0 and one for 2.1, so in case 
>>>a call to the 2.0 style apxs returns no value it won't try to call 2.1 
>>>style?
>>
>>
>>OK, just to be clear: you just want the order reversed: run through the
>>current logic, then try -q AP?_CONFIG if none of that worked?  Or are
>>you asking for all the current logic to be simplified too?
> 
> 
> No, I suggested to figure out whether we are running under 2.0 or 2.1 and 
> then use the appropriate method, without trying both. e.g.:
> 
>    if (httpd 2.0) {
>       # the current way
>    } else {
>       #  2.1 has apxs -q AP[RU]_CONFIG as the definitive location
>       my $apxs_key = uc($what) . "_CONFIG";
>       ...
>    }
> 
> will that work?
> 
> As a solution for too many shell calls (unrelated to your proposal, Joe) I 
> think we should use a dbm file to cache all the values, so it can be 
> reused across many Makefile.PL calls (or may be something else).

Worth noting that you can call apxs -q for many values (they are ;; separated)
$>/usr/sbin/apxs -q EXTRA_CFLAGS EXTRA_CPPFLAGS MPM_NAME
-pthread;;-DLINUX=2 -D_REENTRANT -D_GNU_SOURCE;;prefork


-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Re: [PATCH] 2.1 build foo

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> On Wed, Aug 18, 2004 at 12:34:01PM -0700, Stas Bekman wrote:
> 
>>Joe Orton wrote:
>>
>>>On Wed, Aug 18, 2004 at 07:55:25PM +0100, Joe Orton wrote:
>>>
>>>
>>>>On Wed, Aug 18, 2004 at 10:54:13AM -0700, Stas Bekman wrote:
>>>>
>>>>
>>>>>Joe Orton wrote:
>>>>>Thanks Joe.
>>>>>
>>>>>Any chance this can be rewritten to find out what syntax to use (2.0 or 
>>>>>2.1) once and not do that repeatedly? This function is the cause of the 
>>>>>slow  configuration (too many shell calls), so trying to minimize it 
>>>>>will be a great thing.
>>>>
>>>>Why "repeatedly"? Surely since the value is cached it's only done twice,
>>>>once for apr-config and once for apu-config?
>>
>>No, I meant to have two branches: one for 2.0 and one for 2.1, so in case 
>>a call to the 2.0 style apxs returns no value it won't try to call 2.1 
>>style?
> 
> 
> OK, just to be clear: you just want the order reversed: run through the
> current logic, then try -q AP?_CONFIG if none of that worked?  Or are
> you asking for all the current logic to be simplified too?

No, I suggested to figure out whether we are running under 2.0 or 2.1 and 
then use the appropriate method, without trying both. e.g.:

   if (httpd 2.0) {
      # the current way
   } else {
      #  2.1 has apxs -q AP[RU]_CONFIG as the definitive location
      my $apxs_key = uc($what) . "_CONFIG";
      ...
   }

will that work?

As a solution for too many shell calls (unrelated to your proposal, Joe) I 
think we should use a dbm file to cache all the values, so it can be 
reused across many Makefile.PL calls (or may be something else).

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Aug 18, 2004 at 12:34:01PM -0700, Stas Bekman wrote:
> Joe Orton wrote:
> >On Wed, Aug 18, 2004 at 07:55:25PM +0100, Joe Orton wrote:
> >
> >>On Wed, Aug 18, 2004 at 10:54:13AM -0700, Stas Bekman wrote:
> >>
> >>>Joe Orton wrote:
> >>>Thanks Joe.
> >>>
> >>>Any chance this can be rewritten to find out what syntax to use (2.0 or 
> >>>2.1) once and not do that repeatedly? This function is the cause of the 
> >>>slow  configuration (too many shell calls), so trying to minimize it 
> >>>will be a great thing.
> >>
> >>Why "repeatedly"? Surely since the value is cached it's only done twice,
> >>once for apr-config and once for apu-config?
> 
> No, I meant to have two branches: one for 2.0 and one for 2.1, so in case 
> a call to the 2.0 style apxs returns no value it won't try to call 2.1 
> style?

OK, just to be clear: you just want the order reversed: run through the
current logic, then try -q AP?_CONFIG if none of that worked?  Or are
you asking for all the current logic to be simplified too?

joe



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> On Wed, Aug 18, 2004 at 07:55:25PM +0100, Joe Orton wrote:
> 
>>On Wed, Aug 18, 2004 at 10:54:13AM -0700, Stas Bekman wrote:
>>
>>>Joe Orton wrote:
>>>Thanks Joe.
>>>
>>>Any chance this can be rewritten to find out what syntax to use (2.0 or 
>>>2.1) once and not do that repeatedly? This function is the cause of the 
>>>slow  configuration (too many shell calls), so trying to minimize it will 
>>>be a great thing.
>>
>>Why "repeatedly"? Surely since the value is cached it's only done twice,
>>once for apr-config and once for apu-config?

No, I meant to have two branches: one for 2.0 and one for 2.1, so in case 
a call to the 2.0 style apxs returns no value it won't try to call 2.1 style?

> Oh, well, I see what you mean if I add debugging in sub apxs.  How can I
> fix this if caching the values as $self->{...} doesn't already? 
> 
> Writing Makefile for Apache::SubProcess
> apxs called for -q APU_CONFIG
> apxs called for -q EXTRA_CFLAGS
> apxs called for -q EXTRA_CPPFLAGS
> apxs called for -q EXTRA_CPPFLAGS
> Writing Makefile for Apache::SubRequest
> apxs called for -q APU_CONFIG
> apxs called for -q EXTRA_CFLAGS
> apxs called for -q EXTRA_CPPFLAGS
> apxs called for -q EXTRA_CPPFLAGS
> Writing Makefile for Apache::URI

I think that's because a new build config object is instantiated by each 
Makefile.PL, that's something that I'd like to see fixed, since it can be 
better than that.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Aug 18, 2004 at 07:55:25PM +0100, Joe Orton wrote:
> On Wed, Aug 18, 2004 at 10:54:13AM -0700, Stas Bekman wrote:
> > Joe Orton wrote:
> > Thanks Joe.
> > 
> > Any chance this can be rewritten to find out what syntax to use (2.0 or 
> > 2.1) once and not do that repeatedly? This function is the cause of the 
> > slow  configuration (too many shell calls), so trying to minimize it will 
> > be a great thing.
> 
> Why "repeatedly"? Surely since the value is cached it's only done twice,
> once for apr-config and once for apu-config?

Oh, well, I see what you mean if I add debugging in sub apxs.  How can I
fix this if caching the values as $self->{...} doesn't already? 

Writing Makefile for Apache::SubProcess
apxs called for -q APU_CONFIG
apxs called for -q EXTRA_CFLAGS
apxs called for -q EXTRA_CPPFLAGS
apxs called for -q EXTRA_CPPFLAGS
Writing Makefile for Apache::SubRequest
apxs called for -q APU_CONFIG
apxs called for -q EXTRA_CFLAGS
apxs called for -q EXTRA_CPPFLAGS
apxs called for -q EXTRA_CPPFLAGS
Writing Makefile for Apache::URI
etc

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Aug 18, 2004 at 10:54:13AM -0700, Stas Bekman wrote:
> Joe Orton wrote:
> Thanks Joe.
> 
> Any chance this can be rewritten to find out what syntax to use (2.0 or 
> 2.1) once and not do that repeatedly? This function is the cause of the 
> slow  configuration (too many shell calls), so trying to minimize it will 
> be a great thing.

Why "repeatedly"? Surely since the value is cached it's only done twice,
once for apr-config and once for apu-config?

joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [PATCH] 2.1 build foo

Posted by Stas Bekman <st...@stason.org>.
Joe Orton wrote:
> This supports building against a separate apr-util (i.e. where the
> apr-util installed $includedir != apr $includedir), and also uses the
> output of `apxs -q APR_CONFIG` where available to pick up ap[ru]-config.
> 
> I haven't tested that this doesn't break the build against 2.0.x but it
> Should Be OK Really (TM).
> 
> Index: Build.pm
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/lib/Apache/Build.pm,v
> retrieving revision 1.170
> diff -u -r1.170 Build.pm
> --- Build.pm	15 Aug 2004 00:18:42 -0000	1.170
> +++ Build.pm	18 Aug 2004 12:48:12 -0000
> @@ -976,6 +976,16 @@
>          $self->{$key} = $self->{$mp_key};
>      }
>  
> +    # 2.1 has apxs -q AP[RU]_CONFIG as the definitive location
> +    my $apxs_key = uc($what) . "_CONFIG";
> +    if (!$self->{$key} && !$self->httpd_is_source_tree) {
> +        my $try = $self->apxs('-q' => $apxs_key);
> +        
> +        if (-x $try) {
> +            $self->{$key} = $try;
> +        }
> +    }

Thanks Joe.

Any chance this can be rewritten to find out what syntax to use (2.0 or 
2.1) once and not do that repeatedly? This function is the cause of the 
slow  configuration (too many shell calls), so trying to minimize it will 
be a great thing.


>      my $config = $self->apr_generation ? "$what-1-config" : "$what-config";
>  
>      if (!$self->{$key}) {
> @@ -1717,6 +1727,13 @@
>  
>      unless ($self->httpd_is_source_tree) {
>          push @inc, $self->apr_includedir;
> +
> +        my $apuc = $self->apu_config_path;
> +        if ($apuc && -x $apuc) {
> +            chomp(my $apuincs = qx($apuc --includes));
> +            $apuincs =~ s|-I||;
> +            push @inc, $apuincs;
> +        }
>  
>          my $ainc = $self->apxs('-q' => 'INCLUDEDIR');
>          if (-d $ainc) {


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org