autoconf-patches
[Top][All Lists]
Advanced

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

Re: Better `failed program' logs


From: Akim Demaille
Subject: Re: Better `failed program' logs
Date: 31 Oct 2002 09:27:43 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

| | > From: Akim Demaille <address@hidden>
| | > Date: 30 Oct 2002 09:30:14 +0100
| | > 
| | > This is, IMHO, *much* more useful.
| | 
| | I think so too.
| | 
| | > But... and that's why I'm asking the question before applying it, it
| | > results in a very significant growth of config.log.
| | 
| | I think it's worth it.
| | 
| | > +cat confdefs.h >>conftest.$ac_ext
| | > +cat >>conftest.$ac_ext <<_ACEOF
| | 
| | Can't you replace that with the following, to save a fork+exec?
| | 
| | cat confdefs.h - >>conftest.$ac_ext <<_ACEOF
| 
| Are you sure of the portability of `-' for cat?

Since I don't know, I'm applying my version, but feel free to change
this.  I'm applying this version:

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * lib/autoconf/general.m4 (_AC_MSG_LOG_CONFTEST): New.
        (_AC_PREPROC_IFELSE, _AC_COMPILE_IFELSE, _AC_LINK_IFELSE)
        (_AC_RUN_IFELSE): Use it.
        * lib/autoconf/lang.m4 (_AC_COMPILER_OBJEXT):
        (_AC_COMPILER_EXEEXT_DEFAULT): Likewise.
        * lib/autoconf/c.m4 (AC_LANG_SOURCE): Don't include confdefs.h,
        inline it.

Index: lib/autoconf/c.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
retrieving revision 1.169
diff -u -u -r1.169 c.m4
--- lib/autoconf/c.m4 27 Oct 2002 18:23:14 -0000 1.169
+++ lib/autoconf/c.m4 31 Oct 2002 08:25:36 -0000
@@ -121,7 +121,11 @@
 # #line $LINENO "$[0]"
 m4_define([AC_LANG_SOURCE(C)],
 [#line $LINENO "configure"
-#include "confdefs.h"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 $1])
 
 
Index: lib/autoconf/general.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/general.m4,v
retrieving revision 1.808
diff -u -u -r1.808 general.m4
--- lib/autoconf/general.m4 27 Oct 2002 18:21:32 -0000 1.808
+++ lib/autoconf/general.m4 31 Oct 2002 08:25:36 -0000
@@ -1972,6 +1972,15 @@
 [AC_MSG_ERROR([$1
 See `config.log' for more details.], [$2])])
 
+
+# _AC_MSG_LOG_CONFTEST
+# --------------------
+m4_define([_AC_MSG_LOG_CONFTEST],
+[echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
+sed 's/^/| /' conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+])
+
+
 # AU::AC_CHECKING(FEATURE)
 # ------------------------
 AU_DEFUN([AC_CHECKING],
@@ -2090,8 +2099,7 @@
 if test -z "$ac_cpp_err"; then
   m4_default([$2], :)
 else
-  echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
-  cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+  _AC_MSG_LOG_CONFTEST
   $3
 fi
 rm -f conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl
@@ -2166,8 +2174,7 @@
 AS_IF([AC_TRY_EVAL(ac_compile) &&
          AC_TRY_COMMAND([test -s conftest.$ac_objext])],
       [$2],
-      [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
-cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+      [_AC_MSG_LOG_CONFTEST
 m4_ifvaln([$3],[$3])dnl])dnl
 rm -f conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl
 ])# _AC_COMPILE_IFELSE
@@ -2206,8 +2213,7 @@
 AS_IF([AC_TRY_EVAL(ac_link) &&
          AC_TRY_COMMAND([test -s conftest$ac_exeext])],
       [$2],
-      [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
-cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+      [_AC_MSG_LOG_CONFTEST
 m4_ifvaln([$3], [$3])dnl])[]dnl
 rm -f conftest.$ac_objext conftest$ac_exeext m4_ifval([$1], 
[conftest.$ac_ext])[]dnl
 ])# _AC_LINK_IFELSE
@@ -2260,8 +2266,7 @@
 AS_IF([AC_TRY_EVAL(ac_link) && AC_TRY_COMMAND(./conftest$ac_exeext)],
       [$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
+_AC_MSG_LOG_CONFTEST
 m4_ifvaln([$3],
           [( exit $ac_status )
 $3])dnl])[]dnl
Index: lib/autoconf/lang.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/lang.m4,v
retrieving revision 1.160
diff -u -u -r1.160 lang.m4
--- lib/autoconf/lang.m4 27 Oct 2002 18:24:51 -0000 1.160
+++ lib/autoconf/lang.m4 31 Oct 2002 08:25:36 -0000
@@ -478,8 +478,7 @@
         break;;
   esac
 done],
-      [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
-cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+      [_AC_MSG_LOG_CONFTEST
 AC_MSG_FAILURE([_AC_LANG compiler cannot create executables], 77)])
 ac_exeext=$ac_cv_exeext
 AC_MSG_RESULT([$ac_file])
@@ -597,8 +596,7 @@
        break;;
   esac
 done],
-      [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
-cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
+      [_AC_MSG_LOG_CONFTEST
 AC_MSG_FAILURE([cannot compute suffix of object files: cannot compile])])
 rm -f conftest.$ac_cv_objext conftest.$ac_ext])
 AC_SUBST([OBJEXT], [$ac_cv_objext])dnl





reply via email to

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