From 013957a4cea8d635b9ffdc808546caea2e761675 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Fri, 9 Oct 1998 07:44:10 +0000 Subject: [PATCH] Sun Oct 4 21:57:20 1998 Tom Tromey * 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 | 11 +++++++++++ acgeneral.m4 | 6 +++--- autoconf.texi | 15 +++++++++------ autoheader.in | 6 +++++- autoheader.m4 | 16 ++++++++++++++-- autoheader.sh | 6 +++++- bin/autoheader.in | 6 +++++- doc/autoconf.texi | 15 +++++++++------ lib/autoconf/general.m4 | 6 +++--- 9 files changed, 64 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b41b2e2..5aadfee5 100644 --- 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 + + * 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 * acconfig.h (FC_NO_MINUS_C_MINUS_O): Add to complete the Fortran diff --git a/acgeneral.m4 b/acgeneral.m4 index e3319b5b..45a95fea 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -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 < $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 diff --git a/autoheader.in b/autoheader.in index c73de46c..196c16df 100644 --- a/autoheader.in +++ b/autoheader.in @@ -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 && diff --git a/autoheader.m4 b/autoheader.m4 index 41fe94e0..cb411b0f 100644 --- a/autoheader.m4 +++ b/autoheader.m4 @@ -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 +"@@@ +])]) diff --git a/autoheader.sh b/autoheader.sh index c73de46c..196c16df 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -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 && diff --git a/bin/autoheader.in b/bin/autoheader.in index c73de46c..196c16df 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -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 && diff --git a/doc/autoconf.texi b/doc/autoconf.texi index 021cced3..512606d9 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -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 diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index e3319b5b..45a95fea 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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 <