dougm       02/05/14 11:22:06

  Modified:    lib/Apache Build.pm
               lib/ModPerl MM.pm
  Log:
  get MP_DEBUG=1 working on win32
  
  Revision  Changes    Path
  1.83      +52 -9     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.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- Build.pm  12 May 2002 21:02:15 -0000      1.82
  +++ Build.pm  14 May 2002 18:22:05 -0000      1.83
  @@ -142,6 +142,11 @@
   sub ldopts {
       my($self) = @_;
   
  +    my $config = tied %Config;
  +    my $ldflags = $config->{ldflags};
  +
  +    $config->{ldflags} = '' if WIN32; #same as lddlflags
  +
       my $ldopts = ExtUtils::Embed::ldopts();
       chomp $ldopts;
   
  @@ -157,6 +162,8 @@
           $ldopts .= $self->gtop_ldopts;
       }
   
  +    $config->{ldflags} = $ldflags; #reset
  +
       $ldopts;
   }
   
  @@ -200,13 +207,23 @@
   }
   
   sub perl_ccopts {
  -    my $cflags = shift->strip_lfs(" $Config{ccflags} ");
  +    my $self = shift;
  +
  +    my $cflags = $self->strip_lfs(" $Config{ccflags} ");
   
       my $fixup = \&{"ccopts_$^O"};
       if (defined &$fixup) {
           $fixup->(\$cflags);
       }
   
  +    if ($self->{MP_DEBUG}) {
  +        my $optim = $Config{optimize};
  +
  +        unless ($optim =~ /-DDEBUGGING/) {
  +            $cflags =~ s/$optim//;
  +       }
  +    }
  +
       $cflags;
   }
   
  @@ -226,10 +243,41 @@
       $cflags;
   }
   
  +sub perl_config_optimize {
  +    my($self, $val) = @_;
  +
  +    $val ||= $Config{optimize};
  +
  +    if ($self->{MP_DEBUG}) {
  +        return ' ' unless $val =~ /-DDEBUGGING/;
  +    }
  +
  +    $val;
  +}
  +
  +sub perl_config_lddlflags {
  +    my($self, $val) = @_;
  +
  +    if ($self->{MP_DEBUG}) {
  +        if (MSVC) {
  +            $val =~ s/-release/-debug/;
  +        }
  +    }
  +
  +    $val;
  +}
  +
   sub perl_config {
       my($self, $key) = @_;
   
  -    return $Config{$key} ? $Config{$key} : '';
  +    my $val = $Config{$key} || '';
  +
  +    my $method = \&{"perl_config_$key"};
  +    if (defined &$method) {
  +        return $method->($self, $val);
  +    }
  +
  +    return $val;
   }
   
   sub find_in_inc {
  @@ -731,7 +779,7 @@
   my $mm_replace = join '|', keys %perl_config_pm_alias;
   
   my @perl_config_pm =
  -  (qw(cc cpprun rm ranlib lib_ext obj_ext cccdlflags lddlflags),
  +  (qw(cc cpprun rm ranlib lib_ext obj_ext cccdlflags lddlflags optimize),
      values %perl_config_pm_alias);
   
   sub mm_replace {
  @@ -745,11 +793,6 @@
       for (@perl_config_pm) {
           print $fh $self->canon_make_attr($_, $self->perl_config($_));
       }
  -    unless ($self->{MP_DEBUG}) {
  -        for (qw(optimize)) {
  -            print $fh $self->canon_make_attr($_, $self->perl_config($_));
  -        }
  -    }
   
       require ExtUtils::MakeMaker;
       my $mm = bless {}, 'MM';
  @@ -929,7 +972,7 @@
   clean:
        $(MODPERL_RM_F) *.a *.so *.xsc \
        $(MODPERL_LIBNAME).exp $(MODPERL_LIBNAME).lib \
  -     *$(MODPERL_OBJ_EXT) *.lo *.i *.s \
  +     *$(MODPERL_OBJ_EXT) *.lo *.i *.s *.pdb \
        $(MODPERL_CLEAN_FILES) \
        $(MODPERL_XS_CLEAN_FILES)
   
  
  
  
  1.19      +5 -3      modperl-2.0/lib/ModPerl/MM.pm
  
  Index: MM.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/MM.pm,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- MM.pm     12 May 2002 22:42:19 -0000      1.18
  +++ MM.pm     14 May 2002 18:22:06 -0000      1.19
  @@ -71,9 +71,11 @@
       my $ccflags = $build->perl_ccopts . $build->ap_ccopts;
   
       my @opts = (
  -        INC     => $inc,
  -        CCFLAGS => $ccflags,
  -        LIBS    => $libs,
  +        INC       => $inc,
  +        CCFLAGS   => $ccflags,
  +        OPTIMIZE  => $build->perl_config('optimize'),
  +        LDDLFLAGS => $build->perl_config('lddlflags'),
  +        LIBS      => $libs,
           dynamic_lib => { OTHERLDFLAGS => $build->otherldflags },
       );
   
  
  
  


Reply via email to