[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: AC_TRY_RUN
From: |
Akim Demaille |
Subject: |
FYI: AC_TRY_RUN |
Date: |
06 Feb 2001 16:10:10 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Crater Lake) |
This fixes the 80 or 90 failures of the test suite due to the
inconsistent use of AC_TRY_COMMAND. I hate this code :(
I'm applying it because it does no harm, and is private.
Index: ChangeLog
from Akim Demaille <address@hidden>
* acgeneral.m4 (_AC_RUN_LOG, _AC_RUN_LOG_STDERR, AC_RUN_LOG): New.
(_AC_EVAL_STDERR, _AC_EVAL): Use them.
(_AC_INIT_PREPARE_FS_SEPARATORS): Use AC_RUN_LOG.
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.691
diff -u -u -r1.691 acgeneral.m4
--- acgeneral.m4 2001/02/05 17:33:00 1.691
+++ acgeneral.m4 2001/02/06 15:02:00
@@ -1370,7 +1370,7 @@
[echo "#! $SHELL" >conftest.sh
echo "exit 0" >>conftest.sh
chmod +x conftest.sh
-if AC_TRY_COMMAND([PATH=".;`pwd`"; conftest.sh]); then
+if AC_RUN_LOG([PATH=".;`pwd`"; conftest.sh]); then
ac_path_separator=';'
else
ac_path_separator=:
@@ -2200,25 +2200,25 @@
## ---------------------------- ##
-# _AC_EVAL(COMMAND)
-# -----------------
+# _AC_RUN_LOG(COMMAND, LOG-COMMANDS)
+# ----------------------------------
# Eval COMMAND, save the exit status in ac_status, and log it.
-AC_DEFUN([_AC_EVAL],
-[{ (eval echo "$as_me:__oline__: \"$1\"") >&AS_MESSAGE_LOG_FD
- (eval $1) 2>&AS_MESSAGE_LOG_FD
+AC_DEFUN([_AC_RUN_LOG],
+[{ ($2) >&AS_MESSAGE_LOG_FD
+ ($1) 2>&AS_MESSAGE_LOG_FD
ac_status=$?
echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
(exit $ac_status); }])
-# _AC_EVAL_STDERR(COMMAND)
-# ------------------------
+# _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS)
+# -----------------------------------------
# Eval COMMAND, save its stderr into conftest.err, save the exit status
# in ac_status, and log it.
# Note that when tracing, most shells will leave the traces in stderr
-AC_DEFUN([_AC_EVAL_STDERR],
-[{ (eval echo "$as_me:__oline__: \"$1\"") >&AS_MESSAGE_LOG_FD
- (eval $1) 2>conftest.er1
+AC_DEFUN([_AC_RUN_LOG_STDERR],
+[{ ($2) >&AS_MESSAGE_LOG_FD
+ ($1) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
@@ -2227,6 +2227,24 @@
(exit $ac_status); }])
+# _AC_EVAL(COMMAND)
+# -----------------
+# Eval COMMAND, save the exit status in ac_status, and log it.
+AC_DEFUN([_AC_EVAL],
+[_AC_RUN_LOG([eval $1],
+ [eval echo "$as_me:__oline__: \"$1\""])])
+
+
+# _AC_EVAL_STDERR(COMMAND)
+# ------------------------
+# Eval COMMAND, save its stderr into conftest.err, save the exit status
+# in ac_status, and log it.
+# Note that when tracing, most shells will leave the traces in stderr
+AC_DEFUN([_AC_EVAL_STDERR],
+[_AC_RUN_LOG_STDERR([eval $1],
+ [eval echo "$as_me:__oline__: \"$1\""])])
+
+
# AC_TRY_EVAL(VARIABLE)
# ---------------------
# The purpose of this macro is to "configure:123: command line"
@@ -2238,7 +2256,15 @@
# AC_TRY_COMMAND(COMMAND)
# -----------------------
AC_DEFUN([AC_TRY_COMMAND],
-[{ ac_try='$1'; _AC_EVAL([$ac_try]); }])
+[{ ac_try='$1'
+ _AC_EVAL([$ac_try]); }])
+
+
+# AC_RUN_LOG(COMMAND)
+# -------------------
+AC_DEFUN([AC_RUN_LOG],
+[_AC_RUN_LOG([$1],
+ [echo "$as_me:__oline__: AS_ESCAPE([$1])"])])
## ------------------ ##
Index: tests/acgeneral.at
===================================================================
RCS file: /cvs/autoconf/tests/acgeneral.at,v
retrieving revision 1.1
diff -u -u -r1.1 acgeneral.at
--- tests/acgeneral.at 2001/01/22 09:03:38 1.1
+++ tests/acgeneral.at 2001/02/06 15:02:00
@@ -10,6 +10,7 @@
AT_CHECK_MACRO([AC_EGREP_CPP])
AT_CHECK_MACRO([AC_EGREP_HEADER])
AT_CHECK_MACRO([AC_PREFIX_DEFAULT])
# Obsolete macros.
AT_CHECK_AU_MACRO([AC_CHECKING])
- FYI: AC_TRY_RUN,
Akim Demaille <=