* Ralf Wildenhues wrote on Sun, Oct 02, 2005 at 11:46:55AM CEST: > > * Makefile.am (BUILDCHECK_ENVIRONMENT) > (INSTALLCHECK_ENVIRONMENT): New macros. > (check-local, installcheck-local): Use them. > * tests/testsuite.at (PREPARE_TESTS): Extract host_alias, ECHO. > Set configure_options appropriately. > (LT_AT_CONFIGURE, LT_AT_AUTORECONF, LT_AT_MAKE): New macros. > (LT_AT_BOOTSTRAP): Use them. > * tests/am-subdir.at, tests/early-libtool.at, > tests/old-m4-iface.at, tests/standalone.at: Likewise. > * tests/link-order.test: Do not extract ECHO any more.
Applied to HEAD. Minor change: Add `-e' to $MAKE invocation so that the environment variables set previously do actually override the macro settings. Cheers, Ralf Index: Makefile.am =================================================================== RCS file: /cvsroot/libtool/libtool/Makefile.am,v retrieving revision 1.168 diff -u -r1.168 Makefile.am --- Makefile.am 30 Sep 2005 16:00:21 -0000 1.168 +++ Makefile.am 5 Oct 2005 08:57:25 -0000 @@ -492,6 +492,9 @@ FC="$(FC)" FCFLAGS="$(FCFLAGS)" \ GCJ="$(GCJ)" GCJFLAGS="$(GCJFLAGS)" +BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" +INSTALLCHECK_ENVIRONMENT = + check-recursive: $(srcdir)/$(TESTSUITE) # Use `$(srcdir)' for the benefit of non-GNU makes: this is @@ -520,12 +523,12 @@ # Hook the test suite into the check rule check-local: tests/atconfig $(srcdir)/$(TESTSUITE) $(CD_TESTDIR); \ - $(TESTS_ENVIRONMENT) $(SHELL) $$abs_srcdir/$(TESTSUITE) $(TESTSUITE_FLAGS) + $(TESTS_ENVIRONMENT) $(BUILDCHECK_ENVIRONMENT) $(SHELL) $$abs_srcdir/$(TESTSUITE) $(TESTSUITE_FLAGS) # Run the test suite on the *installed* tree. installcheck-local: $(CD_TESTDIR); \ - $(TESTS_ENVIRONMENT) $(SHELL) $$abs_srcdir/$(TESTSUITE) $(TESTSUITE_FLAGS) AUTOTEST_PATH=$(exec_prefix)/bin + $(TESTS_ENVIRONMENT) $(INSTALLCHECK_ENVIRONMENT) $(SHELL) $$abs_srcdir/$(TESTSUITE) $(TESTSUITE_FLAGS) AUTOTEST_PATH=$(exec_prefix)/bin # We need to remove any file droppings left behind by testsuite clean-local: clean-local-legacy Index: tests/am-subdir.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/am-subdir.at,v retrieving revision 1.6 diff -u -r1.6 am-subdir.at --- tests/am-subdir.at 12 Sep 2005 16:24:38 -0000 1.6 +++ tests/am-subdir.at 5 Oct 2005 08:57:25 -0000 @@ -74,7 +74,7 @@ ]]) LT_AT_BOOTSTRAP -"${MAKE-make}" +LT_AT_MAKE LT_AT_EXEC_CHECK([subdir/subdemo], 0, expout) AT_CLEANUP @@ -149,7 +149,7 @@ ]]) LT_AT_BOOTSTRAP -"${MAKE-make}" +LT_AT_MAKE LT_AT_EXEC_CHECK([subdir/subdemo], 0) AT_CLEANUP Index: tests/early-libtool.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/early-libtool.at,v retrieving revision 1.5 diff -u -r1.5 early-libtool.at --- tests/early-libtool.at 29 Sep 2005 18:00:06 -0000 1.5 +++ tests/early-libtool.at 5 Oct 2005 08:57:25 -0000 @@ -102,11 +102,11 @@ _EOF chmod a+x missing -test -f ltmain.sh || LT_AT_LIBTOOLIZE([--copy --verbose --install]) -test -f aclocal.m4 || $ACLOCAL -I m4 || exit 1 -test -f configure || $AUTOCONF --force || exit 1 -test -f Makefile || ./configure || exit 1 -${MAKE-make} +LT_AT_LIBTOOLIZE([--copy --verbose --install]) +LT_AT_ACLOCAL([-I m4]) +LT_AT_AUTOCONF([--force]) +LT_AT_CONFIGURE +LT_AT_MAKE LT_AT_EXEC_CHECK([./hell], [0], [expout]) @@ -206,11 +206,11 @@ _EOF chmod a+x missing -test -f ltmain.sh || LT_AT_LIBTOOLIZE([--copy --verbose --install]) -test -f aclocal.m4 || $ACLOCAL -I m4 || exit 1 -test -f configure || $AUTOCONF --force || exit 1 -test -f Makefile || ./configure || exit 1 -${MAKE-make} +LT_AT_LIBTOOLIZE([--copy --verbose --install]) +LT_AT_ACLOCAL([-I m4]) +LT_AT_AUTOCONF([--force]) +LT_AT_CONFIGURE +LT_AT_MAKE LT_AT_EXEC_CHECK([./hell], [0], [expout]) Index: tests/link-order.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/link-order.at,v retrieving revision 1.6 diff -u -r1.6 link-order.at --- tests/link-order.at 23 Sep 2005 16:48:14 -0000 1.6 +++ tests/link-order.at 5 Oct 2005 08:57:25 -0000 @@ -19,7 +19,6 @@ # link-order.test - make sure that library linking order matches AT_SETUP([Link order test.]) -eval `$LIBTOOL --config | grep ECHO=` LDFLAGS="$LDFLAGS -no-undefined" prefix_old=`pwd`/old Index: tests/old-m4-iface.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/old-m4-iface.at,v retrieving revision 1.3 diff -u -r1.3 old-m4-iface.at --- tests/old-m4-iface.at 2 Oct 2005 08:54:03 -0000 1.3 +++ tests/old-m4-iface.at 5 Oct 2005 08:57:25 -0000 @@ -67,7 +67,7 @@ } ]]) -test -f ltmain.sh || LT_AT_LIBTOOLIZE([--install]) +LT_AT_LIBTOOLIZE([--install]) # This is slightly bogus, since only libtool.m4 was required in aclocal.m4 # with libtool-1.5x... @@ -76,9 +76,9 @@ "$macrodir/ltsugar.m4" "$macrodir/ltversion.m4" > aclocal.m4 \ || exit 1 -test -f configure || $AUTOCONF --force || exit 1 -test -f Makefile || ./configure || exit 1 -${MAKE-make} +LT_AT_AUTOCONF([--force]) +LT_AT_CONFIGURE +LT_AT_MAKE LT_AT_EXEC_CHECK([./old], 0, [Hello, World!]) @@ -183,11 +183,11 @@ ]]) touch config.h.in # bug in current ltdl.m4 -test -f ltmain.sh || LT_AT_LIBTOOLIZE([--ltdl --install]) -test -f aclocal.m4 || $ACLOCAL -I libltdl/m4 || exit 1 -test -f configure || $AUTOCONF --force || exit 1 -test -f Makefile || ./configure || exit 1 -${MAKE-make} +LT_AT_LIBTOOLIZE([--ltdl --install]) +LT_AT_ACLOCAL([-I libltdl/m4]) +LT_AT_AUTOCONF([--force]) +LT_AT_CONFIGURE +LT_AT_MAKE LT_AT_EXEC_CHECK([./old], 0, [bar]) Index: tests/standalone.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/standalone.at,v retrieving revision 1.3 diff -u -r1.3 standalone.at --- tests/standalone.at 26 Aug 2005 10:00:18 -0000 1.3 +++ tests/standalone.at 5 Oct 2005 08:57:25 -0000 @@ -26,8 +26,8 @@ AT_SETUP([compiling softlinked libltdl]) LT_AT_LIBTOOLIZE([--ltdl=.]) -./configure -${MAKE-make} +LT_AT_CONFIGURE +LT_AT_MAKE AT_CHECK([test -f libltdlc.la]) @@ -41,8 +41,8 @@ AT_SETUP([compiling copied libltdl]) LT_AT_LIBTOOLIZE([--copy --ltdl=.]) -./configure -${MAKE-make} +LT_AT_CONFIGURE +LT_AT_MAKE AT_CHECK([test -f libltdlc.la]) @@ -58,8 +58,8 @@ prefix=`pwd`/_inst LT_AT_LIBTOOLIZE([--copy --ltdl=.]) -./configure --enable-ltdl-install --prefix=$prefix -${MAKE-make} all install +LT_AT_CONFIGURE([--enable-ltdl-install --prefix=$prefix]) +LT_AT_MAKE([all install]) AT_CHECK([test -f $prefix/lib/libltdl.la]) AT_CHECK([test -f $prefix/include/ltdl.h]) @@ -135,7 +135,7 @@ all: $(TARGETS) $(LIBTOOL) libltdl/libltdlc.la: - cd libltdl && ./configure && $(MAKE) + cd libltdl && ./configure $(CONFIGURE_OPTIONS) && $(MAKE) ltdldemo$(EXEEXT): $(LIBTOOL) module.la libltdl/libltdlc.la main.lo $(LTLINK) -o ltdldemo main.lo -dlopen module.la ./libltdl/libltdlc.la @@ -151,8 +151,9 @@ ]]) LT_AT_LIBTOOLIZE([--copy --ltdl]) -${MAKE-make} CC="$CC" LIBTOOLFLAGS="$LIBTOOLFLAGS" CPPFLAGS="$CPPFLAGS" \ - CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" +LT_AT_MAKE([], [CC="$CC" LIBTOOLFLAGS="$LIBTOOLFLAGS" CPPFLAGS="$CPPFLAGS" \ + CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \ + CONFIGURE_OPTIONS="$configure_options"]) LT_AT_EXEC_CHECK([./ltdldemo], 0, [ignore]) Index: tests/testsuite.at =================================================================== RCS file: /cvsroot/libtool/libtool/tests/testsuite.at,v retrieving revision 1.22 diff -u -r1.22 testsuite.at --- tests/testsuite.at 30 Sep 2005 16:00:23 -0000 1.22 +++ tests/testsuite.at 5 Oct 2005 08:57:25 -0000 @@ -24,17 +24,23 @@ : ${ACLOCAL=aclocal} : ${AUTOHEADER=autoheader} : ${AUTOCONF=autoconf} +: ${AUTOMAKE=automake} : ${AUTORECONF=autoreconf} -export LIBTOOLIZE LIBTOOL ACLOCAL AUTOHEADER AUTOCONF AUTORECONF +export LIBTOOLIZE LIBTOOL ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE AUTORECONF macrodir="$abs_top_srcdir/libltdl/m4" eval `$LIBTOOL --config | grep ^EGREP=` -eval `$LIBTOOL --config | $EGREP '^(host|host_os|build)='` +eval `$LIBTOOL --config | $EGREP '^(host|host_os|host_alias|build|ECHO)='` +configure_options= +if test -n "$host_alias"; then + configure_options="--host $host_alias" +fi m4_divert_pop([PREPARE_TESTS])dnl + # LT_AT_LIBTOOLIZE([ARGS]) # ------------------------ m4_define([LT_AT_LIBTOOLIZE], -[_lt_pkgdatadir="$abs_top_srcdir" "$LIBTOOLIZE" $1 +[$LIBTOOLIZE $1 ]) @@ -46,14 +52,47 @@ ]) +# LT_AT_ACLOCAL([OPTIONS]) +# -------------------------- +m4_define([LT_AT_ACLOCAL], +[AT_CHECK([$ACLOCAL $1], [0], [ignore], [ignore]) +]) + + +# LT_AT_AUTOCONF([OPTIONS]) +# -------------------------- +m4_define([LT_AT_AUTOCONF], +[AT_CHECK([$AUTOCONF $1], [0], [ignore], [ignore]) +]) + + +# LT_AT_AUTORECONF([OPTIONS]) +# -------------------------- +m4_define([LT_AT_AUTORECONF], +[AT_CHECK([$AUTORECONF $1], [0], [ignore], [ignore]) +]) + + +# LT_AT_CONFIGURE([OPTIONS]) +# -------------------------- +m4_define([LT_AT_CONFIGURE], +[AT_CHECK([./configure $configure_options $1], [0], [ignore], [ignore]) +]) + + +# LT_AT_MAKE([TGTS], [VARS]) +# -------------------------- +m4_define([LT_AT_MAKE], +[AT_CHECK([$2 $MAKE -e $1], [0], [ignore], [ignore]) +]) + + # LT_AT_BOOTSTRAP # --------------- m4_define([LT_AT_BOOTSTRAP], -[ -test -f ./ltmain.sh || LT_AT_LIBTOOLIZE([--copy]) -test -f ./configure || _lt_pkgdatadir="$abs_top_srcdir" ${AUTORECONF} --force --verbose --install || exit 1 -test -f ./configure || exit 1 -./configure +[LT_AT_LIBTOOLIZE([--copy]) +LT_AT_AUTORECONF([--force --verbose --install]) +LT_AT_CONFIGURE ])