2007-09-28 Eric Blake <ebb9@byu.net>
+ Enforce that AC_REPLACE_FUNCS files exist.
+ * gnulib-tool (func_emit_initmacro_done): Make AC_LIBSOURCES
+ override check for typos.
+
Fix test-closein on Solaris 10.
* tests/test-closein.c (main): Don't assume stdin can be inherited
closed on all systems.
# func_emit_initmacro_done
# emits a few statements after the gl_INIT macro to standard output.
# - macro_prefix prefix of gl_EARLY, gl_INIT macros to use
+# - sourcebase directory relative to destdir where to place source code
func_emit_initmacro_done ()
{
echo
echo "# Like AC_LIBOBJ, except that the module name goes"
echo "# into ${macro_prefix}_LIBOBJS instead of into LIBOBJS."
echo "AC_DEFUN([${macro_prefix}_LIBOBJ],"
- echo " [${macro_prefix}_LIBOBJS=\"\$${macro_prefix}_LIBOBJS \$1.\$ac_objext\"])"
+ echo " [AS_LITERAL_IF([\$1], [${macro_prefix}_LIBSOURCES([\$1.c])])dnl"
+ echo " ${macro_prefix}_LIBOBJS=\"\$${macro_prefix}_LIBOBJS \$1.\$ac_objext\"])"
echo
echo "# Like AC_REPLACE_FUNCS, except that the module name goes"
echo "# into ${macro_prefix}_LIBOBJS instead of into LIBOBJS."
echo "AC_DEFUN([${macro_prefix}_REPLACE_FUNCS],"
- echo " [AC_CHECK_FUNCS([\$1], , [${macro_prefix}_LIBOBJ(\$ac_func)])])"
+ echo " [m4_foreach_w([gl_NAME], [\$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl"
+ echo " AC_CHECK_FUNCS([\$1], , [${macro_prefix}_LIBOBJ(\$ac_func)])])"
echo
- echo "# Like AC_LIBSOURCES, except that it does nothing."
+ echo "# Like AC_LIBSOURCES, except check for typos now."
echo "# We rely on EXTRA_lib..._SOURCES instead."
echo "AC_DEFUN([${macro_prefix}_LIBSOURCES],"
- echo " [])"
+ echo " [m4_foreach([_gl_NAME], [\$1],"
+ echo " [m4_syscmd([test -r $sourcebase/]_gl_NAME[ || test ! -d $sourcebase])dnl"
+ echo " m4_if(m4_sysval, [0], [],"
+ echo " [AC_FATAL([missing $sourcebase/]_gl_NAME)])])])"
}
# func_import modules