From d145543abd200b77a3c2ae3325f1fafd36157372 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 5 Feb 2001 10:16:32 +0000 Subject: [PATCH] acfunctions.m4 was still using the old AC_LIBOBJ_DECL. Reported by Derek R. Price. * tests/semantics.at (AC_REPLACE_FUNCS): New test. * acfunctions.m4 (AC_REPLACE_FUNCS, _AC_LIBOBJ_ALLOCA): Use AC_LIBSOURCES. --- ChangeLog | 9 +++++++++ THANKS | 1 + acfunctions.m4 | 6 +++--- lib/autoconf/functions.m4 | 6 +++--- tests/aclocal.m4 | 2 +- tests/semantics.at | 31 +++++++++++++++++++++++++++++++ 6 files changed, 48 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d90e46dc..0c005a14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-02-05 Akim Demaille + + acfunctions.m4 was still using the old AC_LIBOBJ_DECL. + Reported by Derek R. Price. + + * tests/semantics.at (AC_REPLACE_FUNCS): New test. + * acfunctions.m4 (AC_REPLACE_FUNCS, _AC_LIBOBJ_ALLOCA): Use + AC_LIBSOURCES. + 2001-02-03 Pavel Roskin * tests/base.at (AC_TRY_COMMAND): Add a colon between "then" and diff --git a/THANKS b/THANKS index 818bb979..ad67c813 100644 --- a/THANKS +++ b/THANKS @@ -32,6 +32,7 @@ Daniele Arena daniele@ripe.net Dave Adams adams@hpesdwa.fc.hp.com Dave Love fx@gnu.org David Morgan dmorgan@symark.com +Derek R. Price derek.price@openavenue.com Didier Desseaux didess@infonie.fr Didier Verna didier@xemacs.org Dietmar P. Schindler schd@mra.man.de diff --git a/acfunctions.m4 b/acfunctions.m4 index 6f4fb021..048027d6 100644 --- a/acfunctions.m4 +++ b/acfunctions.m4 @@ -92,7 +92,7 @@ done # AC_REPLACE_FUNCS(FUNCTION...) # ----------------------------- AC_DEFUN([AC_REPLACE_FUNCS], -[AC_FOREACH([AC_Func], [$1], [AC_LIBOBJ_DECL(AC_Func)])dnl +[AC_FOREACH([AC_Func], [$1], [AC_LIBSOURCE(AC_Func.c)])dnl AC_CHECK_FUNCS([$1], , [_AC_LIBOBJ($ac_func)]) ]) @@ -129,13 +129,13 @@ AU_ALIAS([AC_HAVE_FUNCS], [AC_CHECK_FUNCS]) # ----------------- # Set up the LIBOBJ replacement of `alloca'. Well, not exactly # AC_LIBOBJ since we actually set the output variable `ALLOCA'. -# Nevertheless, for Automake, AC_LIBOBJ_DECL it. +# Nevertheless, for Automake, AC_LIBSOURCES it. m4_define([_AC_LIBOBJ_ALLOCA], [# The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. -AC_LIBOBJ_DECL(alloca) +AC_LIBSOURCES(alloca.c) AC_SUBST(ALLOCA, alloca.$ac_objext)dnl AC_DEFINE(C_ALLOCA, 1, [Define if using `alloca.c'.]) diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index 6f4fb021..048027d6 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -92,7 +92,7 @@ done # AC_REPLACE_FUNCS(FUNCTION...) # ----------------------------- AC_DEFUN([AC_REPLACE_FUNCS], -[AC_FOREACH([AC_Func], [$1], [AC_LIBOBJ_DECL(AC_Func)])dnl +[AC_FOREACH([AC_Func], [$1], [AC_LIBSOURCE(AC_Func.c)])dnl AC_CHECK_FUNCS([$1], , [_AC_LIBOBJ($ac_func)]) ]) @@ -129,13 +129,13 @@ AU_ALIAS([AC_HAVE_FUNCS], [AC_CHECK_FUNCS]) # ----------------- # Set up the LIBOBJ replacement of `alloca'. Well, not exactly # AC_LIBOBJ since we actually set the output variable `ALLOCA'. -# Nevertheless, for Automake, AC_LIBOBJ_DECL it. +# Nevertheless, for Automake, AC_LIBSOURCES it. m4_define([_AC_LIBOBJ_ALLOCA], [# The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. -AC_LIBOBJ_DECL(alloca) +AC_LIBSOURCES(alloca.c) AC_SUBST(ALLOCA, alloca.$ac_objext)dnl AC_DEFINE(C_ALLOCA, 1, [Define if using `alloca.c'.]) diff --git a/tests/aclocal.m4 b/tests/aclocal.m4 index 27f9478c..a584c1e5 100644 --- a/tests/aclocal.m4 +++ b/tests/aclocal.m4 @@ -53,5 +53,5 @@ m4_defun([AC_STATE_SAVE], grep '^m4_defn([m4_re_word])=' >state-env.$1 test $? = 0 || rm -f state-env.$1 -ls -1 | egrep -v '^(state.*|config\.)' | sort >state-ls.$1 +ls -1 | egrep -v '^(at-|state-|config\.)' | sort >state-ls.$1 ])# AC_STATE_SAVE diff --git a/tests/semantics.at b/tests/semantics.at index 57defd09..c17c1835 100644 --- a/tests/semantics.at +++ b/tests/semantics.at @@ -47,6 +47,37 @@ AT_CHECK_MACRO([AC_CHECK_FUNCS], ])]) +# AC_REPLACE_FUNCS +# ---------------- +# Check that it performs the correct actions: autoconf_ftnirp.c must +# be compiled, and must define HAVE_PRINTF, but not HAVE_AUTOCONF_FTNIRP +# FIXME: Maybe check the traces? +AT_SETUP([AC_REPLACE_FUNCS]) + +AT_DATA([config.in], +[@LIBOBJS@ +]) + +AT_CONFIGURE_AC( +[AC_CONFIG_FILES(config.libobjs:config.in) +AC_REPLACE_FUNCS(printf autoconf_ftnirp)]) + +AT_CHECK_AUTOCONF([-W obsolete]) +AT_CHECK_AUTOHEADER +AT_CHECK_CONFIGURE +AT_CHECK_ENV +AT_CHECK_DEFINES( +[/* #undef HAVE_AUTOCONF_FTNIRP */ +#define HAVE_PRINTF 1 +]) + +AT_CHECK([sed 's/ */ /g;s/^ //;s/ $//' config.libobjs], [], + [autoconf_ftnirp.o +]) + +AT_CLEANUP([config.libobjs]) + + # AC_CHECK_HEADERS # ---------------- # Check that it performs the correct actions: