automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 16/32] configure: testsuite shell set exit traps in shell functio


From: Stefano Lattarini
Subject: [PATCH 16/32] configure: testsuite shell set exit traps in shell functions
Date: Thu, 26 Jul 2012 14:04:42 +0200

* configure.ac: Check that the shell selected to run the test
scripts can set an exit trap in a shell function, without having
that trap executed at the termination of the function rather
than of the scripts.  According to the Autoconf manual, at least
AUX 5.3 /bin/sh suffers of such a bug.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 configure.ac | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index a8db061..45143c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -319,6 +319,11 @@ AC_DEFUN([_AM_CHECK_CANDIDATE_SHELL],
       [], [am_score=1; break])
 
     _AM_CHECK_SHELL_FEATURE([$1],
+      [can define exit traps in a shell function],
+      [fail=0 && foo() { trap 'fail=1' 0; } && foo && test $fail = 0],
+      [], [am_score=1; break])
+
+    _AM_CHECK_SHELL_FEATURE([$1],
       [corrupts stderr with "set -x"],
       [(set -x; P=1 true 2>&3) 3>&1 2>/dev/null | grep P=1],
       [am_score=9], [])
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]