Permalink
Browse files

merge apache2-rename-unstable to trunk

git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@159508 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 548cb9d commit 964dc7936059d024e12ca59c9a68df57980eca36 Geoffrey Young committed Mar 30, 2005
Showing 354 changed files with 2,634 additions and 2,792 deletions.
View
20 Changes
@@ -12,6 +12,26 @@ Also refer to the Apache::Test changes log file, at Apache-Test/Changes
=item 1.999_22-dev
+ ******************** IMPORTANT ********************
+ this version of mod_perl is completely incompatible
+ with prior versions of mod_perl, both 1.XX and
+ 1.99_XX. Please read the below changes carefully.
+ ***************************************************
+
+s/Apache::/Apache2::/g and s/mod_perl/mod_perl2/g in all module
+APIs [joes].
+
+remove MP_INST_APACHE2 installation option and Apache2.pm - all
+mod_perl related files will now be installed so they are visible
+via standard @INC. also, refuse to install over mod_perl 2 versions
+less than 1.999_22. [Geoffrey Young]
+
+add $ENV{MOD_PERL_API_VERSION} as something that clearly distinguishes
+which mod_perl version is being used at request time. [Geoffrey Young]
+
+remove CGI.pm and Apache::Request dependencies from Apache2::Status
+since they weren't used at all [Geoffrey Young]
+
Fixes for Apache::Reload's touchfile feature (return Apache::OK
instead of 1) [Chris Warren <chwarren@cisco.com>]
View
@@ -9,16 +9,17 @@ $ENV{MOD_PERL_2_BUILD} = 1;
use constant MIN_HTTPD_VERSION_DYNAMIC => '2.0.47';
use constant MIN_HTTPD_VERSION_STATIC => '2.0.51';
-my($old_modperl_version, $old_modperl_pm);
+my($old_modperl_version, $old_modperl_pm, $apache2_pm);
BEGIN {
eval {
+ require Apache2;
+ $apache2_pm = 1;
require mod_perl;
- if ($mod_perl::VERSION < 1.99) {
+ if ($mod_perl::VERSION < 1.999_22) {
$old_modperl_version = $mod_perl::VERSION;
+ $old_modperl_pm = delete $INC{'mod_perl.pm'};
}
- $old_modperl_pm = delete $INC{'mod_perl.pm'};
- %mod_perl:: = ();
};
}
@@ -32,20 +33,20 @@ use File::Copy 'cp';
use File::Basename 'basename';
use File::Find ();
-use Apache::Build ();
+use Apache2::Build ();
use Apache::TestSmokePerl ();
use Apache::TestTrace;
use ModPerl::TestReport ();
use ModPerl::TestRun ();
use ModPerl::Code ();
use ModPerl::BuildMM ();
-use constant WIN32 => Apache::Build::WIN32;
-use constant BUILD_APREXT => Apache::Build::BUILD_APREXT;
+use constant WIN32 => Apache2::Build::WIN32;
+use constant BUILD_APREXT => Apache2::Build::BUILD_APREXT;
our $VERSION;
-my $build = Apache::Build->new(init => 1);
+my $build = Apache2::Build->new(init => 1);
my $code = ModPerl::Code->new;
win32_fetch_apxs() if WIN32;
@@ -55,22 +56,20 @@ perl_version_check($build);
local %ModPerl::BuildMM::PM = (
'lib/typemap' => 'blib/lib/Apache2/typemap',
- 'lib/Apache2.pm' => 'blib/lib/Apache2.pm',
);
# these h files need to be installed system-wide so 3rd party XS
# extensions can use them
my @xs_h_files = map catfile("xs", $_),
qw(modperl_xs_sv_convert.h modperl_xs_typedefs.h modperl_xs_util.h
APR/PerlIO/modperl_apr_perlio.h);
-
-my @exe_files = map "bin/$_", qw(mp2doc mp2bug);
+my @exe_files = map "bin/$_", qw(mp2bug);
ModPerl::BuildMM::WriteMakefile(
- NAME => 'mod_perl',
+ NAME => 'mod_perl2',
VERSION => '2.0.0-RC5',
NO_META => 1,
- ABSTRACT_FROM => 'lib/mod_perl.pm',
+ ABSTRACT_FROM => 'lib/mod_perl2.pm',
EXE_FILES => \@exe_files,
DEFINE => get_DEFINE(),
macro => {
@@ -126,55 +125,44 @@ sub configure {
set_modperl_version();
if ($old_modperl_version) {
- $old_modperl_version =~ s/(\d\d)(\d\d)/$1_$2/;
+ $old_modperl_version =~ s/(\d\d\d?)(\d\d)/$1_$2/;
my $vstring = "mod_perl/$old_modperl_version";
print "$vstring installation detected...";
- if ($build->{MP_INST_APACHE2}) {
- print "ok (installing relative to Apache2/)\n";
+ my $prefix;
+ /^PREFIX=(.*)/ && $1 && ($prefix = canonpath glob($1)) for @ARGV;
+
+ # check that it's a full path
+ my $path = canonpath $old_modperl_pm;
+ # XXX: doesn't handle relative paths yet
+ # if PREFIX=/foo/bar is used, and it's not the same as the
+ # path where mod_perl < 1.999_22 is installed
+ if ($prefix && $path !~ /^$prefix/) {
+ print "ok (will install mod_perl/$VERSION into PREFIX=$prefix, " .
+ "no collision)\n";
}
else {
- my $prefix;
- /^PREFIX=(.*)/ && $1 && ($prefix = canonpath glob($1)) for @ARGV;
-
- # check that it's a full path
- my $mp1_path = canonpath $old_modperl_version;
- # XXX: doesn't handle relative paths yet
- # if PREFIX=/foo/bar is used, and it's not the same as the
- # path where mod_perl 1 is installed, we don't need to require
- # MP_INST_APACHE2
- if ($prefix && $mp1_path !~ /^$prefix/) {
- print "ok (will install mod_perl 2 into PREFIX=$prefix, " .
- "no collision)\n";
- }
- else {
- print " not ok\n\n";
- error <<EOI;
-Cannot install mod_perl/$VERSION on top of $vstring.
-Add the MP_INST_APACHE2=1 option or answer 'yes'
-to the next question
-EOI
- my $prompt = "Is it OK to install relative to Apache2/?";
- if ($build->prompt_y($prompt)) {
- $build->{MP_INST_APACHE2} = 1;
- }
- else {
- error <<EOI;
+ print " not ok\n\n";
+ print <<EOI;
+Cannot install mod_perl/$VERSION on top of $vstring
+due to a major API change between mod_perl 1.999_21 and 1.999_22.
+Please nuke the prior mod_perl installation from your site_lib,
+use a different perl to run the installation process, or use the
+PREFIX option when creating your Makefile. see
-The answer is 'No' => aborting...
+ http://perl.apache.org/somelinkwellwritelater
-To build mod_perl 2 either add MP_INST_APACHE2=1 Makefile.PL option
-or first remove mod_perl $old_modperl_version files, including
-$old_modperl_pm
+for more details.
+aborting...
EOI
exit 1;
- }
- }
}
}
+ else {
+ print "no prior mod_perl version found - good.\n";
- $build->generate_apache2_pm;
+ }
# On Win32, in order to decouple APR::* from mod_perl.so, we
# make up a static library MP_APR_LIB of the symbols required from
@@ -283,7 +271,7 @@ EOI
exit(1);
}
- printf "Configuring Apache/%s mod_perl/%s Perl/v%vd\n",
+ printf "Configuring Apache/%s mod_perl2/%s Perl/v%vd\n",
$httpd_version, $VERSION, $^V;
my $apr_config = $build->get_apr_config; #cache it
@@ -302,7 +290,7 @@ EOI
debug "unlink...$_" if -e $_ && unlink;
}
- #ModPerl::BuildMM will use Apache::BuildConfig in subdir/Makefile.PL's
+ #ModPerl::BuildMM will use Apache2::BuildConfig in subdir/Makefile.PL's
$build->save;
ModPerl::TestRun->generate_script;
@@ -368,7 +356,7 @@ EOI
sub post_configure {
#now have any data subdir/Makefile.PL's save, e.g. XS
- $build = Apache::Build->build_config;
+ $build = Apache2::Build->build_config;
$build->write_src_makefile;
$build->save_ldopts;
@@ -386,13 +374,6 @@ sub post_configure {
" LoadModule perl_module modules/$build->{MODPERL_LIB_DSO}\n";
}
- if ($build->{MP_INST_APACHE2}) {
- warning "Apache Perl modules will be installed relative to Apache2/";
- warning "Don't forget to:",
- "- configure 'PerlModule Apache2' in httpd.conf",
- "- or 'use Apache2 ();' in a startup script";
- }
-
$build->save;
}
@@ -465,9 +446,9 @@ sub clean_files {
}
sub set_modperl_version {
- require './lib/mod_perl.pm';
+ require './lib/mod_perl2.pm';
- $VERSION = $mod_perl::VERSION_TRIPLET;
+ $VERSION = $mod_perl2::VERSION_TRIPLET;
open my $fh, 'Changes';
while (<$fh>) {
@@ -480,7 +461,7 @@ sub set_modperl_version {
close $fh;
$build->{VERSION} = $VERSION;
- $build->{API_VERSION} = $mod_perl::API_VERSION;
+ $build->{API_VERSION} = $mod_perl2::API_VERSION;
}
# needs to be run after configure() when apxs is setup
@@ -489,7 +470,7 @@ sub perl_version_check {
my $perl_version = $];
$perl_version =~ s/5.00(\d)(?:00(\d))?/"5.$1." . ($2||0)/e;
- my $perl_threads = Apache::Build::PERL_HAS_ITHREADS ? "w/" : "w/o";
+ 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();
@@ -499,7 +480,7 @@ sub perl_version_check {
push @fail, "Perl 5.8 or higher"
unless $] >= 5.008;
push @fail, "Perl built with ithreads (build perl with -Dusethreads)"
- unless Apache::Build::PERL_HAS_ITHREADS();
+ unless Apache2::Build::PERL_HAS_ITHREADS();
if (@fail) {
error "$perl_string and '$mpm' mpm httpd.",
"Failed requirements:",
@@ -510,7 +491,7 @@ sub perl_version_check {
else {
# before 5.8.2, perl_shutdown is incomplete (in the case of ithreads
# each PerlInterpreter * gets tossed so it works)
- if ($build->should_build_apache && !Apache::Build::PERL_HAS_ITHREADS) {
+ 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 ".
@@ -605,7 +586,7 @@ package MY;
use Config;
use constant WIN32 => $^O eq 'MSWin32';
-use constant BUILD_APREXT => Apache::Build::BUILD_APREXT;
+use constant BUILD_APREXT => Apache2::Build::BUILD_APREXT;
my $apache_test_install;
BEGIN {
@@ -7,7 +7,7 @@ use lib grep { -d } map "$FindBin::Bin/../$_", qw(lib Apache-Test/lib);
use ModPerl::BuildMM ();
use Apache::TestSmokePerl ();
-use Apache::Build ();
+use Apache2::Build ();
# enable 'make test|clean'
use Apache::TestMM qw(test clean);
@@ -22,7 +22,7 @@ my @scripts = qw(t/TEST t/SMOKE);
# accept the configs from comman line
Apache::TestMM::filter_args();
-my $build = Apache::Build->build_config;
+my $build = Apache2::Build->build_config;
if ($build->should_build_apache) {
push @Apache::TestMM::Argv, ('httpd' => $build->{httpd});
}
View
@@ -1 +1 @@
-to be written
+to be written
Oops, something went wrong.

0 comments on commit 964dc79

Please sign in to comment.