changeset 9232:01d4e199e19f

Enforce that AC_REPLACE_FUNCS files exist. * gnulib-tool (func_emit_initmacro_done): Make AC_LIBSOURCES override check for typos. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Tue, 25 Sep 2007 07:11:35 -0600
parents fca4f828f7a2
children f5b68edd82c4
files ChangeLog gnulib-tool
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Sep 28 07:16:44 2007 -0600
+++ b/ChangeLog	Tue Sep 25 07:11:35 2007 -0600
@@ -1,5 +1,9 @@
 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.
--- a/gnulib-tool	Fri Sep 28 07:16:44 2007 -0600
+++ b/gnulib-tool	Tue Sep 25 07:11:35 2007 -0600
@@ -1932,23 +1932,29 @@
 # 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