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 23:51:57 UTC
cvs commit: httpd-apreq-2/build version_check.pl
joes 2003/10/27 14:51:57
Modified: . INSTALL acinclude.m4 buildconf configure.ac
build version_check.pl
Log:
Add rest of version tests to version_check.pl, making that script the final word on which tool versions are required.
Revision Changes Path
1.9 +0 -1 httpd-apreq-2/INSTALL
Index: INSTALL
===================================================================
RCS file: /home/cvs/httpd-apreq-2/INSTALL,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- INSTALL 18 Oct 2003 21:03:06 -0000 1.8
+++ INSTALL 27 Oct 2003 22:51:57 -0000 1.9
@@ -9,7 +9,6 @@
perl 5.6.1
mod_perl-2 1.99_9-dev
ExtUtils::XSBuilder 0.23
- Devel::Peek 1.00
Documentation (CVS):
doxygen 1.3
1.12 +26 -1 httpd-apreq-2/acinclude.m4
Index: acinclude.m4
===================================================================
RCS file: /home/cvs/httpd-apreq-2/acinclude.m4,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- acinclude.m4 17 Oct 2003 06:27:20 -0000 1.11
+++ acinclude.m4 27 Oct 2003 22:51:57 -0000 1.12
@@ -1,4 +1,5 @@
AC_DEFUN(AC_APREQ, [
+
AC_ARG_ENABLE(perl_glue,
AC_HELP_STRING([--enable-perl-glue],[build perl modules Apache::Request and Apache::Cookie]),
[PERL_GLUE=$enableval],[PERL_GLUE="no"])
@@ -32,13 +33,37 @@
APACHE2_HTTPD=`$APACHE2_APXS -q BINDIR`/httpd
APR_CONFIG=`$APACHE2_APXS -q APR_BINDIR`/apr-config
APU_CONFIG=`$APACHE2_APXS -q APU_BINDIR`/apu-config
-
+
+ if test -z "`$PERL build/version_check.pl apache2 $APACHE2_HTTPD`"; then
+ AC_MSG_ERROR([Bad apache2 version])
+ fi
fi
AC_CHECK_FILE([$APR_CONFIG],,
AC_MSG_ERROR([invalid apr-config location- did you forget to configure apr?]))
+
+ if test -z "`$PERL build/version_check.pl apr $APR_CONFIG`"; then
+ AC_MSG_ERROR([Bad libapr version])
+ fi
+
AC_CHECK_FILE([$APU_CONFIG],,
AC_MSG_ERROR([invalid apu-config location- did you forget to configure apr-util?]))
+
+ if test -z "`$PERL build/version_check.pl apu $APU_CONFIG`"; then
+ AC_MSG_ERROR([Bad libaprutil version])
+ fi
+
+ if test "x$PERL_GLUE" != "xno"; then
+ if test -z "`$PERL build/version_check.pl perl $PERL`"; then
+ AC_MSG_ERROR([Bad perl version])
+ fi
+ if test -z "`$PERL build/version_check.pl xsbuilder`"; then
+ AC_MSG_ERROR([Bad xsbuilder version])
+ fi
+ if test -z "`$PERL build/version_check.pl mp2`"; then
+ AC_MSG_ERROR([Bad modperl-2 version])
+ fi
+ fi
AC_CONFIG_COMMANDS_POST([test "x$PERL_GLUE" != "xno" &&
(cd glue/perl && $PERL ../../build/xsbuilder.pl run)],
1.5 +3 -4 httpd-apreq-2/buildconf
Index: buildconf
===================================================================
RCS file: /home/cvs/httpd-apreq-2/buildconf,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- buildconf 27 Oct 2003 18:52:48 -0000 1.4
+++ buildconf 27 Oct 2003 22:51:57 -0000 1.5
@@ -8,10 +8,9 @@
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
-
+perl build/version_check.pl libtool || exit 1
+perl build/version_check.pl autoconf || exit 1
+perl build/version_check.pl automake || exit 1
libtool="libtoolize --automake --copy --force"
echo "running $libtool" && $libtool && \
1.10 +2 -3 httpd-apreq-2/configure.ac
Index: configure.ac
===================================================================
RCS file: /home/cvs/httpd-apreq-2/configure.ac,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- configure.ac 17 Oct 2003 16:56:27 -0000 1.9
+++ configure.ac 27 Oct 2003 22:51:57 -0000 1.10
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
-AC_PREREQ(2.13)
-AC_INIT(libapreq - Apache Request Library, 2.0-dev, apreq-dev@httpd.apache.org, libapreq2)
+AC_PREREQ(2.53)
+AC_INIT(libapreq - Apache Request Library, 2.0.1-dev, apreq-dev@httpd.apache.org, libapreq2)
dnl this:
dnl AC_CONFIG_AUX_DIR(build)
@@ -24,7 +24,6 @@
dnl Checks for header files.
AM_CONFIG_HEADER(src/apreq_config.h)
dnl Checks for typedefs, structures, and compiler characteristics.
-
dnl Checks for library functions.
AC_APREQ
1.2 +50 -27 httpd-apreq-2/build/version_check.pl
Index: version_check.pl
===================================================================
RCS file: /home/cvs/httpd-apreq-2/build/version_check.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- version_check.pl 27 Oct 2003 18:52:48 -0000 1.1
+++ version_check.pl 27 Oct 2003 22:51:57 -0000 1.2
@@ -1,36 +1,59 @@
-#! 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 $usage = "Usage: version_check.pl tool version_string [path/to/tool]";
+die "$usage: arguments needed." unless @ARGV;
+my ($tool, $path) = @ARGV;
+$path = $tool unless defined $path;
+
+sub exe_version { scalar qx/$path -v/ }
+sub gnu_version { scalar qx/$path --version / }
+
+sub xsb_version {
+ package ExtUtils::XSBuilder;
+ require ExtUtils::XSBuilder;
+ return our $VERSION;
+}
+sub mp2_version {
+ eval {
+ require Apache2;
+ require mod_perl;
+ $mod_perl::VERSION;
+ } or do {
+ require mod_perl;
+ $mod_perl::VERSION;
+ };
+}
+
+my %prereq = (
+ libtool => { test => \&gnu_version, version => "1.4.2" },
+ autoconf => { test => \&gnu_version, version => "2.53" },
+ automake => { test => \&gnu_version, version => "1.6.3" },
+ apache2 => { test => \&exe_version, version => "2.0.46"},
+ apr => { test => \&gnu_version, version => "0.9.4" },
+ apu => { test => \&gnu_version, version => "0.9.4" },
+ perl => { test => \&gnu_version, version => "5.6.1" },
+ xsbuilder => { test => \&xsb_version, version => "0.23" },
+ mp2 => { test => \&mp2_version, version => "1.9909"},
+ doxygen => { test => \&gnu_version, version => "1.3" },
+ );
+
+die "$0 failed: unknown tool '$tool'." unless $prereq{$tool};
+my $version = $prereq{$tool}->{version};
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).
+$_ = $prereq{$tool}->{test}->();
+die "$0 failed: no version_string found in '$_'.\n" unless /(\d[.\d]+)/;
+my $saw = $1;
+my @saw = split /\./, $saw;
+$_ = 0 for @saw[@saw .. $#version]; # ensure @saw has enough entries
+for (0.. $#version) {
+ last if $version[$_] < $saw[$_];
+ die <<EOM if $version[$_] > $saw[$_];
+$0 failed: $tool version $saw unsupported ($version or greater is required).
EOM
- }
}
-
+print "$tool: $saw ok\n";
exit 0;