autoconf-patches
[Top][All Lists]
Advanced

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

04-ac-femme-fatal.patch


From: Akim Demaille
Subject: 04-ac-femme-fatal.patch
Date: 16 Oct 2000 09:47:52 +0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

Sorry for the title of the patch, but this weekend I was listening in
loop to `Andy Warhol' from the Velvet Underground, and especially
`Femme Fatale'.  I couldn't resist (c:

The aim of this patch is fairly simple: spread the use of
_AC_EXPANSION_STACK_DUMP everywhere AC_FATAL is used.

~/src/ace % /tmp                                                     Err 2 remo
/tmp % cat -n aclocal.m4                                             20:43 remo
     1  AC_DEFUN([FOO1],
     2  [AC_REQUIRE([FOO2])])
     3
     4
     5  AC_DEFUN([FOO2],
     6  [AC_REQUIRE([FOO3])])
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18  AC_DEFUN([FOO3],
    19  [AC_LANG_POP
    20  AC_LANG_POP])
/tmp % cat -n configure.in                                           20:43 remo
     1  AC_INIT
     2  FOO1

Before:

| /tmp % ace
| configure.in:2: too many AC_LANG_POP

After:

| /tmp % ace
| configure.in:2: too many AC_LANG_POP
| ./aclocal.m4:20: FOO3 is expanded from...
| configure.in:2: FOO3 is required by...
| ./aclocal.m4:6: FOO2 is expanded from...
| configure.in:2: FOO2 is required by...
| ./aclocal.m4:2: FOO1 is expanded from...
| configure.in:2: the top level

It is debatable whether we should do the same for AC_DIAGNOSE.  It can
be both frightening, and very helping.  I'm in favor of extending it
to AC_DIAGNOSE.  You tell me.

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * acgeneral.m4 (AC_FATAL): Use _AC_EXPANSION_STACK_DUMP.
        (_AC_REQUIRE): Use AC_FATAL.

Index: TODO
--- TODO Sun, 15 Oct 2000 09:30:12 +0200 akim (ace/29_TODO 1.55 666)
+++ TODO Sun, 15 Oct 2000 20:37:46 +0200 akim (ace/29_TODO 1.55 666)
@@ -9,22 +9,9 @@

 * Autoconf 2.50

-** mktests.sh
-It should be adjusted so that when someone runs it with a failing
-egrep, the output files are touch'ed.
-
 ** AC_EXEEXT, AC_OBJEXT
 We need a good implementation.  As much as possible, they should not
 depend upon AC_EMXOS2 etc.
-
-** More tests
-Check that AC_REQUIRE circular dependencies are caught.
-
-** _AC_EXPANSION_STACK_DUMP
-Where ever AC_FATAL is used, we should call _AC_EXPANSION_STACK_DUMP.
-Try to see if we can use __FILE__ and __LINE__ in the stack: this
-would provide much more accurate error messages (but it might be
-costly...).

 ** --target & AC_ARG_PROGRAM
 Shouldn't *any* `program' be installed as `$target_alias-program' even
Index: acgeneral.m4
--- acgeneral.m4 Sun, 15 Oct 2000 20:19:41 +0200 akim (ace/27_acgeneral. 
1.169.8.71 666)
+++ acgeneral.m4 Sun, 15 Oct 2000 20:37:13 +0200 akim (ace/27_acgeneral. 
1.169.8.71 666)
@@ -655,9 +655,7 @@ define([_AC_REQUIRE],
 [pushdef([_AC_EXPANSION_STACK],
          m4_location[: $1 is required by...])dnl
 ifdef([_AC_EXPANDING($1)],
-      [m4_diagnose([AC_REQUIRE: circular dependency of $1])dnl
-_AC_EXPANSION_STACK_DUMP()dnl
-m4exit(1)])dnl
+      [AC_FATAL([AC_REQUIRE: circular dependency of $1])])dnl
 ifndef([_AC_DIVERT_DUMP],
     [AC_FATAL([AC_REQUIRE: cannot be used outside of an AC_DEFUN'd macro])])dnl
 AC_PROVIDE_IFELSE([$1],
@@ -2763,7 +2761,10 @@ define([AC_WARNING], [AC_DIAGNOSE([synta

 # AC_FATAL(MESSAGE, [EXIT-STATUS])
 # --------------------------------
-define([AC_FATAL], [m4_fatal([$1], [$2])])
+define([AC_FATAL],
+[m4_diagnose([$1])
+_AC_EXPANSION_STACK_DUMP()
+m4exit(m4_default([$2], [1]))])
Index: NEWS
--- NEWS Sun, 15 Oct 2000 09:30:12 +0200 akim (ace/31_NEWS 1.34 666)
+++ NEWS Sun, 15 Oct 2000 21:39:50 +0200 akim (ace/31_NEWS 1.34 666)
@@ -29,6 +29,11 @@
   configure to adapt for packages not using autoconf on case-insensitive
   filesystems.
 
+- Diagnostics
+  More errors are now caught (circular AC_REQUIRE dependencies,
+  AC_DEFINE in the action part of an AC_CACHE_CHECK, too many pops
+  etc.).  In addition, their location and call stack are given.
+
 ** autoupdate
 autoupdate is much more powerful, and is able to provide the glue code
 which might be needed to move from an old macro to its newer



reply via email to

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