From 043b96c5db243d69f817bebd2ef90dd560625f36 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 21 Sep 2010 17:00:09 -0600 Subject: [PATCH] AC_REPLACE_FUNCS: restore shell loop for non-literal * lib/autoconf/functions.m4 (AC_REPLACE_FUNCS): Handle non-literals, which was lost in 2010-02-26 optimization. * tests/semantics.at (AC_REPLACE_FUNCS): Enhance test. * NEWS: Document the fix. * THANKS: Update. Reported by Wiseman Jun. Signed-off-by: Eric Blake --- ChangeLog | 8 ++++++++ NEWS | 10 +++++++--- THANKS | 1 + lib/autoconf/functions.m4 | 6 +++++- tests/semantics.at | 13 ++++++++++--- 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f705a59b..27ab27d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2010-09-21 Eric Blake + AC_REPLACE_FUNCS: restore shell loop for non-literal + * lib/autoconf/functions.m4 (AC_REPLACE_FUNCS): Handle + non-literals, which was lost in 2010-02-26 optimization. + * tests/semantics.at (AC_REPLACE_FUNCS): Enhance test. + * NEWS: Document the fix. + * THANKS: Update. + Reported by Wiseman Jun. + maint: resync upstream files * build-aux/gendocs.sh: Resync via 'make fetch'. diff --git a/NEWS b/NEWS index 65013c79..1cae2494 100644 --- a/NEWS +++ b/NEWS @@ -5,12 +5,16 @@ GNU Autoconf NEWS - User visible changes. ** AC_MSG_ERROR (and AS_ERROR) can once again be followed immediately by `dnl'. Regression introduced in 2.66. -** AT_BANNER() with empty argument will cause visual separation from previous - test category. - ** AC_INIT again allows URLs with '?' for its BUG-REPORT argument. Regression introduced in 2.66. +** AC_REPLACE_FUNCS again allows a non-literal argument, such as a shell + variable that expands to a list of functions to check. Regression + introduced in 2.66. + +** AT_BANNER() with empty argument will cause visual separation from previous + test category. + ** The macros AC_PREPROC_IFELSE, AC_COMPILE_IFELSE, AC_LINK_IFELSE, and AC_RUN_IFELSE now warn if the first argument failed to use AC_LANG_SOURCE or AC_LANG_PROGRAM to generate the conftest file diff --git a/THANKS b/THANKS index 4acb36f6..ed871a80 100644 --- a/THANKS +++ b/THANKS @@ -414,6 +414,7 @@ Wayne Chapeskie waynec@spinnaker.com Werner Lemberg wl@gnu.org Wilfredo Sanchez wsanchez@apple.com William Pursell bill.pursell@gmail.com +Wiseman Jun junwiseman@gmail.com Wolfgang Mueller Wolfgang.Mueller@cui.unige.ch Yaakov Selkowitz yselkowitz@users.sourceforge.net Yavor Doganov yavor@gnu.org diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index f03991ba..ca027124 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -131,8 +131,12 @@ m4_define([_AC_REPLACE_FUNC], # equivalent of AC_CHECK_FUNC, then call AC_LIBOBJ if the function # was not found. AC_DEFUN([AC_REPLACE_FUNCS], +[AS_LITERAL_IF([$1], [m4_map_args_w([$1], [_AC_REPLACE_FUNC(], [) -])]) +])], +[AC_CHECK_FUNCS([$1], + [_AH_CHECK_FUNC([$ac_func])AC_DEFINE(AS_TR_CPP([HAVE_$ac_func]))], + [_AC_LIBOBJ([$ac_func])])])]) # AC_TRY_LINK_FUNC(FUNC, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) diff --git a/tests/semantics.at b/tests/semantics.at index 48136cd2..9fd08e04 100644 --- a/tests/semantics.at +++ b/tests/semantics.at @@ -176,8 +176,13 @@ AT_DATA([config.in], ]) AT_CONFIGURE_AC( -[AC_CONFIG_FILES(config.libobjs:config.in) -AC_REPLACE_FUNCS(printf autoconf_ftnirp)]) +[AC_CONFIG_FILES([config.libobjs:config.in]) +AC_REPLACE_FUNCS([printf autoconf_ftnirp]) +funcs='fprintf autoconf_ftnirpf' +AH_TEMPLATE([HAVE_FPRINTF], []) +AH_TEMPLATE([HAVE_AUTOCONF_FTNIRPF], []) +AC_REPLACE_FUNCS([$funcs]) +AS_UNSET([funcs])]) AT_CHECK_AUTOCONF([-W obsolete]) AT_CHECK_AUTOHEADER @@ -185,11 +190,13 @@ AT_CHECK_CONFIGURE AT_CHECK_ENV AT_CHECK_DEFINES( [/* #undef HAVE_AUTOCONF_FTNIRP */ +/* #undef HAVE_AUTOCONF_FTNIRPF */ +#define HAVE_FPRINTF 1 #define HAVE_PRINTF 1 ]) AT_CHECK([sed 's/ */ /g;s/^ //;s/ $//' config.libobjs], [], - [${LIBOBJDIR}autoconf_ftnirp$U.o + [${LIBOBJDIR}autoconf_ftnirp$U.o ${LIBOBJDIR}autoconf_ftnirpf$U.o ]) AT_CLEANUP -- 2.11.4.GIT