From: Ralf Wildenhues Date: Sun, 3 May 2009 07:32:44 +0000 (+0200) Subject: Disable test cleanup trap with OSF1/Tru64 sh. X-Git-Tag: v1.11~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9fe8259884e73d48c1962ba69cbb9aa59050b000;p=platform%2Fupstream%2Fautomake.git Disable test cleanup trap with OSF1/Tru64 sh. * configure.ac: Test whether /bin/sh has working 'set -e' in conjunction with an exit trap. Set $am_cv_sh_errexit_works accordingly, substitute sh_errexit_works, and warn about leftover test directories with broken shells like Tru64 /bin/sh. * tests/defs.in: Do not install any traps with broken shells. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 2560eebc9..c8e46894f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-05-03 Ralf Wildenhues + + Disable test cleanup trap with OSF1/Tru64 sh. + * configure.ac: Test whether /bin/sh has working 'set -e' + in conjunction with an exit trap. Set $am_cv_sh_errexit_works + accordingly, substitute sh_errexit_works, and warn about + leftover test directories with broken shells like Tru64 /bin/sh. + * tests/defs.in: Do not install any traps with broken shells. + 2009-05-02 Bruno Haible Ralf Wildenhues diff --git a/Makefile.in b/Makefile.in index 34193e8fc..320635ab3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -210,6 +210,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ +sh_errexit_works = @sh_errexit_works@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ diff --git a/configure b/configure index e73a0bdf9..6fb2ae72a 100755 --- a/configure +++ b/configure @@ -603,6 +603,7 @@ PACKAGE_BUGREPORT='bug-automake@gnu.org' ac_unique_file="automake.in" ac_subst_vars='LTLIBOBJS LIBOBJS +sh_errexit_works FGREP EGREP GREP @@ -2818,6 +2819,32 @@ $as_echo "$ac_cv_path_FGREP" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether /bin/sh has working 'set -e' with exit trap" >&5 +$as_echo_n "checking whether /bin/sh has working 'set -e' with exit trap... " >&6; } +if test "${am_cv_sh_errexit_works+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if /bin/sh -ec "trap 'exit \$?' 0; (exit 77); exit 77"; test $? = 77 +then + am_cv_sh_errexit_works=yes +else + am_cv_sh_errexit_works=no +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $am_cv_sh_errexit_works" >&5 +$as_echo "$am_cv_sh_errexit_works" >&6; } +if test $am_cv_sh_errexit_works = no; then + { $as_echo "$as_me:$LINENO: WARNING: \`${MAKE-make} check' will leave leftover directories tests/*.dir" >&5 +$as_echo "$as_me: WARNING: \`${MAKE-make} check' will leave leftover directories tests/*.dir" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: you can clean them up manually using \`${MAKE-make} clean' or" >&5 +$as_echo "$as_me: WARNING: you can clean them up manually using \`${MAKE-make} clean' or" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: \`cd tests && ${MAKE-make} clean-local-check'" >&5 +$as_echo "$as_me: WARNING: \`cd tests && ${MAKE-make} clean-local-check'" >&2;} + fi +sh_errexit_works=$am_cv_sh_errexit_works + + ac_config_files="$ac_config_files Makefile doc/Makefile lib/Automake/Makefile lib/Automake/tests/Makefile lib/Makefile lib/am/Makefile m4/Makefile tests/Makefile tests/defs" ac_config_files="$ac_config_files tests/aclocal-${APIVERSION}:tests/aclocal.in" diff --git a/configure.ac b/configure.ac index 4229d68e9..e3c853505 100644 --- a/configure.ac +++ b/configure.ac @@ -171,6 +171,23 @@ AC_SUBST([MODIFICATION_DELAY]) AC_PROG_EGREP AC_PROG_FGREP +AC_CACHE_CHECK([whether /bin/sh has working 'set -e' with exit trap], +[am_cv_sh_errexit_works], +[if /bin/sh -ec "trap 'exit \$?' 0; (exit 77); exit 77"; test $? = 77 +then + am_cv_sh_errexit_works=yes +else + am_cv_sh_errexit_works=no +fi +]) +if test $am_cv_sh_errexit_works = no; then + AC_MSG_WARN([`${MAKE-make} check' will leave leftover directories tests/*.dir]) + AC_MSG_WARN([you can clean them up manually using `${MAKE-make} clean' or]) + AC_MSG_WARN([`cd tests && ${MAKE-make} clean-local-check']) + dnl restore font-lock: ` +fi +AC_SUBST([sh_errexit_works], [$am_cv_sh_errexit_works]) + AC_CONFIG_FILES([ Makefile doc/Makefile diff --git a/doc/Makefile.in b/doc/Makefile.in index 189cdfbbf..6433ad82f 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -178,6 +178,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ +sh_errexit_works = @sh_errexit_works@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ diff --git a/lib/Automake/Makefile.in b/lib/Automake/Makefile.in index f6493908f..9a62aa207 100644 --- a/lib/Automake/Makefile.in +++ b/lib/Automake/Makefile.in @@ -197,6 +197,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ +sh_errexit_works = @sh_errexit_works@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in index 222f75117..9f3a097c3 100644 --- a/lib/Automake/tests/Makefile.in +++ b/lib/Automake/tests/Makefile.in @@ -213,6 +213,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ +sh_errexit_works = @sh_errexit_works@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ diff --git a/lib/Makefile.in b/lib/Makefile.in index ee031a9e2..ba470fee3 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -200,6 +200,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ +sh_errexit_works = @sh_errexit_works@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in index ce9688503..84d09f0de 100644 --- a/lib/am/Makefile.in +++ b/lib/am/Makefile.in @@ -157,6 +157,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ +sh_errexit_works = @sh_errexit_works@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ diff --git a/m4/Makefile.in b/m4/Makefile.in index 7cc2c6878..bb7bbf987 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -157,6 +157,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ +sh_errexit_works = @sh_errexit_works@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ diff --git a/tests/Makefile.in b/tests/Makefile.in index 3125d0487..d735afad9 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -217,6 +217,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ +sh_errexit_works = @sh_errexit_works@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ diff --git a/tests/defs.in b/tests/defs.in index d44ac9f53..47e1c3aaf 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -251,21 +251,24 @@ chmod -R u+rwx $testSubDir > /dev/null 2>&1 rm -rf $testSubDir > /dev/null 2>&1 mkdir $testSubDir -trap 'exit_status=$? - cd "$curdir" - case $exit_status,$keep_testdirs in - 0,) - chmod -R a+rwx $testSubDir > /dev/null 2>&1 - rm -rf "$testSubDir" ;; - esac - test "$signal" != 0 && - echo "$as_me: caught signal $signal" - echo "$as_me: exit $exit_status" - exit $exit_status -' 0 -for signal in 1 2 13 15; do - trap 'signal='$signal'; { Exit 1; }' $signal -done +sh_errexit_works=@sh_errexit_works@ +if test "$sh_errexit_works" = yes; then + trap 'exit_status=$? + cd "$curdir" + case $exit_status,$keep_testdirs in + 0,) + chmod -R a+rwx $testSubDir > /dev/null 2>&1 + rm -rf "$testSubDir" ;; + esac + test "$signal" != 0 && + echo "$as_me: caught signal $signal" + echo "$as_me: exit $exit_status" + exit $exit_status + ' 0 + for signal in 1 2 13 15; do + trap 'signal='$signal'; { Exit 1; }' $signal + done +fi signal=0 # Copy in some files we need.