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/05/30 20:33:22 UTC

cvs commit: modperl-2.0/lib/Apache Build.pm

dougm       00/05/30 11:33:21

  Modified:    lib/Apache Build.pm
  Log:
  always re-load Apache/BuildConfig.pm (from eric)
  adjust to new version #defines in httpd.conf and throw away old version parsing mess
  pass -typemap src/modules/perl/typemap to xsubpp if it exists
  
  Revision  Changes    Path
  1.17      +13 -22    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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Build.pm	2000/04/30 18:36:51	1.16
  +++ Build.pm	2000/05/30 18:33:20	1.17
  @@ -249,6 +249,7 @@
   sub build_config {
       my $self = shift;
       unshift @INC, 'lib';
  +    delete $INC{'Apache/BuildConfig.pm'};
       eval { require Apache::BuildConfig; };
       shift @INC;
       return bless {}, (ref($self) || $self) if $@;
  @@ -541,31 +542,14 @@
       }
   
       open my $fh, "$dir/httpd.h" or return undef;
  -    my($server, $version, $rest);
  -    my($fserver, $fversion, $frest);
  -    my($string, $extra, @vers);
  +    my $version;
   
       while(<$fh>) {
  -	next unless /^\#define/;
  -	s/SERVER_PRODUCT \"/\"Apache/; #1.3.13+
  -	next unless s/^\#define\s+AP_SERVER_(BASE|)VERSION\s+"(.*)\s*".*/$2/;
  -	chomp($string = $_);
  -
  -	#print STDERR "Examining SERVER_VERSION '$string'...";
  -	#could be something like:
  -	#Stronghold-1.4b1-dev Ben-SSL/1.3 Apache/1.1.1 
  -	@vers = split /\s+/, $string;
  -	foreach (@vers) {
  -	    next unless ($fserver,$fversion,$frest) =
  -		m,^([^/]+)/(\d\.\d+\.?\d*)([^ ]*),i;
  -
  -	    if($fserver eq 'Apache') {
  -		($server, $version) = ($fserver, $fversion);
  -		#$frest =~ s/^(a|b)(\d+).*/'_' . (length($2) > 1 ? $2 : "0$2")/e;
  -		$version .= $frest if $frest;
  -	    }
  -	}
  +	next unless /^\#define\s+AP_SERVER_BASEREVISION\s+\"(.*)\"/;
  +	$version = $1;
  +        last;
       }
  +
       close $fh;
   
       $self->httpd_version_cache($dir, $version);
  @@ -586,6 +570,13 @@
       my $xsubpp = join ' ', '$(MODPERL_PERLPATH)',
         '$(MODPERL_PRIVLIBEXP)/ExtUtils/xsubpp',
           '-typemap', '$(MODPERL_PRIVLIBEXP)/ExtUtils/typemap';
  +
  +    my $typemap = $self->file_path('src/modules/perl/typemap');
  +    if (-e $typemap) {
  +        $xsubpp .= join ' ',
  +          '-typemap', '../src/modules/perl/typemap';
  +    }
  +
       $xsubpp;
   }