[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
More verbose AC_TRY_RUN
From: |
Akim Demaille |
Subject: |
More verbose AC_TRY_RUN |
Date: |
16 Nov 2000 18:49:24 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
A friend of mine had problems with AC_HEADER_STDC and it was
impossible, reading the logs, to understand what went wrong.
AC_TRY_RUN is not verbose enough.
Index: ChangeLog
from Akim Demaille <address@hidden>
Let AC_TRY_RUN be more verbose
* acgeneral.m4 (_AC_RUN_IFELSE): Instead of canceling the output
of the test program, save it into the log.
Save the exit status, and report it in the log when non zero.
Just use `(./conftest)' instead of `(./conftest; exit)'.
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.629
diff -u -u -r1.629 acgeneral.m4
--- acgeneral.m4 2000/11/14 11:06:37 1.629
+++ acgeneral.m4 2000/11/16 17:58:32
@@ -2884,14 +2884,15 @@
m4_define([_AC_RUN_IFELSE],
[m4_ifvanl([$1], [AC_LANG_CONFTEST([$1])])dnl
rm -f conftest$ac_exeext
-if AC_TRY_EVAL(ac_link) &&
- test -s conftest$ac_exeext && (./conftest$ac_exeext; exit) 2>/dev/null; then
- m4_default([$2], :)
-else
- echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-m4_ifvanl([$3], [ $3])dnl
-fi
+AC_TRY_EVAL(ac_link) &&
+ (./conftest$ac_exeext) >&AS_MESSAGE_LOG_FD 2>&1;
+ac_status=$?
+AS_IFELSE([test $ac_status == 0],
+ [$2],
+[echo "$as_me: program exited with status: $ac_status" >&AS_MESSAGE_LOG_FD
+echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD[]dnl
+m4_ifvanl([$3], [$3])])
rm -f conftest$ac_exeext ifval([$1], [conftest.$ac_ext])[]dnl
])# _AC_RUN_IFELSE
- More verbose AC_TRY_RUN,
Akim Demaille <=