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
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));
}
signature.asc
Description: OpenPGP digital signature
