# HG changeset patch # User Ralf Wildenhues # Date 1163325196 0 # Node ID 581c011e05d6fdfab188e7015926e45a1916e1b0 # Parent 7ccd6c4861d4c472650ed4c550493f64d5652661 * gnulib-tool (func_create_testdir): Fix replacement of `build-aux' in configure.ac. Run autotools in gltests subdirectory. (func_create_testdir, func_create_megatestdir, test): There is no need for '--force' in most autotool invocations in a new tree. Actually fail the whole test if any of the tools, or the configure or make stages fail. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2006-11-12 Ralf Wildenhues + * gnulib-tool (func_create_testdir): Fix replacement of + `build-aux' in configure.ac. Run autotools in gltests + subdirectory. + (func_create_testdir, func_create_megatestdir, test): There is + no need for '--force' in most autotool invocations in a new + tree. Actually fail the whole test if any of the tools, or the + configure or make stages fail. + Sync from Automake. * build-aux/gnupload: Revert last change. Add pointer to upload instructions of the GNU Maintenance Instructions. diff --git a/gnulib-tool b/gnulib-tool --- a/gnulib-tool +++ b/gnulib-tool @@ -22,7 +22,7 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2006-11-06 13:04:37 $' +cvsdatestamp='$Date: 2006-11-12 09:53:16 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` nl=' @@ -2294,17 +2294,13 @@ # expansion total). echo "AC_DEFUN([gl_INIT], [" func_emit_initmacro_start - if test "$auxdir" != "build-aux"; then - sed_replace_build_aux=' - :a - /AC_CONFIG_FILES(.*:build-aux\/.*)/{ - s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:../'"$auxdir"'/\2)| - ba - }' - sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'` - else - sed_replace_build_aux= - fi + sed_replace_build_aux=' + :a + /AC_CONFIG_FILES(.*:build-aux\/.*)/{ + s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:../'"$auxdir"'/\2)| + ba + }' + sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'` # We don't have explicit ordering constraints between the various # autoconf snippets. It's cleanest to put those of the library before # those of the tests. @@ -2463,33 +2459,59 @@ # autopoint, which brings in older versions of some of our .m4 files. if test -f $m4base/gettext.m4; then echo "executing ${AUTOPOINT} --force" - ${AUTOPOINT} --force + ${AUTOPOINT} --force || func_exit 1 for f in $m4base/*.m4~; do - mv $f `echo $f | sed -e 's,~$,,'` + mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 done fi - echo "executing ${ACLOCAL} --force -I $m4base" - ${ACLOCAL} --force -I $m4base + echo "executing ${ACLOCAL} -I $m4base" + ${ACLOCAL} -I $m4base || func_exit 1 if ! test -d build-aux; then echo "executing mkdir build-aux" - mkdir build-aux + mkdir build-aux || func_exit 1 fi - echo "executing ${AUTOCONF} --force" - ${AUTOCONF} --force - echo "executing ${AUTOHEADER} --force" - ${AUTOHEADER} --force - echo "executing ${AUTOMAKE} --add-missing --copy --force-missing" - ${AUTOMAKE} --add-missing --copy --force-missing - ) + echo "executing ${AUTOCONF}" + ${AUTOCONF} || func_exit 1 + echo "executing ${AUTOHEADER}" + ${AUTOHEADER} || func_exit 1 + echo "executing ${AUTOMAKE} --add-missing --copy" + ${AUTOMAKE} --add-missing --copy || func_exit 1 + ) || func_exit 1 + if test -n "$inctests"; then + # Create autogenerated files. + (cd "$testdir/$testsbase" || func_exit 1 + # Do not use "${AUTORECONF} --force --install", because it may invoke + # autopoint, which brings in older versions of some of our .m4 files. + if test -f ../$m4base/gettext.m4; then + echo "executing ${AUTOPOINT} --force" + ${AUTOPOINT} --force || func_exit 1 + for f in ../$m4base/*.m4~; do + mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 + done + fi + echo "executing ${ACLOCAL} -I ../$m4base" + ${ACLOCAL} -I ../$m4base || func_exit 1 + if ! test -d ../build-aux; then + echo "executing mkdir ../build-aux" + mkdir ../build-aux + fi + echo "executing ${AUTOCONF}" + ${AUTOCONF} || func_exit 1 + echo "executing ${AUTOHEADER}" + ${AUTOHEADER} || func_exit 1 + echo "executing ${AUTOMAKE} --add-missing --copy" + ${AUTOMAKE} --add-missing --copy || func_exit 1 + ) || func_exit 1 + fi if grep '^BUILT_SOURCES *+=' "$testdir/$sourcebase/Makefile.am" > /dev/null; then (cd "$testdir" - ./configure + ./configure || func_exit 1 cd "$sourcebase" echo 'built_sources: $(BUILT_SOURCES)' >> Makefile - make built_sources + make built_sources || func_exit 1 cd .. - make distclean - ) + make distclean || func_exit 1 + ) || func_exit 1 fi } @@ -2546,14 +2568,14 @@ # recursively, but the subdirectories are already finished, therefore # calling autoreconf here would only waste lots of CPU time. echo "executing ${ACLOCAL}" - ${ACLOCAL} + ${ACLOCAL} || func_exit 1 echo "executing mkdir build-aux" mkdir build-aux echo "executing ${AUTOCONF}" - ${AUTOCONF} + ${AUTOCONF} || func_exit 1 echo "executing ${AUTOMAKE} --add-missing --copy" - ${AUTOMAKE} --add-missing --copy - ) + ${AUTOMAKE} --add-missing --copy || func_exit 1 + ) || func_exit 1 } case $mode in @@ -2722,10 +2744,10 @@ cd "$destdir" mkdir build cd build - ../configure - make - make check - make distclean + ../configure || func_exit 1 + make || func_exit 1 + make check || func_exit 1 + make distclean || func_exit 1 remaining=`find . -type f -print` if test -n "$remaining"; then echo "Remaining files:" $remaining 1>&2