Author: randyk
Date: Sun Apr 24 19:05:28 2005
New Revision: 164514
URL: http://svn.apache.org/viewcvs?rev=164514&view=rev
Log:
Allow top-level Makefile.PL to check prerequisites for Win32,
rather than doing it within win32/Configure.pl (no change to unix build).
Modified:
httpd/apreq/trunk/Makefile.PL
httpd/apreq/trunk/win32/Configure.pl
Modified: httpd/apreq/trunk/Makefile.PL
URL:
http://svn.apache.org/viewcvs/httpd/apreq/trunk/Makefile.PL?rev=164514&r1=164513&r2=164514&view=diff
==============================================================================
--- httpd/apreq/trunk/Makefile.PL (original)
+++ httpd/apreq/trunk/Makefile.PL Sun Apr 24 19:05:28 2005
@@ -15,42 +15,43 @@
test_prereq perl => PERL_PATH;
+my %opts;
+undef @opts{qw(with-apache2-apxs with-apache1-apxs with-apache2-src
+ with-perl with-apache2-httpd
+ with-apr-config with-apu-config apxs)};
+undef $opts{'with-apache2'} if (WIN32);
+
+my @flags = qw/enable-maintainer-mode enable-perl-glue disable-perl-glue/;
+my %args;
+# grab from @ARGV only the options that we expect
+GetOptions(\%args, (map "$_=s", keys %opts), @flags);
+
+$args{"with-perl"} = PERL_PATH;
+my $opts = "";
+$opts .= "--enable-maintainer-mode " if $args{"enable-maintainer-mode"};
+
+unless (exists $args{"disable-perl-glue"}) {
+ $opts .= "--enable-perl-glue ";
+ test_prereq "mod_perl";
+ test_prereq "Apache::Test";
+ test_prereq "ExtUtils::MakeMaker";
+ test_prereq "ExtUtils::XSBuilder";
+ test_prereq "Test::More";
+}
+
+delete @[EMAIL PROTECTED];
+$args{"with-apache2-apxs"} = delete $args{apxs}
+ if exists $args{apxs} and not exists $args{"with-apache2-apxs"};
+
+$args{"with-perl-opts"} = "@ARGV" if @ARGV;
+
if (WIN32) {
- push @ARGV, '--with-perl=' . PERL_PATH;
- my @args = (PERL_PATH, 'win32/Configure.pl', @ARGV);
+ my @opts = map{qq/--$_="$args{$_}"/} keys %args;
+ my @args = (PERL_PATH, 'win32/Configure.pl', @opts);
print "@args\n";
system(@args) == 0 or die "system @args failed: $?";
}
else {
- my %opts;
- undef @opts{qw(with-apache2-apxs with-apache1-apxs with-apache2-src
- with-perl with-apache2-httpd
- with-apr-config with-apu-config apxs)};
-
- my @flags = qw/enable-maintainer-mode enable-perl-glue disable-perl-glue/;
- my %args;
- # grab from @ARGV only the options that we expect
- GetOptions(\%args, (map "$_=s", keys %opts), @flags);
-
- $args{"with-perl"} = PERL_PATH;
- my $opts = "";
- $opts .= "--enable-maintainer-mode " if $args{"enable-maintainer-mode"};
-
- unless (exists $args{"disable-perl-glue"}) {
- $opts .= "--enable-perl-glue ";
- test_prereq "mod_perl";
- test_prereq "Apache::Test";
- test_prereq "ExtUtils::MakeMaker";
- test_prereq "ExtUtils::XSBuilder";
- test_prereq "Test::More";
- }
-
- delete @[EMAIL PROTECTED];
- $args{"with-apache2-apxs"} = delete $args{apxs}
- if exists $args{apxs} and not exists $args{"with-apache2-apxs"};
-
- $args{"with-perl-opts"} = "@ARGV" if @ARGV;
-
$opts .= join " ", map {qq/--$_="$args{$_}"/} keys %args;
my $cmd = "./configure $opts";
Modified: httpd/apreq/trunk/win32/Configure.pl
URL:
http://svn.apache.org/viewcvs/httpd/apreq/trunk/win32/Configure.pl?rev=164514&r1=164513&r2=164514&view=diff
==============================================================================
--- httpd/apreq/trunk/win32/Configure.pl (original)
+++ httpd/apreq/trunk/win32/Configure.pl Sun Apr 24 19:05:28 2005
@@ -32,8 +32,6 @@
my $doxysearch = which('doxysearch');
my $cfg = $debug ? 'Debug' : 'Release';
-check_depends();
-
my @tests = qw(cookie parsers params version);
my @test_files = map {catfile('library', 't', "$_.t")} @tests;
generate_tests($apreq_home, [EMAIL PROTECTED]);
@@ -317,29 +315,6 @@
print $def $preamble;
print $def $_, "\n" for (sort keys %fns);
close $def;
-}
-
-sub check_depends {
- my $rep = $] < 5.008 ?
- 'http://theoryx5.uwinnipeg.ca/ppmpackages' :
- 'http://theoryx5.uwinnipeg.ca/ppms';
- eval {require Apache2;};
- for my $mod (qw(ExtUtils::XSBuilder Apache::Test)) {
- eval "require $mod";
- if ($@) {
- if ($] < 5.008 and $mod eq 'ExtUtils::XSBuilder') {
- warn "Perl 5.8 or higher is required for the Perl glue\n";
- next;
- }
- print "I could not find $mod. ";
- my $ans = prompt('Would you like to install it?', 'yes');
- next unless $ans =~ /^y/i;
- (my $ppd = $mod) =~ s!(\w+)::(\w+)!$1-$2.ppd!;
- my @args = ('ppm', 'install', "$rep/$ppd");
- system(@args) == 0
- or warn "system @args failed: $?";
- }
- }
}
sub generate_tests {