Author: stevehay Date: Fri Jul 21 09:22:51 2023 New Revision: 1911164 URL: http://svn.apache.org/viewvc?rev=1911164&view=rev Log: Update Makefile.PL as per r1911161
Modified: perl/Apache-SizeLimit/trunk/Makefile.PL Modified: perl/Apache-SizeLimit/trunk/Makefile.PL URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/Makefile.PL?rev=1911164&r1=1911163&r2=1911164&view=diff ============================================================================== --- perl/Apache-SizeLimit/trunk/Makefile.PL (original) +++ perl/Apache-SizeLimit/trunk/Makefile.PL Fri Jul 21 09:22:51 2023 @@ -111,13 +111,14 @@ sub satisfy_mp_generation { unless ($wanted == 1 || $wanted == 2) { die "don't know anything about mod_perl generation: $wanted\n" . - "currently supporting only generations 1 and 2"; + "currently supporting only generations 1 and 2.\n" . + "Please specify MOD_PERL=1 or MOD_PERL=2 on the commandline\n"; } my $selected = 0; if ($wanted == 1) { - require_mod_perl(); + require_mod_perl(1); if ($mod_perl::VERSION >= 1.99) { # so we don't pick 2.0 version if 1.0 is wanted die "You don't seem to have mod_perl 1.0 installed"; @@ -126,7 +127,7 @@ sub satisfy_mp_generation { } elsif ($wanted == 2) { #warn "Looking for mod_perl 2.0"; - require_mod_perl(); + require_mod_perl(2); if ($mod_perl::VERSION < 2.0) { die "You don't seem to have mod_perl 2.0 installed"; } @@ -142,9 +143,25 @@ sub satisfy_mp_generation { } sub require_mod_perl { - - eval { require mod_perl }; - eval { require mod_perl2 } if ($@); + my($rversion) = @_; + if (!$rversion || $rversion==1){ + eval { require mod_perl }; + if ($rversion == 1){ + if ($@){ + warn "Note: Did not find mod_perl installed\n"; + } + return; # do not die, let PREREQ_PM handle it + } + } + if ($@ || !$rversion || $rversion==2){ + eval { require mod_perl2 }; + if ($rversion == 2){ + if ($@){ + warn "Note: Did not find mod_perl2 installed\n"; + } + return; # do not die, let PREREQ_PM handle it + } + } die "Can't find mod_perl installed\nThe error was: $@" if $@; }