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/06/16 01:11:47 UTC

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

randyk      2003/06/15 16:11:47

  Modified:    win32    Configure.pl
  Log:
  - add docs Makefile target if doxygen present
  - run initialization of xsbuilder
  - use libs, rather than Release/Debug, for target directory
  
  Revision  Changes    Path
  1.3       +66 -7     httpd-apreq-2/win32/Configure.pl
  
  Index: Configure.pl
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/win32/Configure.pl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Configure.pl	10 May 2003 01:11:18 -0000	1.2
  +++ Configure.pl	15 Jun 2003 23:11:47 -0000	1.3
  @@ -2,6 +2,8 @@
   use strict;
   use warnings;
   use Getopt::Long;
  +require File::Spec;
  +require Win32;
   my ($apache, $debug, $help);
   my $result = GetOptions( 'with-apache=s' => \$apache,
   			 'debug' => \$debug,
  @@ -13,7 +15,23 @@
   check($apache);
   $apache =~ s!/!\\!g;
   
  +my @path_ext;
  +path_ext();
  +my $doxygen = which('doxygen');
   my $cfg = $debug ? 'Debug' : 'Release';
  +
  +eval {require ExtUtils::XSBuilder;};
  +if ($@) {
  +    warn "ExtUtils::XSBuilder must be installed for Perl glue\n";
  +}
  +else {
  +    my @args = ($^X, '../../build/xsbuilder.pl', 'run', 'run');
  +    chdir '../glue/perl';
  +    system(@args) == 0 or die "system @args failed: $!";
  +    chdir '../../win32';
  +}
  +
  +
   open my $make, '>Makefile' or die qq{Cannot open Makefile: $!};
   print $make <<"END";
   # Microsoft Developer Studio Generated NMAKE File.
  @@ -23,8 +41,21 @@
   END
   
   print $make $_ while (<DATA>);
  +
  +if ($doxygen) {
  +    print $make <<"END";
  +
  +docs: 
  +	cd ..
  +	"$doxygen" build\\doxygen.conf
  +	cd win32
  +
  +END
  +}
  +
   close $make;
   
  +
   print << 'END';
   
   A Makefile has been generated. You can now run
  @@ -34,9 +65,13 @@
     nmake mod_apreq     - builds mod_apreq
     nmake libapreq_cgi  - builds libapreq_cgi
     nmake clean         - clean
  -
   END
  +    if ($doxygen) {
  +print << 'END';
  +  nmake docs          - build documents
   
  +END
  +}
   
   sub usage {
       print <<'END';
  @@ -87,8 +122,6 @@
   
   END
       }
  -
  -    require Win32;
       return Win32::GetShortPathName($apache);
   }
   
  @@ -104,6 +137,31 @@
       return 1;
   }
   
  +sub path_ext {
  +    if ($ENV{PATHEXT}) {
  +        push @path_ext, split ';', $ENV{PATHEXT};
  +        for my $ext (@path_ext) {
  +            $ext =~ s/^\.*(.+)$/$1/;
  +        }
  +    }
  +    else {
  +        #Win9X: doesn't have PATHEXT
  +        push @path_ext, qw(com exe bat);
  +    }
  +}
  +
  +sub which {
  +    my $program = shift;
  +    return undef unless $program;
  +    my @a = map {File::Spec->catfile($_, $program) } File::Spec->path();
  +    for my $base(@a) {
  +        return $base if -x $base;
  +        for my $ext (@path_ext) {
  +            return "$base.$ext" if -x "$base.$ext";
  +        }
  +    }
  +}
  +
   __DATA__
   
   
  @@ -140,11 +198,11 @@
   !ENDIF 
   
   !IF  "$(CFG)" == "Release"
  -INTDIR=.\Release
  -OUTDIR=.\Release
  +INTDIR=.\libs
  +OUTDIR=.\libs
   !ELSE
  -INTDIR=.\Debug
  -OUTDIR=.\Debug
  +INTDIR=.\libs
  +OUTDIR=.\libs
   !ENDIF
   
   ALL : "$(LIBAPREQ)"
  @@ -160,6 +218,7 @@
   
   TEST: $(LIBAPREQ)
   	$(MAKE) /nologo /f $(TESTALL).mak CFG="$(TESTALL) - Win32 $(CFG)" APACHE="$(APACHE)"
  +        set PATH=%PATH%;$(APACHE)\bin
   	cd $(INTDIR) && $(TESTALL).exe -v
   
   $(MOD): $(LIBAPREQ)