dougm 02/05/21 09:19:51 Modified: . Makefile.PL lib/Apache Build.pm lib/ModPerl BuildOptions.pm Log: enable both MP_USE_{DSO,STATIC} by default, specifying one turns off the other. Revision Changes Path 1.81 +7 -5 modperl-2.0/Makefile.PL Index: Makefile.PL =================================================================== RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- Makefile.PL 19 May 2002 19:46:08 -0000 1.80 +++ Makefile.PL 21 May 2002 16:19:51 -0000 1.81 @@ -203,13 +203,15 @@ $code->generate($build); - warning sprintf "mod_perl will be built %s as %s", - $build->is_dynamic ? "shared" : "static", - $build->{"MODPERL_LIB"}; + for my $type (qw(DSO STATIC)) { + next unless $build->{"MP_USE_$type"}; + warning "mod_perl \L$type\E library will be built as ". + $build->{"MODPERL_LIB_$type"}; + } if ($build->is_dynamic) { warning "You'll need to add the following to httpd.conf:", - " LoadModule perl_module modules/$build->{MODPERL_LIB}\n"; + " LoadModule perl_module modules/$build->{MODPERL_LIB_DSO}\n"; } if ($build->{MP_INST_APACHE2}) { @@ -337,7 +339,7 @@ sub os_check_hpux { my $ccflags = $build->perl_config('ccflags'); - if ($build->{MP_USE_DSO} and $Config{ld} eq 'ld') { + if ($build->is_dynamic and $Config{ld} eq 'ld') { unless ($ccflags =~ /\+z/i) { $build->phat_warn(<<EOF); mod_perl is unlikely to link with your libperl, suggestions: 1.86 +18 -14 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.85 retrieving revision 1.86 diff -u -r1.85 -r1.86 --- Build.pm 20 May 2002 22:27:30 -0000 1.85 +++ Build.pm 21 May 2002 16:19:51 -0000 1.86 @@ -533,10 +533,7 @@ #--- attribute access --- -sub is_dynamic { - my $self = shift; - $self->{MP_USE_DSO} || $self->{MP_USE_APXS}; -} +sub is_dynamic { shift->{MP_USE_DSO} } sub default_dir { my $build = shift->build_config; @@ -909,13 +906,17 @@ print $fh $self->canon_make_attr('libname', $self->{MP_LIBNAME}); print $fh $self->canon_make_attr('dlext', 'so'); #always use .so - print $fh $self->canon_make_attr('lib_shared', - "$self->{MP_LIBNAME}.$self->{MODPERL_DLEXT}"); - - print $fh $self->canon_make_attr('lib_static', - "$self->{MP_LIBNAME}$self->{MODPERL_LIB_EXT}"); + my %libs = ( + dso => "$self->{MP_LIBNAME}.$self->{MODPERL_DLEXT}", + static => "$self->{MP_LIBNAME}$self->{MODPERL_LIB_EXT}", + ); + #XXX short-term compat for Apache::TestConfigPerl + $libs{shared} = $libs{dso}; + while (my($type, $lib) = each %libs) { + print $fh $self->canon_make_attr("lib_$type", $libs{$type}); + } print $fh $self->canon_make_attr('libperl', join '/', @@ -931,9 +932,12 @@ print $fh $self->canon_make_attr($method, @{ $code->$method() }); } - print $fh $self->canon_make_attr('lib', $self->is_dynamic ? - $self->{MODPERL_LIB_SHARED} : - $self->{MODPERL_LIB_STATIC}); + my @libs; + for my $type (map { uc } keys %libs) { + push @libs, $self->{"MODPERL_LIB_$type"} if $self->{"MP_USE_$type"}; + } + + print $fh $self->canon_make_attr('lib', "@libs"); for my $q (qw(LIBEXECDIR)) { print $fh $self->canon_make_attr("AP_$q", @@ -956,8 +960,8 @@ lib: $(MODPERL_LIB) install: - $(MODPERL_TEST_F) $(MODPERL_LIB_SHARED) && \ - $(MODPERL_CP) $(MODPERL_LIB_SHARED) $(MODPERL_AP_LIBEXECDIR) + $(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \ + $(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR) .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s 1.15 +4 -1 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.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- BuildOptions.pm 6 Apr 2002 16:24:51 -0000 1.14 +++ BuildOptions.pm 21 May 2002 16:19:51 -0000 1.15 @@ -24,7 +24,10 @@ $build->{MP_USE_GTOP} = 0 unless $build->find_dlfile('gtop'); } - $build->{MP_USE_DSO} = 1 unless $build->{MP_USE_STATIC}; + unless ($build->{MP_USE_DSO} or $build->{MP_USE_STATIC}) { + $build->{MP_USE_DSO} = $build->{MP_USE_STATIC} = 1; + } + $build->{MP_GENERATE_XS} = 1 unless exists $build->{MP_GENERATE_XS}; }