* 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
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
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
])
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
@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.
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
#! @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
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 &&
])
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
+"@@@
+])])
#! @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
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 &&
#! @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
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 &&
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
@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.
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
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
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
])