dougm       00/04/21 00:12:42

  Modified:    lib/Apache Build.pm
               src/modules/perl modperl_callback.c
  Log:
  hang onto MP_ parameter prefix, easy to dig out later
  parse .makepl_args.mod_perl2
  
  Revision  Changes    Path
  1.8       +49 -10    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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Build.pm  2000/04/20 18:28:14     1.7
  +++ Build.pm  2000/04/21 07:12:41     1.8
  @@ -72,7 +72,7 @@
       my $ldopts = ExtUtils::Embed::ldopts();
       chomp $ldopts;
   
  -    if ($self->{use_gtop}) {
  +    if ($self->{MP_USE_GTOP}) {
           $ldopts .= $self->gtop_ldopts;
       }
   
  @@ -84,14 +84,19 @@
   
       my $ccopts = ExtUtils::Embed::ccopts();
   
  -    if ($self->{use_gtop}) {
  +    if ($self->{MP_USE_GTOP}) {
           $ccopts .= " -DMP_USE_GTOP";
       }
   
  -    if ($self->{debug}) {
  -        $ccopts .= " -g -Wall -DMP_TRACE";
  +    if ($self->{MP_DEBUG}) {
  +        $self->{MP_TRACE} = 1;
  +        $ccopts .= " -g -Wall";
       }
   
  +    if ($self->{MP_TRACE}) {
  +        $ccopts .= " -DMP_TRACE";
  +    }
  +
       $ccopts;
   }
   
  @@ -168,9 +173,41 @@
   
   #--- 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";
  +     }
  +    }
  +    close $fh;
  +}
  +
  +
   sub prompt {
       my($self, $q, $default) = @_;
  -    return $default if $self->{prompt_default};
  +    return $default if $self->{MP_PROMPT_DEFAULT};
       require ExtUtils::MakeMaker;
       ExtUtils::MakeMaker::prompt($q, $default);
   }
  @@ -222,9 +259,9 @@
       @ARGV = ();
   
       for (@args) {
  -        if (s/^MP_//) {
  -            my($key, $val) = split '=', $_, 2;
  -            $self->{lc $key} = $val;
  +        if (/^MP_/) {
  +            my($key, $val) = split $self->{param_qr}, $_, 2;
  +            $self->{$key} = $val;
               print "$key = $val\n";
           }
           else {
  @@ -239,13 +276,15 @@
   
       my $self = bless {
           cwd => Cwd::fastcwd(),
  +        param_qr => qr([\s=]+),
           @_,
       }, $class;
   
       $self->parse_argv;
  +    $self->parse_init_file;
   
  -    if ($self->{debug} and $self->{use_gtop}) {
  -        $self->{use_gtop} = 0 unless $self->find_dlfile('gtop');
  +    if ($self->{MP_DEBUG} and $self->{MP_USE_GTOP}) {
  +        $self->{MP_USE_GTOP} = 0 unless $self->find_dlfile('gtop');
       }
   
       $self;
  
  
  
  1.3       +0 -2      modperl-2.0/src/modules/perl/modperl_callback.c
  
  Index: modperl_callback.c
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- modperl_callback.c        2000/04/21 05:25:31     1.2
  +++ modperl_callback.c        2000/04/21 07:12:42     1.3
  @@ -287,9 +287,7 @@
       modperl_handler_t **handlers;
       MpAV *av;
       int i, status;
  -#ifdef MP_TRACE
       const char *desc;
  -#endif
   
       if (type == MP_HANDLER_TYPE_DIR) {
           MP_dDCFG;
  
  
  

Reply via email to