perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkal...@apache.org
Subject svn commit: r1590627 - in /perl/modperl/branches/httpd24threading: Makefile.PL lib/ModPerl/BuildOptions.pm
Date Mon, 28 Apr 2014 13:17:54 GMT
Author: jkaluza
Date: Mon Apr 28 13:17:53 2014
New Revision: 1590627

URL: http://svn.apache.org/r1590627
Log:
Require threaded Perl when compilling with httpd >= 2.4.0. Remove unused option
MP_NONTHREADED_OK and replace it with MP_NO_THREADS.

This is follow up of r1151822.

Modified:
    perl/modperl/branches/httpd24threading/Makefile.PL
    perl/modperl/branches/httpd24threading/lib/ModPerl/BuildOptions.pm

Modified: perl/modperl/branches/httpd24threading/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/modperl/branches/httpd24threading/Makefile.PL?rev=1590627&r1=1590626&r2=1590627&view=diff
==============================================================================
--- perl/modperl/branches/httpd24threading/Makefile.PL (original)
+++ perl/modperl/branches/httpd24threading/Makefile.PL Mon Apr 28 13:17:53 2014
@@ -509,19 +509,44 @@ sub perl_version_check {
     $perl_version =~ s/5.00(\d)(?:00(\d))?/"5.$1." . ($2||0)/e;
     my $perl_threads = Apache2::Build::PERL_HAS_ITHREADS ? "w/" : "w/o";
     my $perl_string = "Using Perl $perl_version $perl_threads ithreads";
-    my $mpm = $build->mpm_name();
+    my $httpd_version = $build->httpd_version;
+    my $mpm = "";
+    my $build_threaded = 0;
+
+    # For httpd-2.4, we can't use mpm_is_threaded(), because MPMs are loadable
+    # modules. We therefore treat httpd as a whole project as threaded. It is
+    # still possible to disable threading by using MP_NO_THREADS=1
+    if ($httpd_version lt MIN_HTTPD_24_VERSION) {
+        $build_threaded = $build->mpm_is_threaded();
+        $mpm = $build->mpm_name();
+    }
+    else {
+        if ($build->{MP_NO_THREADS}) {
+            $build_threaded = 0;
+        }
+        else {
+            $build_threaded = 1;
+        }
+    }
 
     # certain mpms require perl 5.8.0+ w/ithreads
-    if ($build->mpm_is_threaded()) {
+    if ($build_threaded) {
         my @fail;
         push @fail, "Perl 5.8 or higher"
             unless $] >= 5.008;
         push @fail, "Perl built with ithreads (build perl with -Duseithreads)"
             unless Apache2::Build::PERL_HAS_ITHREADS();
         if (@fail) {
-            error "$perl_string and '$mpm' mpm httpd.",
-                "Failed requirements:",
-                join "", map {"  - $_\n"} @fail;
+            if ($httpd_version lt MIN_HTTPD_24_VERSION) {
+                error "$perl_string and '$mpm' mpm httpd.",
+                    "Failed requirements:",
+                    join "", map {"  - $_\n"} @fail;
+            }
+            else {
+                error "$perl_string and httpd-2.4.",
+                    "Failed requirements:",
+                    join "", map {"  - $_\n"} @fail;
+            }
             exit 1;
         }
     }
@@ -531,8 +556,14 @@ sub perl_version_check {
         if ($build->should_build_apache && !Apache2::Build::PERL_HAS_ITHREADS)
{
             # before 5.8.2, perl_shutdown is incomplete
             if ($] < 5.008_002) {
-                error "static $mpm mpm requires a threaded ".
-                      "perl 5.6.1-5.8.1 or any perl 5.8.2+";
+                if ($httpd_version lt MIN_HTTPD_24_VERSION) {
+                    error "static $mpm mpm requires a threaded ".
+                        "perl 5.6.1-5.8.1 or any perl 5.8.2+";
+                }
+                else {
+                    error "httpd-2.4 requires a threaded ".
+                        "perl 5.6.1-5.8.1 or any perl 5.8.2+";
+                }
                 exit 1;
             }
         }
@@ -553,7 +584,7 @@ sub perl_version_check {
     if ($Config{usemultiplicity} xor $Config{useithreads}) {
         error "mod_perl does not currently support multiplicity without ".
 	      "ithreads.";
-        if ($build->mpm_is_threaded()) {
+        if ($build_threaded) {
 	    error "Please recompile Perl with -Duseithreads and ".
 	          "-Dusemultiplicity";
         } else {

Modified: perl/modperl/branches/httpd24threading/lib/ModPerl/BuildOptions.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/httpd24threading/lib/ModPerl/BuildOptions.pm?rev=1590627&r1=1590626&r2=1590627&view=diff
==============================================================================
--- perl/modperl/branches/httpd24threading/lib/ModPerl/BuildOptions.pm (original)
+++ perl/modperl/branches/httpd24threading/lib/ModPerl/BuildOptions.pm Mon Apr 28 13:17:53
2014
@@ -265,4 +265,4 @@ GENERATE_XS    0    Generate XS code bas
 LIBNAME        0    Name of the modperl dso library (default is  mod_perl)
 COMPAT_1X      0    Compile-time mod_perl 1.0 backcompat (default is  on)
 APR_LIB        0    Lib used to build APR::* on Win32 (default is aprext)
-NONTHREADED_OK 0    Using a non-threaded perl is okay with httpd >=2.3
+NO_THREADS     0    Build mod_perl without thread support with httpd >= 2.4



Mime
View raw message