Author: gozer
Date: Tue Dec  7 16:23:21 2004
New Revision: 111178

URL: http://svn.apache.org/viewcvs?view=rev&rev=111178
Log:
For static builds, mod_perl header files were being installed
into apache's source tree instead of where apache installed it's
own headers


Modified:
   perl/modperl/trunk/Changes
   perl/modperl/trunk/Makefile.PL
   perl/modperl/trunk/lib/Apache/Build.pm

Modified: perl/modperl/trunk/Changes
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?view=diff&rev=111178&p1=perl/modperl/trunk/Changes&r1=111177&p2=perl/modperl/trunk/Changes&r2=111178
==============================================================================
--- perl/modperl/trunk/Changes  (original)
+++ perl/modperl/trunk/Changes  Tue Dec  7 16:23:21 2004
@@ -12,6 +12,10 @@
 
 =item 1.99_18-dev
 
+For static builds, mod_perl header files were being installed
+into apache's source tree instead of where apache installed it's
+own headers [Gozer]
+
 modperl_threads_started() wasn't working under static worker build,
 due to MP_threads_started static variable not being reset on
 restart. Now resetting it. [Stas]

Modified: perl/modperl/trunk/Makefile.PL
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/Makefile.PL?view=diff&rev=111178&p1=perl/modperl/trunk/Makefile.PL&r1=111177&p2=perl/modperl/trunk/Makefile.PL&r2=111178
==============================================================================
--- perl/modperl/trunk/Makefile.PL      (original)
+++ perl/modperl/trunk/Makefile.PL      Tue Dec  7 16:23:21 2004
@@ -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     => {

Modified: perl/modperl/trunk/lib/Apache/Build.pm
Url: 
http://svn.apache.org/viewcvs/perl/modperl/trunk/lib/Apache/Build.pm?view=diff&rev=111178&p1=perl/modperl/trunk/lib/Apache/Build.pm&r1=111177&p2=perl/modperl/trunk/lib/Apache/Build.pm&r2=111178
==============================================================================
--- perl/modperl/trunk/lib/Apache/Build.pm      (original)
+++ perl/modperl/trunk/lib/Apache/Build.pm      Tue Dec  7 16:23:21 2004
@@ -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}, 
+                                         qw(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*(.*)/) {
+            $ap_exp_includedir = $1;
+            last;
+        }
+    }
+    
+    $self->{ap_exp_includedir} = $ap_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,11 +1635,12 @@
     }
 
     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)) {
-        print $fh $self->canon_make_attr("AP_$q",
-                                         $self->apxs(-q => $q));
-    }
+    print $fh $self->canon_make_attr('AP_LIBEXECDIR',
+                                     $self->apxs(-q => 'LIBEXECDIR'));
 
     my $xs_targ = $self->make_xs($fh);
 

Reply via email to