|
|
my $src = Apache::src->new;
for my $path ($src->find) { my $mmn = $src->module_magic_number($path); my $v = $src->httpd_version($path); next unless $v; print ``path = $path ($mmn,$v)\n''; my $dir = $src->prompt(``Configure with $path?''); }
Apache::src - Methods for locating and parsing bits of Apache source code
use Apache::src (); my $src = Apache::src->new;
This module provides methods for locating and parsing bits of Apache source code.
my $src = Apache::src->new;
my $dir = $src->dir; -d $dir or die "can't stat $dir $!\n";
httpd.h are in different directories
between versions less than 1.3 and those equal to or greater. This
method will return the right directory.
Example:
-e join "/", $src->main, "httpd.h" or die "can't stat httpd.h\n";
Example:
for my $dir ($src->find) {
my $yn = prompt "Configure with $dir ?", "y";
...
}
WriteMakefile.
Example:
use ExtUtils::MakeMaker;
use Apache::src ();
WriteMakefile(
'NAME' => 'Apache::Module',
'VERSION' => '0.01',
'INC' => Apache::src->new->inc,
);
Example:
my $mmn = $src->module_magic_number;
Example:
my $v = $src->httpd_version;
WriteMakefile. This might be needed on systems like AIX that need
special flags to the linker to be able to reference mod_perl or httpd
symbols.
Example:
use ExtUtils::MakeMaker;
use Apache::src ();
WriteMakefile(
'NAME' => 'Apache::Module',
'VERSION' => '0.01',
'INC' => Apache::src->new->inc,
'dynamic_lib' => {
'OTHERLDFLAGS' => Apache::src->new->otherldflags,
},
);
Doug MacEachern