components/apache2-modules/mod_perl/patches/TestConfigParse.patch
author Petr Sumbera <petr.sumbera@oracle.com>
Tue, 11 Aug 2015 02:10:37 -0700
changeset 4788 159f02dfcdd3
parent 3563 a34ad418afb9
permissions -rw-r--r--
21613799 mod_perl upgrade to version 2.0.9 + provide Apache 2.4 module

Patch origin: in-house
Patch status: Solaris-specific; not suitable for upstream

For Apache 2.2 distinguishes 32bit and 64bit modules.
For Apache 2.4 removes all MPMs modules except event MPM.

--- Apache-Test/lib/Apache/TestConfigParse.pm
+++ Apache-Test/lib/Apache/TestConfigParse.pm
@@ -20,6 +20,7 @@
 
 use strict;
 use warnings FATAL => 'all';
+use Cwd;
 
 use Apache::TestTrace;
 
@@ -185,7 +186,7 @@
 # - mod_fcgid causes https://rt.cpan.org/Public/Bug/Display.html?id=54476
 # - mod_modnss.c and mod_rev.c require further configuration
 my @autoconfig_skip_module = qw(mod_jk.c mod_casp2.c mod_bwshare.c
-    mod_fcgid.c mod_evasive20.c mod_modnss.c mod_rev.c);
+    mod_fcgid.c mod_evasive20.c mod_modnss.c mod_rev.c mod_mpm_prefork.c mod_mpm_worker.c);
 
 # add modules to be not inherited from the existing config.
 # e.g. prevent from LoadModule perl_module to be included twice, when
@@ -212,10 +213,26 @@
 #inherit LoadModule
 sub inherit_load_module {
     my($self, $c, $directive) = @_;
+    my $httpd64bit = 0;
+    my $cwd = getcwd();
+    if (index($cwd, "amd64") != -1 or index($cwd, "sparcv9") != -1) {
+        $httpd64bit = 1;
+    }
 
     for my $args (@{ $c->{$directive} }) {
         my $modname = $args->[0];
         my $file = $self->server_file_rel2abs($args->[1]);
+        if ($httpd64bit == 0) {
+            unless ($file !~ m/\/64\//) {
+                debug "$file is 64 bit module (we don't want it)";
+                next;
+            }
+        } else {
+            unless ($file =~ m/\/64\// || $file =~ m/\/2\.4\//) {
+                debug "$file is 32 bit module (we don't want it)";
+                next;
+            }
+        }
 
         unless (-e $file) {
             debug "$file does not exist, skipping LoadModule";