[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 16:41:06 +0200 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
Here is my proposal.
Akim
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 (_AT_DEFINE, AT_DEFINE): New macros.
(AC_DEFINE, AC_DEFINE_UNQUOTED): Use _AT_DEFINE.
* autoheader.sh: Trace AT_DEFINE, 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 14:33:21
@@ -2544,13 +2544,29 @@
## ---------------------- ##
+# AT_DEFINE(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([AT_DEFINE])
+
+
+# _AT_DEFINE(CPP-SYMBOL)
+# ----------------------
+# This macro is a wrapper around AT_DEFINE which filters out non literal
+# symbols.
+define([_AT_DEFINE],
+[AC_VAR_IF_INDIR([$1], [], [AT_DEFINE([$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
+[_AT_DEFINE([$1])dnl
+ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
cat >>confdefs.h <<\EOF
[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
EOF
@@ -2562,7 +2578,8 @@
# ----------------------------------------------------
# Similar, but perform shell substitutions $ ` \ once on VALUE.
define([AC_DEFINE_UNQUOTED],
-[ifval([$3], [AH_TEMPLATE([$1], [$3])])dnl
+[_AT_DEFINE([$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 14:33:29
@@ -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 AT_DEFINE:'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 14:33:29
@@ -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
- Re: Autoconf: bug in current CVS version,
Akim Demaille <=