perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@locus.apache.org
Subject cvs commit: modperl/lib/Apache src.pm
Date Fri, 24 Mar 2000 19:48:33 GMT
dougm       00/03/24 11:48:33

  Modified:    .        Changes
               lib/Apache src.pm
  Log:
  Apache::src::apxs fixups to quiet warnings if apxs doesnt exist or
  httpd is not dso enabled
  
  Revision  Changes    Path
  1.442     +4 -0      modperl/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.441
  retrieving revision 1.442
  diff -u -r1.441 -r1.442
  --- Changes	2000/03/24 19:00:23	1.441
  +++ Changes	2000/03/24 19:48:30	1.442
  @@ -10,6 +10,10 @@
   
   =item 1.22_01-dev
   
  +Apache::src::apxs fixups to quiet warnings if apxs doesnt exist or
  +httpd is not dso enabled, thanks to Oleg Bartunov and Ville Skyttä for 
  +spotting
  +
   fix #ifdef SGI_BOOST typo
   [Ville Skyttä <ville@office.popsystems.com>]
   
  
  
  
  1.24      +31 -12    modperl/lib/Apache/src.pm
  
  Index: src.pm
  ===================================================================
  RCS file: /home/cvs/modperl/lib/Apache/src.pm,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- src.pm	2000/03/22 07:07:30	1.23
  +++ src.pm	2000/03/24 19:48:32	1.24
  @@ -13,7 +13,7 @@
   #once it is sane, we'll use these methods in Makefile.PL
   
   $VERSION = '0.01';
  -sub IS_MOD_PERL_BUILD () {-e "../lib/mod_perl.pm"}
  +sub IS_MOD_PERL_BUILD () {grep { -e "$_/lib/mod_perl.pm" } qw(. ..)}
   my $Is_Win32 = ($^O eq "MSWin32");
   $Apache::src::APXS ||= "";
   
  @@ -21,17 +21,25 @@
       my $self = shift;
       eval { require Apache::MyConfig };
       my $apxs;
  -    for ($Apache::src::APXS,
  -	 $Apache::MyConfig::Setup{'APXS'},
  -	 `which apxs`,
  -	 "/usr/local/apache/bin/apxs")
  -      {
  -	  next unless ($apxs = $_);
  -	  chomp $apxs;
  -	  last if -x $apxs;
  -      }
  +    my @trys = ($Apache::src::APXS,
  +		$Apache::MyConfig::Setup{'APXS'});
  +
  +    unless (IS_MOD_PERL_BUILD) {
  +	#if we are building mod_perl via apxs, apxs should already be known
  +	#these extra tries are for things built outside of mod_perl
  +	#e.g. libapreq
  +	push @trys,
  +	which("apxs"),
  +	"/usr/local/apache/bin/apxs";
  +    }
  +
  +    for (@trys) {
  +	next unless ($apxs = $_);
  +	chomp $apxs;
  +	last if -x $apxs;
  +    }
       return "" unless $apxs and -x $apxs;
  -    `$apxs @_`;
  +    `$apxs @_ 2>/dev/null`;
   }
   
   sub apxs_cflags {
  @@ -41,6 +49,17 @@
       $cflags;
   }
   
  +sub which {
  +    my $name = shift;
  +
  +    for (split ':', $ENV{PATH}) {
  +	my $app = "$_/$name";
  +	return $app if -x $app;
  +    }
  +
  +    return "";
  +}
  +
   sub new {
       my $class = shift;
       my $dir;
  @@ -49,7 +68,7 @@
   	eval {
   	    require "../lib/Apache/MyConfig.pm";
   	};
  -	print $@ if $@;
  +
   	unless ($@) {
   	    $dir = $Apache::MyConfig::Setup{Apache_Src};
   	    for ($dir, "../$dir", "../../$dir") {
  
  
  

Mime
View raw message