stas 2003/06/12 16:42:23
Modified: . Makefile.PL Changes
lib/Apache Build.pm
Removed: lib Apache2.pm
Log:
Apache2.pm is now autogenerated and will adjust @INC to include
Apache2/ subdirs only if built with MP_INST_APACHE2=1
Revision Changes Path
1.105 +2 -0 modperl-2.0/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -r1.104 -r1.105
--- Makefile.PL 23 Apr 2003 04:46:07 -0000 1.104
+++ Makefile.PL 12 Jun 2003 23:42:23 -0000 1.105
@@ -111,6 +111,8 @@
}
}
+ $build->generate_apache2_pm;
+
if (WIN32()) {
#Makefile.PL's in WrapXS/ just need to pass the -e mod_perl.lib test
#the real mod_perl.lib will be in place when WrapXS/ dll's are
1.195 +3 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -r1.194 -r1.195
--- Changes 12 Jun 2003 23:27:03 -0000 1.194
+++ Changes 12 Jun 2003 23:42:23 -0000 1.195
@@ -12,6 +12,9 @@
=item 1.99_10-dev
+Apache2.pm is now autogenerated and will adjust @INC to include
+Apache2/ subdirs only if built with MP_INST_APACHE2=1 [Stas]
+
Change the default value for the argument 'readbytes' for
ap_get_brigade(), from 0 to 8192. other than being useless, 0 always
triggers an assert in httpd internal filters and 8192 is a good
1.127 +31 -0 modperl-2.0/lib/Apache/Build.pm
Index: Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -r1.126 -r1.127
--- Build.pm 10 Jun 2003 03:12:52 -0000 1.126
+++ Build.pm 12 Jun 2003 23:42:23 -0000 1.127
@@ -1367,6 +1367,37 @@
return "";
}
+# in case MP_INST_APACHE2=0 we shouldn't try to adjust @INC
+# because it may pick older Apache2 from the previous install
+sub generate_apache2_pm {
+ my $self = shift;
+
+ my $fixup = !$self->{MP_INST_APACHE2}
+ ? '# MP_INST_APACHE2=0, do nothing'
+ : <<'EOF';
+BEGIN {
+ my @dirs = ();
+
+ for my $path (@INC) {
+ my $dir = "$path/Apache2";
+ next unless -d $dir;
+ push @dirs, $dir;
+ }
+
+ if (@dirs) {
+ unshift @INC, @dirs;
+ }
+}
+EOF
+
+ my $content = join "\n\n", 'package Apache2;', $fixup, "1;";
+ my $file = catfile qw(lib Apache2.pm);
+ open my $fh, '>', $file or die "Can't open $file: $!";
+ print $fh $content;
+ close $fh;
+
+}
+
1;
__END__