New module 'iconv_open-utf': Enhance iconv_open to support UTF-{16,32}{BE,LE}.
[gnulib.git] / gnulib-tool
index 593b8f1..1003f4c 100755 (executable)
@@ -2,10 +2,10 @@
 #
 # Copyright (C) 2002-2007 Free Software Foundation, Inc.
 #
-# This program is free software; you can redistribute it and/or modify
+# This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -13,8 +13,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 # This program is meant for authors or maintainers which want to import
@@ -1247,6 +1246,18 @@ func_get_automake_snippet ()
   case "$1" in
     *-tests)
       # *-tests module live in tests/, not lib/.
+      # Synthesize an EXTRA_DIST augmentation.
+      all_files=`func_get_filelist $1`
+      tests_files=`for f in $all_files; do \
+                     case $f in \
+                       tests/*) echo $f ;; \
+                     esac; \
+                   done | sed -e 's,^tests/,,'`
+      extra_files="$tests_files"
+      if test -n "$extra_files"; then
+        echo "EXTRA_DIST +=" $extra_files
+        echo
+      fi
       ;;
     *)
       # Synthesize an EXTRA_DIST augmentation.
@@ -1938,23 +1949,31 @@ 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 "  [AS_LITERAL_IF([\$1], [${macro_prefix}_LIBSOURCES([\$1.c])])dnl"
-  echo "  ${macro_prefix}_LIBOBJS=\"\$${macro_prefix}_LIBOBJS \$1.\$ac_objext\"])"
+  echo "AC_DEFUN([${macro_prefix}_LIBOBJ], ["
+  echo "  AS_LITERAL_IF([\$1], [${macro_prefix}_LIBSOURCES([\$1.c])])dnl"
+  echo "  ${macro_prefix}_LIBOBJS=\"\$${macro_prefix}_LIBOBJS \$1.\$ac_objext\""
+  echo "])"
   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 "  [m4_foreach_w([gl_NAME], [\$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl"
-  echo "  AC_CHECK_FUNCS([\$1], , [${macro_prefix}_LIBOBJ(\$ac_func)])])"
+  echo "AC_DEFUN([${macro_prefix}_REPLACE_FUNCS], ["
+  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
-  echo "# Like AC_LIBSOURCES, except check for typos now."
-  echo "# We rely on EXTRA_lib..._SOURCES instead."
-  echo "AC_DEFUN([${macro_prefix}_LIBSOURCES],"
-  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)])])])"
+  echo "# Like AC_LIBSOURCES, except the directory where the source file is"
+  echo "# expected is derived from the gnulib-tool parametrization,"
+  echo "# and alloca is special cased (for the alloca-opt module)."
+  echo "# We could also entirely rely on EXTRA_lib..._SOURCES."
+  echo "AC_DEFUN([${macro_prefix}_LIBSOURCES], ["
+  echo "  m4_foreach([_gl_NAME], [\$1], ["
+  echo "    m4_if(_gl_NAME, [alloca.c], [], ["
+  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)])"
+  echo "    ])"
+  echo "  ])"
+  echo "])"
 }
 
 # func_import modules