Return-Path: Delivered-To: apmail-perl-dev-archive@www.apache.org Received: (qmail 47995 invoked from network); 7 Dec 2004 22:48:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Dec 2004 22:48:13 -0000 Received: (qmail 6885 invoked by uid 500); 7 Dec 2004 22:47:19 -0000 Delivered-To: apmail-perl-dev-archive@perl.apache.org Received: (qmail 6663 invoked by uid 500); 7 Dec 2004 22:47:15 -0000 Mailing-List: contact dev-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@perl.apache.org Received: (qmail 6581 invoked by uid 99); 7 Dec 2004 22:47:15 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of gozer@ectoplasm.org designates 66.34.202.202 as permitted sender) Received: from Unknown (HELO minerva.ectoplasm.org) (66.34.202.202) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 07 Dec 2004 14:47:08 -0800 Received: from [172.28.57.123] (office4.tmcs.net [209.104.55.5]) by minerva.ectoplasm.org (Postfix) with ESMTP id 886E05EB1C; Tue, 7 Dec 2004 14:47:05 -0800 (PST) Message-ID: <41B633A4.70605@ectoplasm.org> Date: Tue, 07 Dec 2004 14:50:12 -0800 From: "Philippe M. Chiasson" User-Agent: Mozilla Thunderbird 0.9 (X11/20041127) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stas Bekman Cc: dev@perl.apache.org Subject: Re: [mp2 Patch] Static build and mod_perl include files References: <41B626C5.20809@ectoplasm.org> <41B62815.8030602@stason.org> <41B62B7A.90504@ectoplasm.org> <41B62BB5.7060000@stason.org> In-Reply-To: <41B62BB5.7060000@stason.org> X-Enigmail-Version: 0.89.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig769A7A33804C6DBDEFC44C92" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --------------enig769A7A33804C6DBDEFC44C92 Content-Type: multipart/mixed; boundary="------------000400040908060301050208" This is a multi-part message in MIME format. --------------000400040908060301050208 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Stas Bekman wrote: > Philippe M. Chiasson wrote: > >>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 config_vars.mk. It did make me think about how >>>>we could make >>>>use of config_vars.mk ourselves more directly and not rely on >>>>system(apxs) as much >>>>in the future. >>>> >>>>Anyways, here is the patch itself. >>> >>> [...] > > OK, how about then writing a wrapper for install_headers_dir() which will > do the right thing internally. Exposing this logic/complexity at the > Makefile.PL level doesn't sound as a very good idea. You are right, would be much cleaner to do so. Patch attached ! -------------------------------------------------------------------------------- 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 --------------000400040908060301050208 Content-Type: text/x-patch; name="static_headers.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="static_headers.patch" Index: Makefile.PL =================================================================== --- Makefile.PL (revision 111157) +++ Makefile.PL (working copy) @@ -78,7 +78,7 @@ MODPERL_MAKEFILE => basename($build->default_file('makefile')), PERL => $build->perl_config('perlpath'), MOD_INSTALL => ModPerl::BuildMM::mod_install(), - MODPERL_AP_INCLUDEDIR => $build->ap_includedir(), + MODPERL_AP_INCLUDEDIR => $build->->install_headers_dir(), MODPERL_XS_H_FILES => join(" \\\n\t", @xs_h_files), }, clean => { Index: lib/Apache/Build.pm =================================================================== --- lib/Apache/Build.pm (revision 111157) +++ lib/Apache/Build.pm (working copy) @@ -946,6 +946,36 @@ $self->{ap_includedir} = $d; } +sub ap_exp_includedir { + my ($self) = @_; + + return $self->{ap_exp_includedir} if $self->{ap_exp_includedir}; + + my $build_vars = File::Spec->catfile($self->{MP_AP_PREFIX}, + 'build', 'config_vars.mk'); + open my $vars, "<$build_vars" or die "Couldn't open $build_vars $!"; + my $ap_exp_includedir; + while (<$vars>) { + if (/exp_includedir\s*=\s*(.*)/) { + $exp_includedir = $1; + last; + } + } + + $self->{ap_exp_includedir} = $exp_includedir; +} + +sub install_headers_dir { + my ($self) = @_; + if ($self->should_build_apache) { + return $self->ap_exp_includedir(); + } + else { + return $self->ap_includedir(); + } +} + + # where apr-config and apu-config reside sub apr_bindir { my ($self) = @_; @@ -1605,8 +1635,11 @@ } print $fh $self->canon_make_attr('lib', "@libs"); + + print $fh $self->canon_make_attr('AP_INCLUDEDIR', + $self->install_headers_dir()); - for my $q (qw(LIBEXECDIR INCLUDEDIR)) { + for my $q (qw(LIBEXECDIR)) { print $fh $self->canon_make_attr("AP_$q", $self->apxs(-q => $q)); } --------------000400040908060301050208-- --------------enig769A7A33804C6DBDEFC44C92 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBtjOkyzKhB4jDpaURAoS4AKCjOJvOl9LxSg8UtkSGZ9v0+fD9lgCffwYk ukDfjkWXL01Jp0P/vgnmYPg= =u3OB -----END PGP SIGNATURE----- --------------enig769A7A33804C6DBDEFC44C92--