* Ralf Wildenhues wrote on Sun, Feb 28, 2010 at 02:12:00PM CET:
I can reproduce these two failures on FreeBSD 6.4 (i386):
35. tools.at:1174: testing ...
../../tests/tools.at:1191: : sub/some-file exit 77
stderr:
/home/users/wilx/tmp/autoconf-2.65/objdir/tests/testsuite.dir/at-groups/35/test-source:
cannot create sub/some-file: Permission denied
stdout:
../../tests/tools.at:1191: exit code was 2, expected 1
35. tools.at:1174: 35. autom4te cache creation (tools.at:1174): FAILED
(tools.at:1191)
239. c.at:57: testing ...
checking whether the C compiler works... no
../../tests/c.at:66: exit code was 1, expected 77
The second is us failing to adhere to '(autoconf.info)Shell Functions':
Likewise, the state of `$?' is not reliable when entering a shell
function.
in AS_ERROR. The first seems to be a genuine shell error difference
(from glancing at SUSv3 I can only gather that a failed redirection
should result in an exit status 0, but no further specification).
I'm assuming the rest of the failures, which happen because no Fortran
compiler is installed, are due to the same issue as 239.
I'm testing these two patches right now. I didn't see an easy way to
keep as_fn_error API-compatible in the presence of trailing optional
arguments, so aren't we glad we didn't publish that function. Still
feel a bit uneasy about the first patch, as we don't cover AS_ERROR
fully in the testsuite (e.g., the two-argument version). So, close
review is appreciated. Thanks. (Sending them with format-patch in
case you want to go ahead and apply them, Eric.)
The second patch needs a subshell because sh just errors out right away
upon failed redirection, which is actually correct as ':' is a special
built-in utility.
I'm seeing spurious testsuite failures when I pass '-v -d -x NNN' as
TESTSUITEFLAGS, NNN being numbers, on FreeBSD. Haven't investigated
further yet.
Cheers,
Ralf
From 97932886547c39d94e75a01b55885c7dc15d6a2d Mon Sep 17 00:00:00 2001
From: Ralf Wildenhues ralf.wildenh...@gmx.de
Date: Sun, 28 Feb 2010 14:35:31 +0100
Subject: [PATCH 1/4] Fix AS_ERROR for FreeBSD sh.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* lib/m4sugar/m4sh.m4 (_AS_ERROR_PREPARE): Rewrite as_fn_error
to take additional first argument STATUS instead of transporting
$? across shell function entry, which does not work with FreeBSD
sh. Shift all other arguments by one, adjust.
(AS_ERROR): Pass EXIT-STATUS, defaulting to $?, to as_fn_error.
* THANKS: Update.
Report by Václav Haisman.
Signed-off-by: Ralf Wildenhues ralf.wildenh...@gmx.de
---
ChangeLog | 11 +++
THANKS |1 +
lib/m4sugar/m4sh.m4 | 21 ++---
3 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 98e0b31..a3ee4a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-28 Ralf Wildenhues ralf.wildenh...@gmx.de
+
+ Fix AS_ERROR for FreeBSD sh.
+ * lib/m4sugar/m4sh.m4 (_AS_ERROR_PREPARE): Rewrite as_fn_error
+ to take additional first argument STATUS instead of transporting
+ $? across shell function entry, which does not work with FreeBSD
+ sh. Shift all other arguments by one, adjust.
+ (AS_ERROR): Pass EXIT-STATUS, defaulting to $?, to as_fn_error.
+ * THANKS: Update.
+ Report by Václav Haisman.
+
2010-02-26 Eric Blake ebl...@redhat.com
Optimize AC_REPLACE_FUNCS.
diff --git a/THANKS b/THANKS
index 16dd8a3..ffa56de 100644
--- a/THANKS
+++ b/THANKS
@@ -388,6 +388,7 @@ Tomohiro Suzuki ?
Tony Leneis t...@plaza.ds.adp.com
Toshio Kuratomi ?
Uwe Seimet u...@orbacus.com
+Václav Haisman v.hais...@sh.cvut.cz
Vance Shipley van...@motivity.ca
Viktor Dukhovni vik...@anaheim.esm.com
Ville Karaila kara...@iki.fi
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index 8160b3d..bfa6b44 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -816,22 +816,22 @@ m4_define([AS_WARN],
# otherwise, assume the entire script does not do logging.
m4_define([_AS_ERROR_PREPARE],
[AS_REQUIRE_SHELL_FN([as_fn_error],
- [AS_FUNCTION_DESCRIBE([as_fn_error], [ERROR]m4_ifval(AS_MESSAGE_LOG_FD,
+ [AS_FUNCTION_DESCRIBE([as_fn_error], [STATUS
ERROR]m4_ifval(AS_MESSAGE_LOG_FD,
[[ [[LINENO LOG_FD),
[Output `basename @S|@0`: error: ERROR to stderr.]
m4_ifval(AS_MESSAGE_LOG_FD,
[[If LINENO and LOG_FD are provided, also output the error to LOG_FD,
referencing LINENO.]])
-[Then exit the script with status $?, using 1 if that was 0.])],
-[ as_status=$?; test $as_status -eq 0 as_status=1
+[Then exit the script with STATUS, using 1 if that was 0.])],
+[ as_status=$[1]; test $as_status -eq 0 as_status=1
m4_ifval(AS_MESSAGE_LOG_FD,
-[m4_pushdef([AS_MESSAGE_LOG_FD], [$[3]])dnl
- if test $[3]; then
-