perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: modperl-2.0/lib/Apache Build.pm
Date Fri, 25 Jul 2003 01:49:10 GMT
randyk      2003/07/24 18:49:10

  Modified:    .        Changes
               lib/Apache Build.pm
  Log:
  Reviewed by:	stas
  For Win32,
  - generate .pdb files for debugging when built with MP_DEBUG, and
  install them into the same directory as the associated dll/so libs.
  - install mod_perl.lib into MP_AP_PREFIX/lib/ for use by 3rd party modules.
  
  Revision  Changes    Path
  1.196     +5 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.195
  retrieving revision 1.196
  diff -u -r1.195 -r1.196
  --- Changes	12 Jun 2003 23:42:23 -0000	1.195
  +++ Changes	25 Jul 2003 01:49:10 -0000	1.196
  @@ -12,6 +12,11 @@
   
   =item 1.99_10-dev
   
  +For Win32, generate .pdb files for debugging when built with
  +MP_DEBUG. These will get installed into the same directory as
  +the associated dll/so libs. As well, install mod_perl.lib
  +into MP_AP_PREFIX/lib/ for use by 3rd party modules [Randy Kobes].
  +
   Apache2.pm is now autogenerated and will adjust @INC to include
   Apache2/ subdirs only if built with MP_INST_APACHE2=1 [Stas]
   
  
  
  
  1.128     +67 -11    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.127
  retrieving revision 1.128
  diff -u -r1.127 -r1.128
  --- Build.pm	12 Jun 2003 23:42:23 -0000	1.127
  +++ Build.pm	25 Jul 2003 01:49:10 -0000	1.128
  @@ -319,7 +319,9 @@
   
       if ($self->{MP_DEBUG}) {
           if (MSVC) {
  -            $val =~ s/-release/-debug/;
  +            unless ($val =~ s/-release/-debug/) {
  +                $val .= ' -debug';
  +            }
           }
       }
   
  @@ -1058,8 +1060,11 @@
   sub dynamic_link_MSWin32 {
       my $self = shift;
       my $defs = $self->export_files_MSWin32;
  +    my $symbols = $self->modperl_symbols_MSWin32;
       return $self->dynamic_link_header_default .
  -           "\t$defs" . ' -out:$@';
  +        "\t$defs" .
  +        ($symbols ? ' \\' . "\n\t-pdb:$symbols" : '') .
  +        ' -out:$@';
   }
   
   sub dynamic_link_aix {
  @@ -1093,7 +1098,8 @@
   
   sub modperl_libs_MSWin32 {
       my $self = shift;
  -    #XXX: install/use mod_perl.lib for 3rd party xs modules
  +    # mod_perl.lib will be installed into MP_AP_PREFIX/lib
  +    # for use by 3rd party xs modules
       "$self->{cwd}/src/modules/perl/$self->{MP_LIBNAME}.lib";
   }
   
  @@ -1104,11 +1110,35 @@
       $libs->($self);
   }
   
  +sub modperl_symbols_MSWin32 {
  +    my $self = shift;
  +    return "" unless $self->{MP_DEBUG};
  +    "$self->{cwd}/src/modules/perl/$self->{MP_LIBNAME}.pdb";
  +}
  +
  +sub modperl_symbols {
  +    my $self = shift;
  +    my $symbols = \&{"modperl_symbols_$^O"};
  +    return "" unless defined &$symbols;
  +    $symbols->($self);
  +}
  +
   sub write_src_makefile {
       my $self = shift;
       my $code = ModPerl::Code->new;
       my $path = $code->path;
   
  +    my $install = <<'EOI';
  +install:
  +# install mod_perl.so
  +	@$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
  +	$(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \
  +	$(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR)
  +# install mod_perl .h files
  +	@$(MKPATH) $(MODPERL_AP_INCLUDEDIR)
  +	$(MODPERL_CP) $(MODPERL_H_FILES) $(MODPERL_AP_INCLUDEDIR)
  +EOI
  +
       my $mf = $self->default_file('makefile');
   
       open my $fh, '>', $mf or die "open $mf: $!";
  @@ -1141,6 +1171,28 @@
           print $fh $self->canon_make_attr("lib_$type", $libs{$type});
       }
   
  +    if (my $symbols = $self->modperl_symbols) {
  +        print $fh $self->canon_make_attr('lib_symbols', $symbols);
  +        $install .= <<'EOI';
  +# install mod_perl symbol file
  +	@$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
  +	$(MODPERL_TEST_F) $(MODPERL_LIB_SYMBOLS) && \
  +	$(MODPERL_CP) $(MODPERL_LIB_SYMBOLS) $(MODPERL_AP_LIBEXECDIR)
  +EOI
  +    }
  +
  +    if (my $libs = $self->modperl_libs) {
  +        print $fh $self->canon_make_attr('lib_location', $libs);
  +        print $fh $self->canon_make_attr('ap_libdir', 
  +                                         "$self->{MP_AP_PREFIX}/lib");
  +        $install .= <<'EOI';
  +# install mod_perl.lib
  +	@$(MKPATH) $(MODPERL_AP_LIBDIR)
  +	$(MODPERL_TEST_F) $(MODPERL_LIB_LOCATION) && \
  +	$(MODPERL_CP) $(MODPERL_LIB_LOCATION) $(MODPERL_AP_LIBDIR)
  +EOI
  +    }
  +
       my $libperl = join '/',
         $self->perl_config('archlibexp'), 'CORE', $self->perl_config('libperl');
   
  @@ -1188,14 +1240,11 @@
   
   lib: $(MODPERL_LIB)
   
  -install:
  -# install mod_perl.so
  -	@$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
  -	$(MODPERL_TEST_F) $(MODPERL_LIB_DSO) && \
  -	$(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR)
  -# install mod_perl .h files
  -	@$(MKPATH) $(MODPERL_AP_INCLUDEDIR)
  -	$(MODPERL_CP) $(MODPERL_H_FILES) $(MODPERL_AP_INCLUDEDIR)
  +EOF
  +
  +    print $fh $install;
  +
  +    print $fh <<'EOF';
   
   .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s
   
  @@ -1264,6 +1313,13 @@
       my $flags = \&{"otherldflags_$^O"};
       return $self->otherldflags_default unless defined &$flags;
       $flags->($self);
  +}
  +
  +sub otherldflags_MSWin32 {
  +    my $self = shift;
  +    my $flags = $self->otherldflags_default;
  +    $flags .= ' -pdb:$(INST_ARCHAUTODIR)\$(BASEEXT).pdb' if $self->{MP_DEBUG};
  +    $flags;
   }
   
   sub typemaps {
  
  
  

Mime
View raw message