dougm 01/03/04 15:22:51 Modified: lib/Apache Build.pm ParseSource.pm Log: look in MP_INCLUDE_DIR when scanning source Apache::Build::AUTOLOAD for accessing MP_* data Revision Changes Path 1.35 +15 -4 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.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- Build.pm 2001/03/04 19:41:56 1.34 +++ Build.pm 2001/03/04 23:22:49 1.35 @@ -13,7 +13,20 @@ use constant IS_MOD_PERL_BUILD => grep { -e "$_/lib/mod_perl.pm" } qw(. ..); our $VERSION = '0.01'; +our $AUTOLOAD; +sub AUTOLOAD { + my $self = shift; + my $name = uc ((split '::', $AUTOLOAD)[-1]); + unless ($name =~ /^MP_/) { + die "no such method: $AUTOLOAD"; + } + unless ($self->{$name}) { + return wantarray ? () : undef; + } + return wantarray ? (split /\s+/, $self->{$name}) : $self->{$name}; +} + #--- apxs stuff --- our $APXS; @@ -784,6 +797,8 @@ my $os = is_win32 ? 'win32' : 'unix'; my @inc = $self->file_path("src/modules/perl", "xs"); + push @inc, $self->mp_include_dir; + my $ainc = $self->apxs('-q' => 'INCLUDEDIR'); if (-d $ainc) { push @inc, $ainc; @@ -804,10 +819,6 @@ $ssl_dir = join '/', $self->{MP_SSL_BASE} || '', 'include'; } push @inc, $ssl_dir if -d $ssl_dir; - - if ($self->{MP_INCLUDE_DIR}) { - push @inc, split /\s+/, $self->{MP_INCLUDE_DIR}; - } return \@inc; } 1.11 +19 -13 modperl-2.0/lib/Apache/ParseSource.pm Index: ParseSource.pm =================================================================== RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ParseSource.pm 2001/03/03 23:08:58 1.10 +++ ParseSource.pm 2001/03/04 23:22:49 1.11 @@ -10,7 +10,7 @@ my $class = shift; my $self = bless { - config => Apache::Build->new, + config => Apache::Build->build_config, @_, }, $class; @@ -65,7 +65,11 @@ bless $c, 'Apache::ParseSource::Scan'; } -sub include_dir { shift->config->apxs(-q => 'INCLUDEDIR') } +sub include_dirs { + my $self = shift; + ($self->config->apxs(-q => 'INCLUDEDIR'), + $self->config->mp_include_dir); +} sub includes { shift->config->includes } @@ -76,24 +80,26 @@ require File::Find; - my $dir = $self->include_dir; + my(@dirs) = $self->include_dirs; - unless (-d $dir) { + unless (-d $dirs[0]) { die "could not find include directory"; } my @includes; my $unwanted = join '|', qw(ap_listen internal); - File::Find::finddepth({ - wanted => sub { - return unless /\.h$/; - return if /($unwanted)/o; - my $dir = $File::Find::dir; - push @includes, "$dir/$_"; - }, - follow => 1, - }, $dir); + for my $dir (@dirs) { + File::Find::finddepth({ + wanted => sub { + return unless /\.h$/; + return if /($unwanted)/o; + my $dir = $File::Find::dir; + push @includes, "$dir/$_"; + }, + follow => 1, + }, $dir); + } #include apr_*.h before the others my @wanted = grep { /apr_\w+\.h$/ } @includes;