stas        2003/08/22 17:12:17

  Modified:    lib/Apache Build.pm
  Log:
  find the apr config dir in case of the build against the httpd source tree
  
  Revision  Changes    Path
  1.143     +13 -11    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.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- Build.pm  22 Aug 2003 19:15:09 -0000      1.142
  +++ Build.pm  23 Aug 2003 00:12:17 -0000      1.143
  @@ -798,10 +798,19 @@
           $incdir = $self->ap_includedir;
       }
   
  -    if ($incdir && -e catfile $incdir, "apr.h") {
  -        $self->{apr_includedir} = $incdir;
  +    my @tries = ($incdir);
  +    if ($self->httpd_is_source_tree) {
  +        my $path = catdir $self->dir, "srclib", "apr", "include";
  +        push @tries, $path if -d $path;
       }
  -    else {
  +
  +    for (@tries) {
  +        next unless $_ && -e catfile $_, "apr.h";
  +        $self->{apr_includedir} = $_;
  +        last;
  +    }
  +
  +    unless ($self->{apr_includedir}) {
           error "Can't find apr include/ directory,",
               "use MP_APR_CONFIG=/path/to/apr-config";
           exit 1;
  @@ -942,14 +951,7 @@
   
       return $self->{apr_config} if $self->{apr_config};
   
  -    my $dir = $self->apr_includedir;
  -
  -    my $header;
  -    for my $d ($dir, "$dir/../srclib/apr/include") {
  -        $header = "$d/apr.h";
  -        last if -e $header;
  -    }
  -
  +    my $header = catfile $self->apr_includedir, "apr.h";
       open my $fh, $header or do {
           error "Unable to open $header: $!";
           return undef;
  
  
  

Reply via email to