Index: doc/autoconf.texi =================================================================== RCS file: /sources/autoconf/autoconf/doc/autoconf.texi,v retrieving revision 1.1120 diff -u -r1.1120 autoconf.texi --- doc/autoconf.texi 18 Dec 2006 20:10:05 -0000 1.1120 +++ doc/autoconf.texi 28 Dec 2006 23:37:17 -0000 @@ -8252,17 +8252,21 @@ @defmacx AC_DEFINE (@var{variable}) @acindex{DEFINE} Define @var{variable} to @var{value} (verbatim), by defining a C -object-like macro for @var{variable}. @var{variable} should be a C +preprocessor macro for @var{variable}. @var{variable} should be a C identifier that contains only letters, digits, and underscores. +@var{variable} may optionally be suffixed with a parenthesized argument +list in order to define a C preprocessor macro with arguments (a +comma-delimited set of C letter/digit/underscore identifiers, possibly +terminated with ellipses @samp{...} if C99 syntax is employed). @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{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. -The following example defines the C preprocessor variable -@code{EQUATION} to be the string constant @samp{"$a > $b"}: +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. The following example defines the C +preprocessor variable @code{EQUATION} to be the string constant +@samp{"$a > $b"}: @example AC_DEFINE([EQUATION], ["$a > $b"], @@ -8276,6 +8280,12 @@ If the @var{variable} is a literal string, it is passed to @code{m4_pattern_allow} (@pxref{Forbidden Patterns}). + +If there are multiple @code{AC_DEFINE} statements for the same +@var{variable} name (not counting any parenthesized argument list), then +the definition from the last @code{AC_DEFINE} encountered during +execution of the @command{configure} script is the one used to produce +@file{config.h}. @end defmac @defmac AC_DEFINE_UNQUOTED (@var{variable}, @var{value}, @ovar{description}) Index: lib/autoconf/fortran.m4 =================================================================== RCS file: /sources/autoconf/autoconf/lib/autoconf/fortran.m4,v retrieving revision 1.216 diff -u -r1.216 fortran.m4 --- lib/autoconf/fortran.m4 15 Dec 2006 18:34:20 -0000 1.216 +++ lib/autoconf/fortran.m4 28 Dec 2006 23:37:17 -0000 @@ -1033,82 +1033,40 @@ # scheme used by the Fortran compiler. AC_DEFUN([_AC_FC_WRAPPERS], [_AC_FORTRAN_ASSERT()dnl +AH_TEMPLATE(_AC_FC[_FUNC], + [Define to a macro mangling the given C identifier (in lower and upper + case), which must not contain underscores, for linking with Fortran.])dnl +AH_TEMPLATE(_AC_FC[_FUNC_], + [As ]_AC_FC[_FUNC, but for C identifiers containing underscores.])dnl case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in - 'lower case, no underscore, extra underscore' | \ - 'lower case, underscore, no extra underscore' | \ - 'lower case, underscore, extra underscore' | \ - 'upper case, no underscore, no extra underscore' | \ - 'upper case, no underscore, extra underscore' | \ - 'upper case, underscore, no extra underscore' | \ - 'upper case, underscore, extra underscore') ;; + "lower case, no underscore, no extra underscore") + AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name]) + AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name]) ;; + "lower case, no underscore, extra underscore") + AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name]) + AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## _]) ;; + "lower case, underscore, no extra underscore") + AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name ## _]) + AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## _]) ;; + "lower case, underscore, extra underscore") + AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [name ## _]) + AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [name ## __]) ;; + "upper case, no underscore, no extra underscore") + AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME]) + AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME]) ;; + "upper case, no underscore, extra underscore") + AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME]) + AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## _]) ;; + "upper case, underscore, no extra underscore") + AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME ## _]) + AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## _]) ;; + "upper case, underscore, extra underscore") + AC_DEFINE(_AC_FC[_FUNC(name,NAME)], [NAME ## _]) + AC_DEFINE(_AC_FC[_FUNC_(name,NAME)], [NAME ## __]) ;; *) AC_MSG_WARN([unknown Fortran name-mangling scheme]) ;; esac -case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in #( - 'upper case',*,) - AC_DEFINE(_AC_FC[_UPPER_CASE], 1, - [Define to 1 if upper case spelling should be used.]);; -esac -case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in #( - *,' underscore',*) - AC_DEFINE(_AC_FC[_UNDERSCORE], 1, - [Define to 1 if an underscore should be appended.]);; -esac -case $ac_cv_[]_AC_LANG_ABBREV[]_mangling in #( - *,*,' extra underscore') - AC_DEFINE(_AC_FC[_EXTRA_UNDERSCORE], 1, - [Define to 1 if an extra underscore should be appended.]);; -esac -AH_VERBATIM(_AC_FC[_FUNC], -[/* Define to 1 if upper case spelling should be used. */ -#undef ]_AC_FC[_UPPER_CASE - -/* Define to 1 if an underscore should be appended. */ -#undef ]_AC_FC[_UNDERSCORE - -/* Define to 1 if an extra underscore should be appended. */ -#undef ]_AC_FC[_EXTRA_UNDERSCORE - -/* Define to a macro mangling the given C identifier (in lower and upper - case), which must not contain underscores, for linking with Fortran. */ -#ifdef ]_AC_FC[_UPPER_CASE -# ifdef ]_AC_FC[_UNDERSCORE -# ifdef ]_AC_FC[_EXTRA_UNDERSCORE -# define ]_AC_FC[_FUNC(name, NAME) NAME ## _ -# define ]_AC_FC[_FUNC_(name, NAME) NAME ## __ -# else -# define ]_AC_FC[_FUNC(name, NAME) NAME ## _ -# define ]_AC_FC[_FUNC_(name, NAME) NAME ## _ -# endif -# else -# ifdef ]_AC_FC[_EXTRA_UNDERSCORE -# define ]_AC_FC[_FUNC(name, NAME) NAME -# define ]_AC_FC[_FUNC_(name, NAME) NAME ## _ -# else -# define ]_AC_FC[_FUNC(name, NAME) NAME -# define ]_AC_FC[_FUNC_(name, NAME) NAME -# endif -# endif -#else -# ifdef ]_AC_FC[_UNDERSCORE -# ifdef ]_AC_FC[_EXTRA_UNDERSCORE -# define ]_AC_FC[_FUNC(name, NAME) name ## _ -# define ]_AC_FC[_FUNC_(name, NAME) name ## __ -# else -# define ]_AC_FC[_FUNC(name, NAME) name ## _ -# define ]_AC_FC[_FUNC_(name, NAME) name ## _ -# endif -# else -# ifdef ]_AC_FC[_EXTRA_UNDERSCORE -# define ]_AC_FC[_FUNC(name, NAME) name -# define ]_AC_FC[_FUNC_(name, NAME) name ## _ -# else -# define ]_AC_FC[_FUNC(name, NAME) name -# define ]_AC_FC[_FUNC_(name, NAME) name -# endif -# endif -#endif]) ])# _AC_FC_WRAPPERS Index: lib/autoconf/general.m4 =================================================================== RCS file: /sources/autoconf/autoconf/lib/autoconf/general.m4,v retrieving revision 1.945 diff -u -r1.945 general.m4 --- lib/autoconf/general.m4 19 Dec 2006 05:41:18 -0000 1.945 +++ lib/autoconf/general.m4 28 Dec 2006 23:37:17 -0000 @@ -1987,7 +1987,7 @@ # This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters # out non literal symbols. m4_define([AC_DEFINE_TRACE], -[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL([$1])])]) +[AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL(m4_bpatsubst([[$1]], [(.*)]))])]) # AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])