[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Autoconf: bug in current CVS version
From: |
Akim Demaille |
Subject: |
Re: Autoconf: bug in current CVS version |
Date: |
03 Oct 2000 17:26:15 +0200 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
In fact, now that there is AT for Autotest, I'm no longer in favor of
using AT_ in Autoconf to refer to Autotrace. Rather, I'd suggest the
following patch. I plan to send other patches along the same lines.
Also, AC_VAR_IF_INDIR should be renamed AC_VAR_INDIR_IFELSE for
consistency. And ifval should become m4_ifval IMHO.
Index: ChangeLog
from Akim Demaille <address@hidden>
In order to check that all the CPP symbols which are AC_DEFINE'd
are properly templated, autoheader traces
AC_DEFINE/AC_DEFINE_UNQUOTED. Only literals can be traced, and
actually tracing non literals produces invalid autoheader input.
Hence, provide a means to trace calls to
AC_DEFINE/AC_DEFINE_UNQUOTED with literals.
* acgeneral.m4 (AC_DEFINE_TRACE, AC_DEFINE_TRACE_LITERAL): New
macros.
(AC_DEFINE, AC_DEFINE_UNQUOTED): Use AC_DEFINE_TRACE.
* autoheader.sh: Trace AC_DEFINE_TRACE_LITERAL, not
AC_DEFINE/AC_DEFINE_UNQUOTED.
Index: acgeneral.m4
===================================================================
RCS file: /cvs/autoconf/acgeneral.m4,v
retrieving revision 1.563
diff -u -r1.563 acgeneral.m4
--- acgeneral.m4 2000/10/02 13:11:28 1.563
+++ acgeneral.m4 2000/10/03 15:17:23
@@ -2544,25 +2544,41 @@
## ---------------------- ##
+# AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL)
+# -------------------------------------------
+# This macro is useless, it is used only with --trace to collect the
+# list of *literals* CPP values passed to AC_DEFINE/AC_DEFINE_UNQUOTED.
+define([AC_DEFINE_TRACE_LITERAL])
+
+
+# AC_DEFINE_TRACE(CPP-SYMBOL)
+# ---------------------------
+# This macro is a wrapper around AT_DEFINE which filters out non literal
Ooops, I'll fix this comment.
+# symbols.
+define([AC_DEFINE_TRACE],
+[AC_VAR_IF_INDIR([$1], [], [AC_DEFINE_TRACE_LITERAL([$1])])])
+
+
# AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
# -------------------------------------------
# Set VARIABLE to VALUE, verbatim, or 1. Remember the value
# and if VARIABLE is affected the same VALUE, do nothing, else
# die. The third argument is used by autoheader.
define([AC_DEFINE],
-[ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
+[AC_DEFINE_TRACE([$1])dnl
+ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
cat >>confdefs.h <<\EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
])
-
# AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])
# ----------------------------------------------------
# Similar, but perform shell substitutions $ ` \ once on VALUE.
define([AC_DEFINE_UNQUOTED],
-[ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
+[AC_DEFINE_TRACE([$1])dnl
+ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
cat >>confdefs.h <<EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
Index: autoheader.sh
===================================================================
RCS file: /cvs/autoconf/autoheader.sh,v
retrieving revision 1.82
diff -u -r1.82 autoheader.sh
--- autoheader.sh 2000/09/27 10:02:27 1.82
+++ autoheader.sh 2000/10/03 15:17:23
@@ -248,8 +248,7 @@
--trace AC_CONFIG_HEADERS:'config_h="$1"' \
--trace AH_OUTPUT:'ac_verbatim_$1="\
$2"' \
- --trace AC_DEFINE:'syms="$$syms $1"' \
- --trace AC_DEFINE_UNQUOTED:'syms="$$syms $1"' \
+ --trace AC_DEFINE_TRACE_LITERAL:'syms="$$syms $1"' \
$infile >$tmp/traces.sh || { (exit 1); exit; }
$verbose $me: sourcing $tmp/traces.sh >&2
Index: man/autoheader.1
===================================================================
RCS file: /cvs/autoconf/man/autoheader.1,v
retrieving revision 1.14
diff -u -r1.14 autoheader.1
--- man/autoheader.1 2000/09/04 12:12:21 1.14
+++ man/autoheader.1 2000/10/03 15:17:23
@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.022.
-.TH AUTOHEADER "1" "September 2000" "GNU autoconf 2.49b" FSF
+.TH AUTOHEADER "1" "October 2000" "GNU autoconf 2.49b" FSF
.SH NAME
autoheader \- Create a template header for configure
.SH SYNOPSIS