You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@locus.apache.org on 2000/06/09 06:30:42 UTC

cvs commit: modperl-2.0/lib/ModPerl Code.pm MM.pm

dougm       00/06/08 21:30:42

  Modified:    lib/Apache Build.pm
               lib/ModPerl Code.pm MM.pm
  Log:
  integrate with ModPerl::BuildOptions
  misc build tweaks
  
  Revision  Changes    Path
  1.19      +13 -64    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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Build.pm	2000/05/30 18:34:45	1.18
  +++ Build.pm	2000/06/09 04:30:41	1.19
  @@ -7,6 +7,7 @@
   use Cwd ();
   use ExtUtils::Embed ();
   use ModPerl::Code ();
  +use ModPerl::BuildOptions ();
   
   use constant is_win32 => $^O eq 'MSWin32';
   use constant IS_MOD_PERL_BUILD => grep { -e "$_/lib/mod_perl.pm" } qw(. ..);
  @@ -95,6 +96,10 @@
           $ccopts .= " -g -Wall";
       }
   
  +    if ($self->{MP_CCOPTS}) {
  +        $ccopts .= " $self->{MP_CCOPTS}";
  +    }
  +
       if ($self->{MP_TRACE}) {
           $ccopts .= " -DMP_TRACE";
       }
  @@ -174,41 +179,6 @@
   
   #--- user interaction ---
   
  -sub parse_init_file {
  -    my $self = shift;
  -
  -    my $fh;
  -    for (qw(./ ../ ./. ../.), "$ENV{HOME}/.") {
  -        my $file = $_ . 'makepl_args.mod_perl2';
  -        if (open $fh, $file) {
  -            $self->{init_file} = $file;
  -            last;
  -        }
  -        $fh = undef;
  -    }
  -
  -    return unless $fh;
  -
  -    print "Reading Makefile.PL args from $self->{init_file}\n";
  -    while(<$fh>) {
  -        chomp;
  -        s/^\s+//; s/\s+$//;
  -        next if /^\#/ || /^$/;
  -        last if /^__END__/;
  -
  -        if (/^MP_/) {
  -            my($key, $val) = split $self->{param_qr}, $_, 2;
  -            $self->{$key} = $val;
  -            print "   $key = $val\n";
  -	}
  -        else {
  -            push @ARGV, $_;
  -        }
  -    }
  -    close $fh;
  -}
  -
  -
   sub prompt {
       my($self, $q, $default) = @_;
       return $default if $self->{MP_PROMPT_DEFAULT};
  @@ -256,43 +226,17 @@
       return Apache::BuildConfig::->new;
   }
   
  -sub parse_argv {
  -    my $self = shift;
  -    return unless @ARGV;
  -
  -    my @args = @ARGV;
  -    @ARGV = ();
  -
  -    for (@args) {
  -        if (/^MP_/) {
  -            my($key, $val) = split $self->{param_qr}, $_, 2;
  -            $self->{$key} = $val;
  -            print "$key = $val\n";
  -        }
  -        else {
  -            #pass along to MakeMaker
  -            push @ARGV, $_;
  -        }
  -    }
  -}
  -
   sub new {
       my $class = shift;
   
       my $self = bless {
           cwd => Cwd::fastcwd(),
  -        param_qr => qr([\s=]+),
           MP_LIBNAME => 'libmodperl',
           @_,
       }, $class;
   
  -    $self->parse_init_file;
  -    $self->parse_argv;
  +    ModPerl::BuildOptions->init($self);
   
  -    if ($self->{MP_DEBUG} and $self->{MP_USE_GTOP}) {
  -        $self->{MP_USE_GTOP} = 0 unless $self->find_dlfile('gtop');
  -    }
  -
       $self;
   }
   
  @@ -354,6 +298,8 @@
       #work around autosplit braindeadness
       my $package = 'package Apache::BuildConfig';
   
  +    print $fh ModPerl::Code::noedit_warning_hash();
  +
       print $fh <<EOF;
   $package;
   
  @@ -574,7 +520,7 @@
       my $typemap = $self->file_path('src/modules/perl/typemap');
       if (-e $typemap) {
           $xsubpp .= join ' ',
  -          '-typemap', '../src/modules/perl/typemap';
  +          '-typemap', $typemap;
       }
   
       $xsubpp;
  @@ -645,6 +591,8 @@
   
       open my $fh, '>', $mf or die "open $mf: $!";
   
  +    print $fh ModPerl::Code::noedit_warning_hash();
  +
       $self->make_tools($fh);
   
       print $fh $self->canon_make_attr('libname', $self->{MP_LIBNAME});
  @@ -774,7 +722,8 @@
       my @inc = ();
   
       for ("$src/modules/perl", "$src/include",
  -         "$src/lib/apr/include", "$src/os/$os")
  +         "$src/lib/apr/include", "$src/os/$os",
  +         $self->file_path("src/modules/perl"))
         {
             push @inc, "-I$_" if -d $_;
         }
  
  
  
  1.26      +9 -0      modperl-2.0/lib/ModPerl/Code.pm
  
  Index: Code.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Code.pm	2000/05/23 20:54:42	1.25
  +++ Code.pm	2000/06/09 04:30:42	1.26
  @@ -407,7 +407,14 @@
   }
   
   my $noedit_warning = noedit_warning();
  +my $noedit_warning_hash = noedit_warning_hash();
   
  +sub noedit_warning_hash {
  +    return $noedit_warning_hash if $noedit_warning_hash;
  +    (my $warning = noedit_warning()) =~ s/^/\# /mg;
  +    $warning;
  +}
  +
   sub init_file {
       my($self, $name) = @_;
   
  @@ -491,6 +498,8 @@
       open my $fh, '>', $file or die "open $file: $!";
   
       my $package = 'package Apache2';
  +
  +    print $fh ModPerl::Code::noedit_warning_hash();
   
       print $fh <<EOF;
   $package;
  
  
  
  1.3       +8 -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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MM.pm	2000/04/30 18:36:52	1.2
  +++ MM.pm	2000/06/09 04:30:42	1.3
  @@ -18,8 +18,7 @@
   
   sub build_config {
       my $key = shift;
  -    require Apache::BuildConfig;
  -    my $build = Apache::BuildConfig->new;
  +    my $build = Apache::Build->build_config;
       return $build unless $key;
       $build->{$key};
   }
  @@ -52,8 +51,14 @@
   }
   
   sub WriteMakefile {
  +    my $build = build_config();
       my_import();
  -    ExtUtils::MakeMaker::WriteMakefile(@_);
  +    my @opts = (INC => $build->inc);
  +    my $typemap = $build->file_path('src/modules/perl/typemap');
  +    if (-e $typemap) {
  +        push @opts, TYPEMAPS => [$typemap];
  +    }
  +    ExtUtils::MakeMaker::WriteMakefile(@opts, @_);
   }
   
   my %always_dynamic = map { $_, 1 } qw(Apache::Leak);