Friday, December 02, 2005

mod_perl 1+2 configuration directives sans compatibility layer


use strict;
use warnings FATAL => 'all';

our (%PREREQ_PM, $INC);

BEGIN {
%PREREQ_PM = (
'Test::More' => 0,
'Apache::Test' => 1.25,
);
$INC = '';

# bootstrap for mod_perl 1.x
eval { require Apache };
unless ($@) {
require Apache::ExtUtils;
require Apache::src;

# add include paths
$INC = Apache::src->new->inc;

# mod_perl 1.x specific prerequisites
$PREREQ_PM{XSLoader} = 0;
$PREREQ_PM{mod_perl} = 1.29;

# retrieve and build command table XS
require 'lib/Apache/DebugLog.pm';
Apache::ExtUtils::command_table(\@Apache::DebugLog::DIRECTIVES);
}

# bootstrap for mod_perl 2.x
eval { require Apache2 };
unless ($@) {
# mod_perl 2.x specific prerequisites
$PREREQ_PM{mod_perl2} = 1.999023;
}

unless (grep { exits $INC{$_} } qw(Apache.pm Apache2.pm)) {
die "Must have mod_perl 1 or 2 installed.";
}
}

use ExtUtils::MakeMaker;

use Apache::TestMM qw(test clean);

Apache::TestMM::filter_args();
Apache::TestMM::generate_script('t/TEST');

WriteMakefile(
NAME => 'Apache::DebugLog',
AUTHOR => 'dorian taylor ',
VERSION_FROM => 'lib/Apache/DebugLog.pm',
ABSTRACT_FROM => 'lib/Apache/DebugLog.pm',
PL_FILES => {},
INC => $INC,
PREREQ_PM => \%PREREQ_PM,
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Apache-DebugLog-* t/TEST' },
);

0 Comments:

Post a Comment

<< Home