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 jo...@apache.org on 2003/10/27 19:52:48 UTC

cvs commit: httpd-apreq-2/t testall.c

joes        2003/10/27 10:52:48

  Modified:    .        buildconf
               t        testall.c
  Added:       build    version_check.pl
  Log:
  Add version_check.pl script, and version checks to buildconf.  Also add missing include to testall.c.
  
  Revision  Changes    Path
  1.4       +6 -0      httpd-apreq-2/buildconf
  
  Index: buildconf
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/buildconf,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- buildconf	17 Oct 2003 16:56:27 -0000	1.3
  +++ buildconf	27 Oct 2003 18:52:48 -0000	1.4
  @@ -7,6 +7,12 @@
   rm -f generated_lists
   rm -rf autom4te*.cache
   
  +echo "checking buildconf prereqs";
  +perl build/version_check.pl libtool 1.4.2  || exit 1
  +perl build/version_check.pl autoconf 2.53  || exit 1
  +perl build/version_check.pl automake 1.6.3 || exit 1
  +
  +
   libtool="libtoolize --automake --copy --force"
   echo "running $libtool" && $libtool && \
   echo "running aclocal"  && aclocal && \
  
  
  
  1.1                  httpd-apreq-2/build/version_check.pl
  
  Index: version_check.pl
  ===================================================================
  #! perl
  # version_check.pl tool version
  use strict;
  use warnings 'FATAL';
  
  my %vstring = (
                  libtool => sub { scalar qx/libtool --version/ },
                 autoconf => sub {scalar qx/autoconf --version/ },
                 automake => sub {scalar qx/automake --version/ },
  );
  
  my $usage = "Usage: version_check.pl tool version_string";
  
  die "$usage: exactly two arguments are required." unless @ARGV == 2;
  my ($tool, $version) = @ARGV;
  my $test = $vstring{$tool};
  die "$usage: tool '$tool' (first argument) is unsupported." unless $test;
  die <<EOM unless $version =~ /^\d[.\d]*$/;
  $usage: version_string '$version' (second argument) must match /^\d+[.\d]*$/
  EOM
  my @version = split /\./, $version;
  
  for ($test->()) {
      die "$0 failed: no version_string found in '$_'." unless /(\d[.\d]+)/;
      my $saw = $1;
      my @saw = split /\./, $saw;
      $_ = 0 for @saw[@saw .. $#version]; # ensure @saw has enough entries
      for (0.. $#version) {
          exit 0 if $version[$_] < $saw[$_];
          die <<EOM if $version[$_] > $saw[$_];
  $0 failed: $tool version $saw is not supported ($version or greater is required).
  EOM
      }
  }
  
  exit 0;
  
  
  
  1.10      +1 -0      httpd-apreq-2/t/testall.c
  
  Index: testall.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/t/testall.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- testall.c	27 Oct 2003 03:07:28 -0000	1.9
  +++ testall.c	27 Oct 2003 18:52:48 -0000	1.10
  @@ -57,6 +57,7 @@
   
   #include "test_apreq.h"
   #include "apreq_env.h"
  +#include "apr_strings.h"
   
   /* Top-level pool which can be used by tests. */
   apr_pool_t *p;