You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by ra...@apache.org on 2003/11/05 06:32:06 UTC

cvs commit: httpd-apreq-2/win32 Configure.pl

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 {