perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <>
Subject Re: [mp2 Patch] Static build and mod_perl include files
Date Tue, 07 Dec 2004 22:15:22 GMT
Stas Bekman wrote:
> Philippe M. Chiasson wrote:
>>Stas just discovered that when building static, mod_perl's header files 
>>ended up
>>being installed in httpd's build tree. That had 2 bad effects. First, 
>>3rd party
>>modules wouldn't find the headers. Second, thus polluted, the httpd 
>>source tree
>>wouldn't build anymore, confused by header files that shouldn't be there.
>>The following patch _fixes_ that problem, but the only way I could 
>>manage to do
>>it was by peeking at It did make me think about how we 
>>could make
>>use of ourselves more directly and not rely on 
>>system(apxs) as much
>>in the future.
>>Anyways, here is the patch itself.
> thanks philippe, please see comments below:
>>Index: Makefile.PL
>>--- Makefile.PL	(revision 111148)
>>+++ Makefile.PL	(working copy)
>>@@ -66,6 +66,8 @@
>> my @exe_files =  map "bin/$_", qw(mp2doc mp2bug);
>>+my $include_dir = $build->ap_exp_includedir() || $build->ap_includedir();
> why do we need expose that on the top level and complicate things? why not 
> have ap_includedir() call that internally?

That was my original intent, but the problem is that there are really 2 values
for includedir, one is where to get include files from for -I and the other one
is for where we need to install our header files. In the case of the dynamic build,
these 2 places are one and the same.

In the case of the static build, the headers we need to compile are in httpd's
source tree while the location we need to install our own headers in elsewhere.

My initial attempt was to change ap_includedir() but that quite rightly broke
everything. That's why they need to be kept separate.

>> [...]
>>+    my $build_vars = File::Spec->catfile($self->{MP_AP_PREFIX}, 
>>+                                         'build', '');
>>+    open my $vars, "<$build_vars" || die "Couldn't open $build_vars $!";
> must be 'or' and not '||', with || it's the same as:
>   open my $vars, "<$build_vars";
> because of the higher precendence of ||.

I knew that ;-) Thanks for the spot!

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

View raw message