[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cleanup on AC_MSG_ERROR
From: |
Akim Demaille |
Subject: |
Re: Cleanup on AC_MSG_ERROR |
Date: |
24 Oct 2000 15:42:36 +0200 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
>>>>> "Akim" == Akim Demaille <address@hidden> writes:
Akim> I agree with the point, but I still would prefer to understand
Akim> why trap did not rm those files. That's the bug to kill imho.
This is a first step in that direction. I also equipped the trap with
a trace in config.log, which should have too much information than not
enough. I was also surprised to discover that AC_MSG_ERROR/WARNING
did not leave any trace in config.log. They now do.
Index: ChangeLog
from Akim Demaille <address@hidden>
* acgeneral.m4 (AC_OUTPUT): Don't play with `trap'.
(_AC_INIT_PREPARE): Trap after having created config.log.
Also trap on 0.
When trapped, report why in config.log.
(AC_MSG_WARN, AC_MSG_ERROR): Also output the message in
config.log.
2000-10-24 Akim Demaille <address@hidden>
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.587
diff -u -r1.587 acgeneral.m4
--- acgeneral.m4 2000/10/24 11:59:46 1.587
+++ acgeneral.m4 2000/10/24 13:35:19
@@ -1994,8 +1994,6 @@
define([_AC_INIT_PREPARE],
[AC_DIVERT_PUSH([INIT_PREPARE])dnl
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1
2 15
-
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Also quote any args containing shell meta-characters.
@@ -2020,6 +2018,17 @@
# Get rid of the leading space.
done
+trap '
+ exit_status=$?
+ echo "configure: caught signal $ac_signal" >&AC_FD_LOG
+ echo "configure: exit ($exit_status)" >&AC_FD_LOG
+ rm -rf conftest* confdefs* core core.* *.core $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_status=$?; ac_signal='$ac_signal'; exit $ac_status' $ac_signal
+done
+
_AC_INIT_PREPARE_FDS
# confdefs.h avoids OS command line length limits that DEFS can exceed.
@@ -2863,13 +2872,16 @@
# AC_MSG_WARN(PROBLEM)
# --------------------
define([AC_MSG_WARN],
-[_AC_ECHO([configure: WARNING: $1], 2)])
+[_AC_ECHO([configure:__oline__: WARNING: $1], AC_FD_LOG)
+_AC_ECHO([configure: WARNING: $1], 2)])
# AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
# --------------------------------------
define([AC_MSG_ERROR],
-[{ _AC_ECHO([configure: error: $1], 2); exit m4_default([$2], 1); }])
+[{ _AC_ECHO([configure:__oline__: error: $1], AC_FD_LOG)
+ _AC_ECHO([configure: error: $1], 2)
+ exit m4_default([$2], 1); }])
# AU::AC_CHECKING(FEATURE)
@@ -4432,9 +4444,7 @@
[AC_CONFIG_FILES([$1])])dnl
ifval([$2$3],
[AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
-trap '' 1 2 15
AC_CACHE_SAVE
-trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1
2 15
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.