progname=$0
package=gnulib
-cvsdatestamp='$Date: 2006-08-08 11:35:22 $'
+cvsdatestamp='$Date: 2006-08-21 18:49:51 $'
last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
(cd "$local_gnulib_dir/modules" && ls -1 | sed -e 's,\.diff$,,')
fi
} \
- | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^README$/d' -e '/^TEMPLATE$/d' -e '/^TEMPLATE-TESTS$/d' -e '/~$/d' \
+ | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^COPYING$/d' -e '/^README$/d' -e '/^TEMPLATE$/d' -e '/^TEMPLATE-TESTS$/d' -e '/~$/d' \
| sed -e '/-tests$/d' \
| LC_ALL=C sort \
| LC_ALL=C uniq
# verifies a module name
func_verify_module ()
{
- if ! { test -f "$gnulib_dir/modules/$module" \
- || { test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules" \
- && test -f "$local_gnulib_dir/modules/$module"; }; } \
- || test "CVS" = "$module" \
- || test "ChangeLog" = "$module" \
- || test "README" = "$module" \
- || test "TEMPLATE" = "$module" \
- || test "TEMPLATE-TESTS" = "$module"; then
+ if { test -f "$gnulib_dir/modules/$module" \
+ || { test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules" \
+ && test -f "$local_gnulib_dir/modules/$module"; }; } \
+ && test "CVS" != "$module" \
+ && test "ChangeLog" != "$module" \
+ && test "COPYING" != "$module" \
+ && test "README" != "$module" \
+ && test "TEMPLATE" != "$module" \
+ && test "TEMPLATE-TESTS" != "$module"; then
+ # OK, $module is a correct module name.
+ :
+ else
echo "gnulib-tool: module $module doesn't exist" 1>&2
module=
fi
# No need to generate dependencies since the sources are in gnulib, not here.
echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies"
echo
- echo "noinst_${perhapsLT}LIBRARIES = $libname.$libext"
+ (
+ for module in $modules; do
+ func_verify_nontests_module
+ if test -n "$module"; then
+ {
+ func_get_automake_snippet "$module" |
+ sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g'
+ if test "$module" = 'alloca'; then
+ echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@"
+ fi
+ } > amsnippet.tmp
+ # Skip the contents if its entirely empty.
+ if grep '[^ ]' amsnippet.tmp > /dev/null ; then
+ echo "## begin gnulib module $module"
+ echo
+ cat amsnippet.tmp
+ echo "## end gnulib module $module"
+ echo
+ fi
+ rm -f amsnippet.tmp
+ fi
+ done
+ ) > allsnippets.tmp
+ if grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *= *$libname\\.$libext\$" allsnippets.tmp > /dev/null; then
+ # One of the snippets already specifies an installation location for the
+ # library. Don't confuse automake by saying it should not be installed.
+ :
+ else
+ # By default, the generated library should not be installed.
+ echo "noinst_${perhapsLT}LIBRARIES = $libname.$libext"
+ fi
echo
echo "${libname}_${libext}_SOURCES ="
echo "${libname}_${libext}_LIBADD = @${perhapsLT}LIBOBJS@"
echo "noinst_HEADERS ="
- echo "pkgdata_DATA ="
+ if grep '^pkgdata_DATA *+=' allsnippets.tmp > /dev/null; then
+ echo "pkgdata_DATA ="
+ fi
echo "EXTRA_DIST ="
echo "BUILT_SOURCES ="
echo "SUFFIXES ="
echo
echo "AM_CPPFLAGS ="
echo
- for module in $modules; do
- func_verify_nontests_module
- if test -n "$module"; then
- {
- func_get_automake_snippet "$module" |
- sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g'
- if test "$module" = 'alloca'; then
- echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@"
- fi
- } > amsnippet.tmp
- # Skip the contents if its entirely empty.
- if grep '[^ ]' amsnippet.tmp > /dev/null ; then
- echo "## begin gnulib module $module"
- echo
- cat amsnippet.tmp
- echo "## end gnulib module $module"
- echo
- fi
- rm -f amsnippet.tmp
- fi
- done
+ cat allsnippets.tmp
echo
echo "mostlyclean-local: mostlyclean-generic"
echo " @test -z \"\$(MOSTLYCLEANDIRS)\" || \\"
echo " done"
echo
echo "# Makefile.am ends here"
+ rm -f allsnippets.tmp
}
# func_emit_tests_Makefile_am
echo
echo "ACLOCAL_AMFLAGS = -I ${testsbase_inverse}/${m4base}"
echo
+ (
+ for module in $modules; do
+ func_verify_tests_module
+ if test -n "$module"; then
+ func_get_automake_snippet "$module" > amsnippet.tmp
+ # Skip the contents if its entirely empty.
+ if grep '[^ ]' amsnippet.tmp > /dev/null ; then
+ echo "## begin gnulib module $module"
+ echo
+ cat amsnippet.tmp
+ echo "## end gnulib module $module"
+ echo
+ fi
+ rm -f amsnippet.tmp
+ fi
+ done
+ ) > allsnippets.tmp
# Nothing is being added to SUBDIRS; nevertheless the existence of this
# variable is needed to avoid an error from automake:
# "AM_GNU_GETTEXT used but SUBDIRS not defined"
echo "noinst_PROGRAMS ="
echo "check_PROGRAMS ="
echo "noinst_HEADERS ="
- echo "pkgdata_DATA ="
+ if grep '^pkgdata_DATA *+=' allsnippets.tmp > /dev/null; then
+ echo "pkgdata_DATA ="
+ fi
echo "EXTRA_DIST ="
echo "BUILT_SOURCES ="
echo "SUFFIXES ="
echo
echo "LDADD = ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext}"
echo
- for module in $modules; do
- func_verify_tests_module
- if test -n "$module"; then
- func_get_automake_snippet "$module" > amsnippet.tmp
- # Skip the contents if its entirely empty.
- if grep '[^ ]' amsnippet.tmp > /dev/null ; then
- echo "## begin gnulib module $module"
- echo
- cat amsnippet.tmp
- echo "## end gnulib module $module"
- echo
- fi
- rm -f amsnippet.tmp
- fi
- done
+ cat allsnippets.tmp
echo "# Clean up after Solaris cc."
echo "clean-local:"
echo " rm -rf SunWS_cache"
echo " done"
echo
echo "# Makefile.am ends here"
+ rm -f allsnippets.tmp
}
# func_import modules
echo "# any checks for libraries, header files, types and library functions."
echo "AC_DEFUN([${macro_prefix}_EARLY],"
echo "["
+ echo " m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace"
+ echo " m4_pattern_allow([^gl_ES$])dnl a valid locale name"
echo " AC_REQUIRE([AC_PROG_RANLIB])"
if grep AC_GNU_SOURCE "$destdir"/$m4base/*.m4 >/dev/null 2>/dev/null; then
echo " AC_REQUIRE([AC_GNU_SOURCE])"
echo "AC_PROG_CC"
echo "AC_PROG_INSTALL"
echo "AC_PROG_MAKE_SET"
+ echo
+ echo "m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace"
+ echo "m4_pattern_allow([^gl_ES$])dnl a valid locale name"
+ echo
echo "AC_PROG_RANLIB"
echo
if grep AC_GNU_SOURCE "$testdir"/m4/*.m4 >/dev/null 2>/dev/null; then