autoconf-patches
[Top][All Lists]
Advanced

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

let AC_MSG_FAILURE report pwd


From: Ralf Wildenhues
Subject: let AC_MSG_FAILURE report pwd
Date: Tue, 6 May 2008 22:41:54 +0200
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

This is probably the most often misunderstood build failure of GCC:
http://gcc.gnu.org/ml/gcc-help/2008-05/msg00058.html
http://article.gmane.org/gmane.comp.gcc.help/23852
http://thread.gmane.org/gmane.comp.gcc.help/24232
to list just the reports from the last few weeks.

People simply don't realize that there could be more than one config.log
and config.cache file.

OK to apply?

I considered propagating relative subdirs to AC_CONFIG_SUBDIRS,
but that doesn't seem worth the trouble (and won't work OOTB with GCC).

Thanks,
Ralf

    * lib/autoconf/general.m4 (_AC_ARG_VAR_VALIDATE, AC_MSG_FAILURE):
    Output $ac_pwd along with fatal failure.
    * tests/torture.at (Deep Package): Extend test.
    Reported numerous times against GCC, and probably other packages.

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 57b4871..0f8e32d 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1576,6 +1576,7 @@ for ac_var in $ac_precious_vars; do
   fi
 done
 if $ac_cache_corrupted; then
+  AS_MESSAGE([error: in `$ac_pwd':], 2)
   AS_MESSAGE([error: changes in the environment can compromise the build], 2)
   AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over])
 fi])dnl
@@ -2166,8 +2167,9 @@ m4_copy([AS_WARN],    [AC_MSG_WARN])
 m4_copy([AS_MESSAGE], [AC_MSG_NOTICE])
 m4_copy([AS_ERROR],   [AC_MSG_ERROR])
 m4_define([AC_MSG_FAILURE],
-[AC_MSG_ERROR([$1
-See `config.log' for more details.], [$2])])
+[{ AS_MESSAGE([error: in `$ac_pwd':], 2)
+AC_MSG_ERROR([$1
+See `config.log' for more details.], [$2]); }])
 
 
 # _AC_MSG_LOG_CONFTEST
diff --git a/tests/torture.at b/tests/torture.at
index 4b7240b..d5ec2e8 100644
--- a/tests/torture.at
+++ b/tests/torture.at
@@ -1275,6 +1275,9 @@ AT_DATA([inner/innermost/configure.in],
 AC_ARG_VAR([INNERMOST], [an innermost variable])
 AC_CONFIG_HEADERS(config.h:config.hin)
 AC_DEFINE_UNQUOTED([INNERMOST], [$INNERMOST], [an innermost variable])
+if test -n "$innermost_error"; then
+  AC_MSG_FAILURE([Error in $PACKAGE_NAME])
+fi
 AC_OUTPUT
 ]])
 
@@ -1324,6 +1327,14 @@ AT_CHECK([grep INNERMOST inner/innermost/config.h], 0,
 [[#define INNERMOST tsomrenni
 ]])
 
+# Ensure we point to the right config.log file for errors.
+AT_CHECK_CONFIGURE([innermost_error=:], [1], [], [stderr])
+AT_CHECK([grep 'inner/innermost' stderr], [], [ignore])
+cd inner
+AT_CHECK_CONFIGURE([innermost_error=:], [1], [], [stderr])
+AT_CHECK([grep 'innermost' stderr], [], [ignore])
+cd ..
+
 # The same, but from a builddir.
 AS_MKDIR_P([builddir])
 chmod a-w builddir inner/innermost inner




reply via email to

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