Subject: | Build errors occur when install lacks Apache::Test |
Sorry this is a bit long.
When I run 'perl Makefile.PL' without Apache::Test installed I received
the following error:
This module can optionally use Apache::Test to test the mod_perl
functionality.
Undefined subroutine &ExtUtils::MakeMaker::prompt called at Makefile.PL
line 31.
I fixed it with Makefile.PL.patch attached.
Basically the Makefile.PL didn't include a require for
ExtUtils::MakeMaker, CWD, and CPAN, in that block.
Afterwards, I ran into an issue with the 'Build.PL' script. (Makefile.PL
answering 'n' to the apache::test question:
This module can optionally use Apache::Test to test the mod_perl
functionality.
Install Apache::Test now from CPAN? [y] n
# running Build.PL --install_path lib=/home/users/lcarmich/perllib
/usr/local/bin/perl5 Build.PL --install_path
lib=/home/users/lcarmich/perllib
Can't locate object method "new" via package "Module::Build" (perhaps
you forgot to load "Module::Build"?) at Build.PL line 2.
I fixed this by adding a require of the $build_pkg before the 'new' is
called. See attached patch 'Build.PL.patch'.
Subject: | Build.PL.patch |
--- orig.Build.PL 2008-02-20 18:18:11.276145000 -0500
+++ Build.PL 2008-02-20 18:48:26.968577000 -0500
@@ -1,4 +1,7 @@
my $build_pkg = eval "require Apache::TestMB" ? 'Apache::TestMB' : 'Module::Build';
+
+eval "require $build_pkg";
+
my $build = $build_pkg->new(
module_name => 'CGI::Application::Dispatch',
license => 'perl',
Subject: | Makefile.PL.patch |
--- orig.Makefile.PL 2008-02-20 18:14:25.263735000 -0500
+++ Makefile.PL 2008-02-20 18:16:32.465295000 -0500
@@ -28,9 +28,13 @@
my $build_pkg = 'Module::Build';
unless(eval "use Apache::Test 1.30; 1") {
print "This module can optionally use Apache::Test to test the mod_perl functionality.\n";
+ require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt(' Install Apache::Test now from CPAN?', 'y');
if($yn =~ /^y/i) {
+ require Cwd;
+ require CPAN;
+
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
@@ -45,5 +49,8 @@
}
}
+require Module::Build;
+require Module::Build::Compat;
+
Module::Build::Compat->run_build_pl(args => \@ARGV);
Module::Build::Compat->write_makefile(build_class => $build_pkg);