From 3678273b25c0e83e822ad981354ebf5d5d11990f Mon Sep 17 00:00:00 2001 From: Benoit Sigoure Date: Thu, 1 Nov 2007 20:03:05 +0100 Subject: [PATCH] Fix the testsuite to preserve the various arguments of configure. * build-aux/boost.m4 (BOOST_REQUIRE): Define DISTCHECK_CONFIGURE_FLAGS to automatically preserve the --with-boost argument. * configure.ac: Use AC_CANONICAL_HOST. (AC_CONFIG_FILES): Generate tests/package.m4. * tests/Makefile.am (EXTRA_DIST, $(TESTSUITE)): Adjust. No longer need to generate package.m4 since it's now generated from package.m4.in. * tests/atlocal.in (CXX, LD, CONFIGURE_FLAGS, build, host): New. * tests/package.m4.in: New. * tests/testsuite.at: Invoke configure with the proper flags (that is, preserve the original configuration). Signed-off-by: Benoit Sigoure --- ChangeLog | 16 ++++++++++++++++ build-aux/.gitignore | 2 ++ build-aux/boost.m4 | 2 ++ configure.ac | 3 +++ tests/.gitignore | 1 - tests/Makefile.am | 14 ++------------ tests/atlocal.in | 5 +++++ tests/{atlocal.in => package.m4.in} | 11 ++++++----- tests/testsuite.at | 4 +++- 9 files changed, 39 insertions(+), 19 deletions(-) copy tests/{atlocal.in => package.m4.in} (69%) diff --git a/ChangeLog b/ChangeLog index a7a1b16..8891716 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,21 @@ 2007-11-01 Benoit Sigoure + Fix the testsuite to preserve the various arguments of configure. + * build-aux/boost.m4 (BOOST_REQUIRE): Define + DISTCHECK_CONFIGURE_FLAGS to automatically preserve the --with-boost + argument. + * configure.ac: Use AC_CANONICAL_HOST. + (AC_CONFIG_FILES): Generate tests/package.m4. + * tests/Makefile.am (EXTRA_DIST, $(TESTSUITE)): Adjust. + No longer need to generate package.m4 since it's now generated from + package.m4.in. + * tests/atlocal.in (CXX, LD, CONFIGURE_FLAGS, build, host): New. + * tests/package.m4.in: New. + * tests/testsuite.at: Invoke configure with the proper flags (that + is, preserve the original configuration). + +2007-11-01 Benoit Sigoure + Add a README. * README: New. * build-aux/boost.m4: Advertise the Git repository. diff --git a/build-aux/.gitignore b/build-aux/.gitignore index 490f325..7b308a5 100644 --- a/build-aux/.gitignore +++ b/build-aux/.gitignore @@ -1,2 +1,4 @@ missing install-sh +config.guess +config.sub diff --git a/build-aux/boost.m4 b/build-aux/boost.m4 index 719c245..4afd8a8 100644 --- a/build-aux/boost.m4 +++ b/build-aux/boost.m4 @@ -71,6 +71,8 @@ m4_bmatch([$1], AC_ARG_WITH([boost], [AS_HELP_STRING([--with-boost=DIR], [prefix of Boost]BOOST_VERSION_REQ[ @<:@guess@:>@])])dnl +AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], + ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"]) AC_CACHE_CHECK([for Boost headers[]BOOST_VERSION_REQ], [boost_cv_inc_path], [boost_cv_inc_path=no diff --git a/configure.ac b/configure.ac index 74ac369..15b3967 100644 --- a/configure.ac +++ b/configure.ac @@ -18,6 +18,8 @@ AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([foreign]) +AC_CANONICAL_HOST + AC_PROG_GREP AC_PROG_EGREP AC_PROG_CXX @@ -33,6 +35,7 @@ AC_CONFIG_FILES([ Makefile tests/Makefile tests/atlocal + tests/package.m4 ]) AC_OUTPUT diff --git a/tests/.gitignore b/tests/.gitignore index 390ceba..e7895a9 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,2 +1 @@ testsuite -package.m4 diff --git a/tests/Makefile.am b/tests/Makefile.am index fd88a41..0532b4b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,20 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -EXTRA_DIST = testsuite.at $(TESTSUITE) atlocal.in package.m4 +EXTRA_DIST = testsuite.at $(TESTSUITE) atlocal.in package.m4.in TESTSUITE = $(srcdir)/testsuite CLEANFILES = atconfig -$(srcdir)/package.m4: Makefile.in - { \ - echo '# Signature of the current package.'; \ - echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \ - echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \ - echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \ - echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \ - echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \ - } >$(srcdir)/package.m4 - check-local: atconfig atlocal $(TESTSUITE) $(SHELL) $(TESTSUITE) $(TESTSUITEFLAGS) @@ -40,7 +30,7 @@ clean-local: AUTOTEST = $(AUTOM4TE) --language=autotest -$(TESTSUITE): $(srcdir)/package.m4 $(srcdir)/testsuite.at +$(TESTSUITE): package.m4 $(srcdir)/testsuite.at $(AUTOTEST) -I '$(srcdir)' $@.at -o $@.tmp mv $@.tmp $@ diff --git a/tests/atlocal.in b/tests/atlocal.in index 82fb1ad..0908a6d 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -18,3 +18,8 @@ GREP='@GREP@' EGREP='@EGREP@' abs_top_srcdir='@abs_top_srcdir@' +CXX='@CXX@' +LD='@LD@' +CONFIGURE_FLAGS='@DISTCHECK_CONFIGURE_FLAGS@' +build='@build@' +host='@host@' diff --git a/tests/atlocal.in b/tests/package.m4.in similarity index 69% copy from tests/atlocal.in copy to tests/package.m4.in index 82fb1ad..e66faa9 100644 --- a/tests/atlocal.in +++ b/tests/package.m4.in @@ -1,5 +1,3 @@ -# -*- shell-script -*- vi:set ft=sh: -# @configure_input@ # Copyright (C) 2007 Benoit Sigoure # # This program is free software: you can redistribute it and/or modify @@ -15,6 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -GREP='@GREP@' -EGREP='@EGREP@' -abs_top_srcdir='@abs_top_srcdir@' +# Signature of the current package. +m4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@]) +m4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@]) +m4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@]) +m4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@]) +m4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@]) diff --git a/tests/testsuite.at b/tests/testsuite.at index 4ed3f22..56618c9 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -123,7 +123,9 @@ m4_define([AT_CHECK_AUTOCONF], # Using --srcdir is more expensive. m4_define([AT_CHECK_CONFIGURE], [AT_CAPTURE_FILE([config.log])[]dnl - AT_CHECK([top_srcdir=$abs_top_srcdir ./configure $1], + AT_CHECK([top_srcdir=$abs_top_srcdir \ + ./configure --host=$host --build=$build \ + $CONFIGURE_FLAGS "CXX=$CXX" "LD=$LD" $1], [$2], m4_default([$3], [ignore]), [$4])]) -- 2.11.4.GIT