gozer 2004/07/23 16:24:56
Modified: . Changes Makefile.PL README RELEASE src/docs/2.0/user/install install.pod lib/Apache Build.pm lib/ModPerl BuildOptions.pm t/response/TestAPI module.pm todo release Log: Static builds for httpd >= 2.0.51 available. With the new MP_AP_BUILD option, configure and compile an httpd with mod_perl statically linked in Revision Changes Path 1.423 +4 -0 modperl-2.0/Changes Index: Changes =================================================================== RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.422 retrieving revision 1.423 diff -u -r1.422 -r1.423 --- Changes 23 Jul 2004 22:35:31 -0000 1.422 +++ Changes 23 Jul 2004 23:24:55 -0000 1.423 @@ -12,6 +12,10 @@ =item 1.99_15-dev +Static builds for httpd >= 2.0.51 available. With the new MP_AP_BUILD +option, configure and compile an httpd with mod_perl statically linked +in [Gozer] + Apache::RequestRec methods: method_number, connection, canonical_filename are now read-only [Stas] 1.150 +20 -2 modperl-2.0/Makefile.PL Index: Makefile.PL =================================================================== RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.149 retrieving revision 1.150 diff -u -r1.149 -r1.150 --- Makefile.PL 15 Jul 2004 07:38:18 -0000 1.149 +++ Makefile.PL 23 Jul 2004 23:24:55 -0000 1.150 @@ -7,6 +7,7 @@ $ENV{MOD_PERL_2_BUILD} = 1; my $min_httpd_version = '2.0.46'; +my $min_httpd_version_static = '2.0.51'; my($old_modperl_version, $old_modperl_pm); @@ -222,8 +223,16 @@ } exit(1); } - - if ($httpd_version lt $min_httpd_version) { + + my $min_version; + if ($build->should_build_apache) { + $min_version = $min_httpd_version_static; + } + else { + $min_version = $min_httpd_version; + } + + if ($httpd_version lt $min_version) { error "Apache/$httpd_version not supported, " . "$min_httpd_version or higher is required"; exit(1); @@ -251,6 +260,10 @@ #ModPerl::BuildMM will use Apache::BuildConfig in subdir/Makefile.PL's $build->save; + if ($build->should_build_apache) { + $build->configure_apache(); + } + ModPerl::TestRun->generate_script; ModPerl::TestReport->generate_script; Apache::TestSmokePerl->generate_script; @@ -509,6 +522,11 @@ EOF } + if ($build->should_build_apache) { + ModPerl::MM::add_dep(\$string, pure_all => 'ap_build'); + $string .= qq[\nap_build:\n\tcd "$build->{MP_AP_PREFIX}" && make\n]; + } + ModPerl::MM::add_dep(\$string, pure_all => 'modperl_lib'); $string .= <<'EOF'; 1.21 +2 -1 modperl-2.0/README Index: README =================================================================== RCS file: /home/cvs/modperl-2.0/README,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- README 1 Jul 2004 01:40:18 -0000 1.20 +++ README 23 Jul 2004 23:24:55 -0000 1.21 @@ -3,7 +3,8 @@ *** Prerequisites *** Apache: - This version of mod_perl works with Apache versions 2.0.46 - 2.0.50. + The DSO version of mod_perl works with Apache versions 2.0.46 - + 2.0.50. The static version -- with Apache versions 2.0.51 - 2.0.51. Newer Apache versions may work with this version of mod_perl. If not, the cvs version likely will, which can be obtained from: http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution 1.18 +9 -6 modperl-2.0/RELEASE Index: RELEASE =================================================================== RCS file: /home/cvs/modperl-2.0/RELEASE,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- RELEASE 21 May 2004 18:50:47 -0000 1.17 +++ RELEASE 23 Jul 2004 23:24:55 -0000 1.18 @@ -32,21 +32,24 @@ - remove '-dev' - add release date - b. rerun: + b. check ./README & ./Makefile.PL + - make sure supported httpd versions (dso & static) are current + + c. rerun: % perl Makefile.PL MP_INST_APACHE2=1 make sure tag looks right % make -n cvs_tag - c. commit Changes - % cvs ci Changes + d. commit Changes README Makefile.PL + % cvs ci Changes README Makefile.PL - d. tag + e. tag % make cvs_tag - e. create the final package + f. create the final package % make dist - f. test the final package again at least once + g. test the final package again at least once 4. Release the package and update links (e.g. mod_perl-1.99_15.tar.gz) 1.59 +9 -21 modperl-docs/src/docs/2.0/user/install/install.pod Index: install.pod =================================================================== RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/install/install.pod,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- install.pod 16 Jul 2004 01:11:03 -0000 1.58 +++ install.pod 23 Jul 2004 23:24:55 -0000 1.59 @@ -383,28 +383,10 @@ mod_perl is built once as I<mod_perl.a> and I<mod_perl.so>, but afterwards you can choose which of the two to use. -META: The following is not implemented yet. - - mod_perl and ends up with a src/modules/perl/mod_perl.{so,a} and - src/modules/perl/ldopts. to link modperl static with httpd, we just - need some config.m4 magic to add `ldopts` and mod_perl.a to the build. - so one could then build httpd like so: - - ln -s ~/apache/modperl-2.0/src/modules/perl $PWD/src/modules - ./configure --with-mpm=prefork --enable-perl=static ... - - we not be configuring/building httpd for the user as 1.x attempted. - - downside is one will need to have configured httpd first, so that - headers generated. so it will probably be more like: - - ./configure --with-mpm=prefork ... - (go build modperl) - ./config.nice --enable-perl=static && make - - we could of course provide a wrapper script todo this, but don't want - to have this stuff buried and tangled like it is in 1.x +=head4 MP_AP_BUILD +Configure and build httpd in C<MP_AP_PREFIX>, linking mod_perl statically +to it. =head4 MP_STATIC_EXTS @@ -593,6 +575,12 @@ tracing which makes it easier to tell the reported errors and warnings, from the rest of the notifications. +=head4 MP_AP_CONFIGURE + +The command-line arguments to pass to httpd's configure script. + +C<MP_AP_CONFIGURE> has no effect unless C<MP_AP_BUILD> is also +specified. =head2 Re-using Configure Options 1.165 +41 -0 modperl-2.0/lib/Apache/Build.pm Index: Build.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v retrieving revision 1.164 retrieving revision 1.165 diff -u -r1.164 -r1.165 --- Build.pm 4 Jul 2004 18:44:49 -0000 1.164 +++ Build.pm 23 Jul 2004 23:24:55 -0000 1.165 @@ -244,6 +244,47 @@ return $self->{mpm_name} = $mpm_name; } +sub should_build_apache { + my ($self) = @_; + return $self->{MP_AP_BUILD} ? 1 : 0; +} + +sub configure_apache { + my ($self) = @_; + + unless ($self->{MP_AP_CONFIGURE}) { + error "You specified MP_AP_BUILD but did not specify the " . + "arguments to httpd's ./configure with MP_AP_CONFIGURE"; + exit 1; + } + + unless ($self->{MP_USE_STATIC}) { + error "When building httpd, you must set MP_USE_STATIC=1"; + exit 1; + } + + debug "Configuring httpd in $self->{MP_AP_PREFIX}"; + + my $httpd = File::Spec->catfile($self->{MP_AP_PREFIX}, 'httpd'); + push @Apache::TestMM::Argv, ('-httpd' => $httpd); + + my $mplib = "$self->{MP_LIBNAME}$Config{lib_ext}"; + my $mplibpath = catfile($self->{cwd}, qw(src modules perl), $mplib); + + local $ENV{BUILTIN_LIBS} = $mplibpath; + local $ENV{AP_LIBS} = $self->ldopts; + local $ENV{MODLIST} = 'perl'; + + #XXX: -Wall and/or -Werror at httpd configure time breaks things + local $ENV{CFLAGS} = join ' ', grep { ! /\-Wall|\-Werror/ } + split /\s+/, $ENV{CFLAGS}; + + my $cd = qq(cd $self->{MP_AP_PREFIX}); + my $cmd = qq(./configure $self->{MP_AP_CONFIGURE}); + debug "Running $cmd"; + system("$cd && $cmd") == 0 or die "httpd: $cmd failed"; +} + #--- Perl Config stuff --- my %gtop_config = (); 1.28 +2 -0 modperl-2.0/lib/ModPerl/BuildOptions.pm Index: BuildOptions.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/ModPerl/BuildOptions.pm,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- BuildOptions.pm 4 Jul 2004 18:44:49 -0000 1.27 +++ BuildOptions.pm 23 Jul 2004 23:24:55 -0000 1.28 @@ -220,6 +220,8 @@ STATIC_EXTS 0 Build Apache::*.xs as static extensions APXS 0 Path to apxs AP_PREFIX 0 Apache installation or source tree prefix +AP_CONFIGURE 0 Apache ./configure arguments +AP_BUILD 0 Whether to build httpd APR_CONFIG 0 Path to apr-config XS_GLUE_DIR 1 Directories containing extension glue INCLUDE_DIR 1 Add directories to search for header files 1.13 +1 -1 modperl-2.0/t/response/TestAPI/module.pm Index: module.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- module.pm 8 Jul 2004 05:29:42 -0000 1.12 +++ module.pm 23 Jul 2004 23:24:56 -0000 1.13 @@ -87,7 +87,7 @@ #.so { my $build = Apache::BuildConfig->new; - my $expect = $build->{MODPERL_LIB_SHARED} ? 1 : 0; + my $expect = $build->should_build_apache ? 0 : 1; ok t_cmp(Apache::Module::loaded('mod_perl.so'), $expect, "Apache::Module::loaded('mod_perl.so')"); } 1.33 +0 -9 modperl-2.0/todo/release Index: release =================================================================== RCS file: /home/cvs/modperl-2.0/todo/release,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- release 14 Jul 2004 08:42:07 -0000 1.32 +++ release 23 Jul 2004 23:24:56 -0000 1.33 @@ -58,15 +58,6 @@ of child_exit. owner: stas -* static build - if we make it working on OpenBSD, AIX and FreeBSD, - then it's not important to fix the DSO issues, otherwise make the - DSO issues in (todo/bugs_build) a release issue. - httpd-apreq-2 has recently implemented a static build support, we - could probably try to re-use some of the code that was written to do - that, though they use autoconf, which is not quite what we - want. Anyway it's something to look at. - owner: gozer - * <Perl> sections: A few issues with <Perl> sections: http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=106074969831522&w=2