Return-Path: Delivered-To: apmail-httpd-apreq-cvs-archive@www.apache.org Received: (qmail 27859 invoked from network); 5 Nov 2003 05:32:07 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Nov 2003 05:32:07 -0000 Received: (qmail 24674 invoked by uid 500); 5 Nov 2003 05:31:55 -0000 Delivered-To: apmail-httpd-apreq-cvs-archive@httpd.apache.org Received: (qmail 24657 invoked by uid 500); 5 Nov 2003 05:31:55 -0000 Mailing-List: contact apreq-cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: apreq-dev@httpd.apache.org List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list apreq-cvs@httpd.apache.org Received: (qmail 24643 invoked by uid 500); 5 Nov 2003 05:31:55 -0000 Delivered-To: apmail-httpd-apreq-2-cvs@apache.org Received: (qmail 24639 invoked from network); 5 Nov 2003 05:31:55 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 5 Nov 2003 05:31:55 -0000 Received: (qmail 27856 invoked by uid 1220); 5 Nov 2003 05:32:06 -0000 Date: 5 Nov 2003 05:32:06 -0000 Message-ID: <20031105053206.27855.qmail@minotaur.apache.org> From: randyk@apache.org To: httpd-apreq-2-cvs@apache.org Subject: cvs commit: httpd-apreq-2/win32 Configure.pl X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N randyk 2003/11/04 21:32:06 Modified: win32 Configure.pl Log: For Win32, provide some dependency checks: - perl 5.8 or higher is required to build the perl glue (on Win32) - check for Apache::Test and ExtUtils::XSBuilder, and offer to install it if not found Revision Changes Path 1.25 +29 -11 httpd-apreq-2/win32/Configure.pl Index: Configure.pl =================================================================== RCS file: /home/cvs/httpd-apreq-2/win32/Configure.pl,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- Configure.pl 30 Oct 2003 02:22:18 -0000 1.24 +++ Configure.pl 5 Nov 2003 05:32:06 -0000 1.25 @@ -30,17 +30,13 @@ my $doxygen = which('doxygen'); my $cfg = $debug ? 'Debug' : 'Release'; -unless ($no_perl) { - eval {require ExtUtils::XSBuilder;}; - if ($@) { - warn "ExtUtils::XSBuilder must be installed for Perl glue\n"; - } - else { - my @args = ($^X, "$apreq_home/build/xsbuilder.pl", 'run', 'run'); - chdir "$apreq_home/glue/perl"; - system(@args) == 0 or die "($apreq_home ) system @args failed: $?"; - chdir $apreq_home; - } +check_depends(); + +if (not $no_perl and $] >= 5.008) { + my @args = ($^X, "$apreq_home/build/xsbuilder.pl", 'run', 'run'); + chdir "$apreq_home/glue/perl"; + system(@args) == 0 or die "system @args failed: $?"; + chdir $apreq_home; } open(my $make, '>Makefile') or die qq{Cannot open Makefile: $!}; @@ -294,6 +290,28 @@ 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'; + 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 fetch_apxs {