Enforce that AC_REPLACE_FUNCS files exist.
authorEric Blake <ebb9@byu.net>
Tue, 25 Sep 2007 13:11:35 +0000 (07:11 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 28 Sep 2007 20:04:42 +0000 (14:04 -0600)
* gnulib-tool (func_emit_initmacro_done): Make AC_LIBSOURCES
override check for typos.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
gnulib-tool

index 9bfa63c..80a7159 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index f6c4a17..593b8f1 100755 (executable)
@@ -1932,23 +1932,29 @@ func_emit_initmacro_end ()
 # 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