joes 2003/10/29 20:45:52
Modified: build xsbuilder.pl
Log:
Improve the perl glue's environment check by following the recipe in CGI.pm
Revision Changes Path
1.18 +14 -2 httpd-apreq-2/build/xsbuilder.pl
Index: xsbuilder.pl
===================================================================
RCS file: /home/cvs/httpd-apreq-2/build/xsbuilder.pl,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- xsbuilder.pl 30 Oct 2003 01:22:00 -0000 1.17
+++ xsbuilder.pl 30 Oct 2003 04:45:52 -0000 1.18
@@ -237,8 +237,20 @@
# The modperl package isn't necessarily loaded, but Apache2
# is. Perhaps Apache2 should always include a VERSION?
-die __PACKAGE__ . ": httpd must load mod_apreq.so first"
- if __PACKAGE__->env ne "Apache::RequestRec";
+if (\$ENV{MOD_PERL}) {
+ require mod_perl;
+ if (\$mod_perl::VERSION > 1.99) {
+ die __PACKAGE__ . ": httpd must load mod_apreq.so first"
+ if __PACKAGE__->env ne "Apache::RequestRec";
+ }
+ elsif (\$mod_perl::VERSION > 1.24) {
+ die __PACKAGE__ . ": httpd must load mod_apreq1.so first"
+ if __PACKAGE__->env ne "Apache";
+ }
+ else {
+ die "Unrecognized mod_perl version number: \$modperl::VERSION";
+ }
+}
$code