]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Sun Oct 4 21:57:20 1998 Tom Tromey <tromey@cygnus.com>
authorBen Elliston <bje+keyword+gnu.7caf74@air.net.au>
Fri, 9 Oct 1998 07:44:10 +0000 (07:44 +0000)
committerBen Elliston <bje+keyword+gnu.7caf74@air.net.au>
Fri, 9 Oct 1998 07:44:10 +0000 (07:44 +0000)
* autoconf.texi (Defining Symbols): Documented third argument to
AC_DEFINE.
* autoheader.m4 (AC_DEFINE_UNQUOTED): Generate `verbatim'
assignment if third argument given.
(AC_DEFINE): Likewise.
* acgeneral.m4 (AC_DEFINE): Handle case where $# is 3.
(AC_DEFINE_UNQUOTED): Likewise.
* autoheader.sh: Echo $verbatim if not empty.

ChangeLog
acgeneral.m4
autoconf.texi
autoheader.in
autoheader.m4
autoheader.sh
bin/autoheader.in
doc/autoconf.texi
lib/autoconf/general.m4

index 3b41b2e230aee780f676d2939e53f170038f1693..5aadfee5b75b3af8bd91f8d3a554a676d906bd2d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,17 @@
 
        * acgeneral.m4 (AC_TRY_LINK_FUNC): Fix macro ordering.
 
+Sun Oct  4 21:57:20 1998  Tom Tromey  <tromey@cygnus.com>
+
+       * autoconf.texi (Defining Symbols): Documented third argument to
+       AC_DEFINE.
+       * autoheader.m4 (AC_DEFINE_UNQUOTED): Generate `verbatim'
+       assignment if third argument given.
+       (AC_DEFINE): Likewise.
+       * acgeneral.m4 (AC_DEFINE): Handle case where $# is 3.
+       (AC_DEFINE_UNQUOTED): Likewise.
+       * autoheader.sh: Echo $verbatim if not empty.
+
 1998-10-03  Ben Elliston  <bje@cygnus.com>
 
        * acconfig.h (FC_NO_MINUS_C_MINUS_O): Add to complete the Fortran
index e3319b5b2de6f5fe443fdfcacf196e071977590b..45a95fea1f1499ed48bd9eea29ddee3ed26d7eca 100644 (file)
@@ -1,7 +1,7 @@
 dnl Parameterized macros.
 dnl Requires GNU m4.
 dnl This file is part of Autoconf.
-dnl Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+dnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
 dnl
 dnl This program is free software; you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -1152,14 +1152,14 @@ dnl Set VARIABLE to VALUE, verbatim, or 1.
 dnl AC_DEFINE(VARIABLE [, VALUE])
 define(AC_DEFINE,
 [cat >> confdefs.h <<\EOF
-[#define] $1 ifelse($#, 2, [$2], 1)
+[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
 EOF
 ])
 
 dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
 define(AC_DEFINE_UNQUOTED,
 [cat >> confdefs.h <<EOF
-[#define] $1 ifelse($#, 2, [$2], 1)
+[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
 EOF
 ])
 
index 021cced3a9fd91c2c3a38f19f2b4f8896b5c71b6..512606d9381380f618308631126a0cfd1c99b777 100644 (file)
@@ -27,7 +27,7 @@ This file documents the GNU Autoconf package for creating scripts to
 configure source code packages using templates and an @code{m4} macro
 package.
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998 Free Software Foundation, Inc.
 
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -3358,7 +3358,7 @@ correct values into @code{#define} statements in a template file.
 @xref{Configuration Headers}, for more information about this kind of
 output.
 
-@defmac AC_DEFINE (@var{variable} @r{[}, @var{value}@r{]})
+@defmac AC_DEFINE (@var{variable} @r{[}, @var{value} @r{[}, @var{description}@r{]}@r{]})
 @maindex DEFINE
 Define C preprocessor variable @var{variable}.  If @var{value} is given,
 set @var{variable} to that value (verbatim), otherwise set it to 1.
@@ -3367,16 +3367,19 @@ using @code{AC_CONFIG_HEADER} it should not contain any @samp{#}
 characters, as @code{make} tends to eat them.  To use a shell variable
 (which you need to do in order to define a value containing the
 @code{m4} quote characters @samp{[} or @samp{]}), use
-@code{AC_DEFINE_UNQUOTED} instead.  The following example defines the C
-preprocessor variable @code{EQUATION} to be the string constant
-@samp{"$a > $b"}:
+@code{AC_DEFINE_UNQUOTED} instead.  @var{description} is only useful if
+you are using @code{AC_CONFIG_HEADER}.  In this case, @var{description}
+is put into the generated @file{config.h.in} as the comment before the
+macro define; the macro need not be mentioned in @file{acconfig.h}.  The
+following example defines the C preprocessor variable @code{EQUATION} to
+be the string constant @samp{"$a > $b"}:
 
 @example
 AC_DEFINE(EQUATION, "$a > $b")
 @end example
 @end defmac
 
-@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value}@r{]})
+@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value} @r{[}, @var{description}@r{]}@r{]})
 @maindex DEFINE_UNQUOTED
 Like @code{AC_DEFINE}, but three shell expansions are
 performed---once---on @var{variable} and @var{value}: variable expansion
index c73de46cac6666f32f0acbfcb1837969f3c36f59..196c16df6930790a7f53c698061534aa13aae188 100644 (file)
@@ -1,6 +1,6 @@
 #! @SHELL@
 # autoheader -- create `config.h.in' from `configure.in'
-# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -241,6 +241,10 @@ if test -n "$libs"; then
   done
 fi
 
+if test -n "$verbatim"; then
+  echo "$verbatim"
+fi
+
 # Handle the case where @BOTTOM@ is the first line of acconfig.h.
 test -r $localdir/acconfig.h &&
   grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
index 41fe94e0570b423064ed8620a20359b11ce47099..cb411b0fb7312493a15872e9e30ce2b1cd7e64b4 100644 (file)
@@ -90,9 +90,21 @@ define([AC_CONFIG_H], patsubst($1, [ .*$], []))dnl
 ])
 
 define([AC_DEFINE], [#
+ifelse([$3],,[#
 @@@syms="$syms $1"@@@
-])
+], [#
+@@@verbatim="$verbatim
+/* $3 */
+#undef $1
+"@@@
+])])
 
 define([AC_DEFINE_UNQUOTED], [#
+ifelse([$3],,[#
 @@@syms="$syms $1"@@@
-])
+], [#
+@@@verbatim="$verbatim
+/* $3 */
+#undef $1
+"@@@
+])])
index c73de46cac6666f32f0acbfcb1837969f3c36f59..196c16df6930790a7f53c698061534aa13aae188 100644 (file)
@@ -1,6 +1,6 @@
 #! @SHELL@
 # autoheader -- create `config.h.in' from `configure.in'
-# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -241,6 +241,10 @@ if test -n "$libs"; then
   done
 fi
 
+if test -n "$verbatim"; then
+  echo "$verbatim"
+fi
+
 # Handle the case where @BOTTOM@ is the first line of acconfig.h.
 test -r $localdir/acconfig.h &&
   grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
index c73de46cac6666f32f0acbfcb1837969f3c36f59..196c16df6930790a7f53c698061534aa13aae188 100644 (file)
@@ -1,6 +1,6 @@
 #! @SHELL@
 # autoheader -- create `config.h.in' from `configure.in'
-# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -241,6 +241,10 @@ if test -n "$libs"; then
   done
 fi
 
+if test -n "$verbatim"; then
+  echo "$verbatim"
+fi
+
 # Handle the case where @BOTTOM@ is the first line of acconfig.h.
 test -r $localdir/acconfig.h &&
   grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
index 021cced3a9fd91c2c3a38f19f2b4f8896b5c71b6..512606d9381380f618308631126a0cfd1c99b777 100644 (file)
@@ -27,7 +27,7 @@ This file documents the GNU Autoconf package for creating scripts to
 configure source code packages using templates and an @code{m4} macro
 package.
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998 Free Software Foundation, Inc.
 
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -3358,7 +3358,7 @@ correct values into @code{#define} statements in a template file.
 @xref{Configuration Headers}, for more information about this kind of
 output.
 
-@defmac AC_DEFINE (@var{variable} @r{[}, @var{value}@r{]})
+@defmac AC_DEFINE (@var{variable} @r{[}, @var{value} @r{[}, @var{description}@r{]}@r{]})
 @maindex DEFINE
 Define C preprocessor variable @var{variable}.  If @var{value} is given,
 set @var{variable} to that value (verbatim), otherwise set it to 1.
@@ -3367,16 +3367,19 @@ using @code{AC_CONFIG_HEADER} it should not contain any @samp{#}
 characters, as @code{make} tends to eat them.  To use a shell variable
 (which you need to do in order to define a value containing the
 @code{m4} quote characters @samp{[} or @samp{]}), use
-@code{AC_DEFINE_UNQUOTED} instead.  The following example defines the C
-preprocessor variable @code{EQUATION} to be the string constant
-@samp{"$a > $b"}:
+@code{AC_DEFINE_UNQUOTED} instead.  @var{description} is only useful if
+you are using @code{AC_CONFIG_HEADER}.  In this case, @var{description}
+is put into the generated @file{config.h.in} as the comment before the
+macro define; the macro need not be mentioned in @file{acconfig.h}.  The
+following example defines the C preprocessor variable @code{EQUATION} to
+be the string constant @samp{"$a > $b"}:
 
 @example
 AC_DEFINE(EQUATION, "$a > $b")
 @end example
 @end defmac
 
-@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value}@r{]})
+@defmac AC_DEFINE_UNQUOTED (@var{variable} @r{[}, @var{value} @r{[}, @var{description}@r{]}@r{]})
 @maindex DEFINE_UNQUOTED
 Like @code{AC_DEFINE}, but three shell expansions are
 performed---once---on @var{variable} and @var{value}: variable expansion
index e3319b5b2de6f5fe443fdfcacf196e071977590b..45a95fea1f1499ed48bd9eea29ddee3ed26d7eca 100644 (file)
@@ -1,7 +1,7 @@
 dnl Parameterized macros.
 dnl Requires GNU m4.
 dnl This file is part of Autoconf.
-dnl Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+dnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
 dnl
 dnl This program is free software; you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -1152,14 +1152,14 @@ dnl Set VARIABLE to VALUE, verbatim, or 1.
 dnl AC_DEFINE(VARIABLE [, VALUE])
 define(AC_DEFINE,
 [cat >> confdefs.h <<\EOF
-[#define] $1 ifelse($#, 2, [$2], 1)
+[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
 EOF
 ])
 
 dnl Similar, but perform shell substitutions $ ` \ once on VALUE.
 define(AC_DEFINE_UNQUOTED,
 [cat >> confdefs.h <<EOF
-[#define] $1 ifelse($#, 2, [$2], 1)
+[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
 EOF
 ])