]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Config header generation followup.
authorEric Blake <ebb9@byu.net>
Wed, 10 Oct 2007 20:02:16 +0000 (14:02 -0600)
committerEric Blake <ebb9@byu.net>
Thu, 11 Oct 2007 14:06:35 +0000 (08:06 -0600)
* lib/autoconf/general.m4 (_AC_DEFINE_Q): Check for raw newlines,
which won't work with the preprocessor nor with the awk
implementation.
* tests/torture.at (Define a newline): Test raw newline detection,
removing the XFAIL.
* doc/autoconf.texi (Defining Symbols): Document recent change to
allow backslash-newline.
* THANKS: Update.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
THANKS
doc/autoconf.texi
lib/autoconf/general.m4
tests/torture.at

index 23bbeebac7d0b7d75b1ae8ddd17f2a50d5199049..dfa78e1b83b119fdd834acb126670f67432ba77a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2007-10-11  Eric Blake  <ebb9@byu.net>
+
+       Config header generation followup.
+       * lib/autoconf/general.m4 (_AC_DEFINE_Q): Check for raw newlines,
+       which won't work with the preprocessor nor with the awk
+       implementation.
+       * tests/torture.at (Define a newline): Test raw newline detection,
+       removing the XFAIL.
+       * doc/autoconf.texi (Defining Symbols): Document recent change to
+       allow backslash-newline.
+       * THANKS: Update.
+
 2007-10-11  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * lib/autotest/general.m4: Put function braces in separate line.
diff --git a/THANKS b/THANKS
index a3c215b21d64463a10d2d5cf01704e7c16329202..c30e341775c5b22aad5a030fb0372cbd3b3aad67 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -96,6 +96,7 @@ Enrique Robledo Arnuncio    enrique.robledo@wanadoo.es
 Erez Zadok                  ezk@cs.columbia.edu
 Eric Backus                 ericb@lsid.hp.com
 Eric Blake                  ebb9@byu.net
+Eric Lemings                lemings@roguewave.com
 Eric Mumpower               nocturne@mit.edu
 Eric Paire                  ?
 Eric Sunshine               sunshine@sunshineco.com
index 29161d070cc1e4c9468962d2d2f3918db6e5ca0d..faeb9fc36b61ecb7f06cf1da413ac43a812319ac 100644 (file)
@@ -8494,10 +8494,15 @@ terminated by an ellipsis @samp{...} if C99 syntax is employed.
 backslash-newlines, universal character names, or non-@acronym{ASCII}
 characters.
 
-@var{value} should not contain literal newlines, and if you are not
-using @code{AC_CONFIG_HEADERS} it should not contain any @samp{#}
-characters, as @command{make} tends to eat them.  To use a shell variable,
-use @code{AC_DEFINE_UNQUOTED} instead.
+@var{value} may contain backslash-escaped newlines, which will be
+preserved if you use @code{AC_CONFIG_HEADERS} but flattened if passed
+via @code{@@DEFS@@} (with no effect on the compilation, since the
+preprocessor sees only one line in the first place).  @var{value} should
+not contain raw newlines.  If you are not using
+@code{AC_CONFIG_HEADERS}, @var{value} should not contain any @samp{#}
+characters, as @command{make} tends to eat them.  To use a shell
+variable, use @code{AC_DEFINE_UNQUOTED} instead.
+
 @var{description} is only useful if you are using
 @code{AC_CONFIG_HEADERS}.  In this case, @var{description} is put into
 the generated @file{config.h.in} as the comment before the macro define.
index 384eb4203adc7274fde86e510012a25d5c351490..1b7a35534be7075dee807cfe8f6c8fafcb15ac48 100644 (file)
@@ -2045,6 +2045,12 @@ m4_define([_AC_DEFINE_Q],
 [m4_pushdef([AC_name], m4_if(m4_index([$2], [(]), [-1], [[[$2]]],
                             [m4_bpatsubst([[[$2]]], [(.*)])]))dnl
 AC_DEFINE_TRACE(AC_name)dnl
+m4_cond([m4_index([$3], [
+])], [-1], [],
+       [AS_LITERAL_IF([$3], [m4_bregexp([[$3]], [[^\\]
+], [-])])], [], [],
+       [m4_warn([syntax], [AC_DEFINE]m4_ifval([$1], [], [[_UNQUOTED]])dnl
+[: `$3' is not a valid preprocessor define value])])dnl
 m4_ifval([$4], [AH_TEMPLATE(AC_name, [$4])])dnl
 m4_popdef([AC_name])dnl
 cat >>confdefs.h <<$1_ACEOF
index 93df3b8a2bb8259c8c8415a12459e8056209654e..ea639fc57a8ba6b4efbbc28b652229c80406c114 100644 (file)
@@ -763,16 +763,36 @@ AT_CLEANUP
 ## ------------------ ##
 
 AT_SETUP([Define a newline])
-AT_XFAIL_IF(:)
 AT_CONFIGURE_AC([[AC_DEFINE([foo], [one
 two], [This spans two lines.])
 ]])
-AT_CHECK_AUTOCONF
-AT_CHECK_AUTOHEADER
+AT_CHECK_AUTOCONF([], [], [],
+[[configure.ac:5: warning: AC_DEFINE: `one
+configure.ac:5: two' is not a valid preprocessor define value
+]])
+AT_CHECK_AUTOHEADER([], [], [],
+[[configure.ac:5: warning: AC_DEFINE: `one
+configure.ac:5: two' is not a valid preprocessor define value
+]])
 AT_CHECK_CONFIGURE
 AT_CHECK_DEFINES([[#define foo one
-two
 ]])
+
+AT_CONFIGURE_AC([[AC_DEFINE_UNQUOTED([foo], [one
+two], [This spans two lines.])
+]])
+AT_CHECK_AUTOCONF([], [], [],
+[[configure.ac:5: warning: AC_DEFINE_UNQUOTED: `one
+configure.ac:5: two' is not a valid preprocessor define value
+]])
+AT_CHECK_AUTOHEADER([], [], [],
+[[configure.ac:5: warning: AC_DEFINE_UNQUOTED: `one
+configure.ac:5: two' is not a valid preprocessor define value
+]])
+AT_CHECK_CONFIGURE
+AT_CHECK_DEFINES([[#define foo one
+]])
+
 AT_CLEANUP