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-05 Akim Demaille <akim@epita.fr>
+
+ 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 <proski@gnu.org>
* tests/base.at (AC_TRY_COMMAND): Add a colon between "then" and
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
# 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)])
])
# -----------------
# 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'.])
# 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)])
])
# -----------------
# 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'.])
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
])])
+# 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: