--update update the current package, restore files omitted
from version control
--create-testdir create a scratch package with the given modules
- (pass --with-tests to include the unit tests)
--create-megatestdir create a mega scratch package with the given modules
one by one and all together
- (pass --with-tests to include the unit tests)
--test test the combination of the given modules
- (pass --with-tests to include the unit tests)
(recommended to use CC=\"gcc -Wall\" here)
--megatest test the given modules one by one and all together
- (pass --with-tests to include the unit tests)
(recommended to use CC=\"gcc -Wall\" here)
--extract-description extract the description
--extract-comment extract the comment
--extract-maintainer report the maintainer(s) inside gnulib
--extract-tests-module report the unit test module, if it exists
--copy-file copy a file that is not part of any module
+ --help Show this help text.
+ --version Show version and authorship information.
General options:
--dry-run Only print what would have been done.
+Options for --import, --add/remove-import:
+
+ --with-tests Include unit tests for the included modules.
+
+Options for --create-[mega]testdir, --[mega]test:
+
+ --without-tests Don't include unit tests for the included modules.
+
Options for --import, --add/remove-import,
--create-[mega]testdir, --[mega]test:
- --with-tests Include unit tests for the included modules.
--with-obsolete Include obsolete modules when they occur among the
dependencies. By default, dependencies to obsolete
modules are ignored.
--with-c++-tests Include even unit tests for C++ interoperability.
+ --without-c++-tests Exclude unit tests for C++ interoperability.
--with-longrunning-tests
Include even unit tests that are long-runners.
+ --without-longrunning-tests
+ Exclude unit tests that are long-runners.
--with-privileged-tests
Include even unit tests that require root
privileges.
+ --without-privileged-tests
+ Exclude unit tests that require root privileges.
--with-unportable-tests
Include even unit tests that fail on some platforms.
+ --without-unportable-tests
+ Exclude unit tests that fail on some platforms.
--with-all-tests Include all kinds of problematic unit tests.
--avoid=MODULE Avoid including the given MODULE. Useful if you
have code that provides equivalent functionality.
Options for --create-[mega]testdir, --[mega]test:
- --without-c++-tests Exclude unit tests for C++ interoperability.
- --without-longrunning-tests
- Exclude unit tests that are long-runners.
- --without-privileged-tests
- Exclude unit tests that require root privileges.
- --without-unportable-tests
- Exclude unit tests that fail on some platforms.
--single-configure Generate a single configure file, not a separate
configure file for the tests directory.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
-
-Written by" "Bruno Haible" "and" "Simon Josefsson"
+"
+ printf "Written by %s, %s, and %s.\n" "Bruno Haible" "Paul Eggert" "Simon Josefsson"
}
# func_emit_copyright_notice
# func_readlink SYMLINK
# outputs the target of the given symlink.
-if (type -p readlink) > /dev/null 2>&1; then
+if (type readlink) > /dev/null 2>&1; then
func_readlink ()
{
# Use the readlink program from GNU coreutils.
# Command-line option processing.
# Removes the OPTIONS from the arguments. Sets the variables:
-# - mode list or import or add-import or remove-import or update
-# or create-testdir or create-megatestdir
+# - mode one of: list, find, import, add-import, remove-import,
+# update, create-testdir, create-megatestdir, test, megatest,
+# copy-file
# - destdir from --dir
# - local_gnulib_dir from --local-dir
# - modcache true or false, from --cache-modules/--no-cache-modules
# - docbase from --doc-base
# - testsbase from --tests-base
# - auxdir from --aux-dir
-# - inctests true if --with-tests was given, blank otherwise
+# - inctests true if --with-tests was given, false if --without-tests
+# was given, blank otherwise
# - incobsolete true if --with-obsolete was given, blank otherwise
# - inc_cxx_tests true if --with-c++-tests was given, blank otherwise
# - inc_longrunning_tests true if --with-longrunning-tests was given, blank
--with-all-tests | --with-all-test | --with-all-tes | --with-all-te | --with-all-t | --with-all- | --with-all | --with-al | --with-a)
inc_all_tests=true
shift ;;
+ --without-tests | --without-test | --without-tes | --without-te | --without-t)
+ inctests=false
+ shift ;;
--without-c++-tests | --without-c++-test | --without-c++-tes | --without-c++-te | --without-c++-t | --without-c++- | --without-c++ | --without-c+ | --without-c)
excl_cxx_tests=true
shift ;;
func_exit 1
fi
fi
- # This code helps migrating from --import to --add-import or --update. It can
- # be removed on 2012-01-01.
- if test "$mode" = import && test $# = 0; then
- echo "gnulib-tool: cowardly refusing to erase the module list." 1>&2
- echo "The meaning of the option '--import' has changed." 1>&2
- echo "See the documentation at" 1>&2
- echo "<http://www.gnu.org/software/gnulib/manual/html_node/Modified-imports.html>." 1>&2
- echo "For updating to a newer version of gnulib, use" 1>&2
- echo " gnulib-tool --add-import" 1>&2
- echo "For restoring files that were omitted from version control, use" 1>&2
- echo " gnulib-tool --update" 1>&2
- func_exit 1
- fi
if test "$mode" = update; then
if test $# != 0; then
echo "gnulib-tool: too many arguments in 'update' mode" 1>&2
if test -z "$pobase" && test -n "$po_domain"; then
func_warning "--po-domain has no effect without a --po-base option"
fi
- if test "$cond_dependencies" = true && test -n "$inctests"; then
+ # Canonicalize the inctests variable.
+ case "$mode" in
+ import | add-import | remove-import | update)
+ if test -z "$inctests"; then
+ inctests=false
+ fi
+ ;;
+ create-testdir | create-megatestdir | test | megatest)
+ if test -z "$inctests"; then
+ inctests=true
+ fi
+ ;;
+ esac
+ # Now the only possible values of "$inctests" are true and false
+ # (or blank but then it is irrelevant).
+ if test "$cond_dependencies" = true && test "$inctests" = true; then
echo "gnulib-tool: option --conditional-dependencies is not supported with --with-tests" 1>&2
func_exit 1
fi
# - local_gnulib_dir from --local-dir
# - modcache true or false, from --cache-modules/--no-cache-modules
# - modules list of specified modules
-# - inctests true if tests should be included, blank otherwise
+# - inctests true if tests should be included, false otherwise
# - incobsolete true if obsolete modules among dependencies should be
# included, blank otherwise
# - inc_cxx_tests true if C++ interoperability tests should be included,
if test -n "$duplicated_deps"; then
func_warning "module $module has duplicated dependencies: "`echo $duplicated_deps`
fi
- if test -n "$inctests"; then
+ if $inctests; then
testsmodule=`func_get_tests_module $module`
if test -n "$testsmodule"; then
deps="$deps $testsmodule"
# - local_gnulib_dir from --local-dir
# - modcache true or false, from --cache-modules/--no-cache-modules
# - specified_modules list of specified modules
-# - inctests true if tests should be included, blank otherwise
+# - inctests true if tests should be included, false otherwise
# - incobsolete true if obsolete modules among dependencies should be
# included, blank otherwise
# - inc_cxx_tests true if C++ interoperability tests should be included,
{
# Determine main module list.
saved_inctests="$inctests"
- inctests=""
+ inctests=false
modules="$specified_modules"
func_modules_transitive_closure
main_modules="$modules"
|| { test -n "$lsymbolic" \
&& test "$lookedup_file" = "$local_gnulib_dir/$f"; }; } \
&& test -z "$lookedup_tmp" \
- && cmp "$lookedup_file" "$tmpfile" > /dev/null; then
+ && cmp -s "$lookedup_file" "$tmpfile"; then
func_ln_if_changed "$lookedup_file" "$destdir/$g"
else
mv -f "$tmpfile" "$destdir/${g}" || func_fatal_error "failed"
# - already_present nonempty if the file should already exist, empty otherwise
func_update_file ()
{
- if cmp "$destdir/$g" "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir/$g" "$tmpfile"; then
: # The file has not changed.
else
# Replace the file.
|| { test -n "$lsymbolic" \
&& test "$lookedup_file" = "$local_gnulib_dir/$f"; }; } \
&& test -z "$lookedup_tmp" \
- && cmp "$lookedup_file" "$tmpfile" > /dev/null; then
+ && cmp -s "$lookedup_file" "$tmpfile"; then
func_ln_if_changed "$lookedup_file" "$destdir/$g"
else
mv -f "$tmpfile" "$destdir/${g}" || func_fatal_error "failed"
echo "noinst_HEADERS ="
echo "noinst_LIBRARIES ="
echo "noinst_LTLIBRARIES ="
- # Automake versions < 1.9b create an empty pkgdatadir at installation time
- # if you specify pkgdata_DATA to empty. This is a workaround.
+ # Automake versions < 1.11.4 create an empty pkgdatadir at
+ # installation time if you specify pkgdata_DATA to empty.
+ # See automake bugs #10997 and #11030:
+ # * http://debbugs.gnu.org/10997
+ # * http://debbugs.gnu.org/11030
+ # So we need this workaround.
if grep '^pkgdata_DATA *+=' "$tmp"/allsnippets > /dev/null; then
echo "pkgdata_DATA ="
fi
echo "check_LIBRARIES = libtests.a"
fi
fi
- # Automake versions < 1.9b create an empty pkgdatadir at installation time
- # if you specify pkgdata_DATA to empty. This is a workaround.
+ # Automake versions < 1.11.4 create an empty pkgdatadir at
+ # installation time if you specify pkgdata_DATA to empty.
+ # See automake bugs #10997 and #11030:
+ # * http://debbugs.gnu.org/10997
+ # * http://debbugs.gnu.org/11030
+ # So we need this workaround.
if grep '^pkgdata_DATA *+=' "$tmp"/main_snippets "$tmp"/longrunning_snippets > /dev/null; then
echo "pkgdata_DATA ="
fi
# - docbase directory relative to destdir where to place doc files
# - testsbase directory relative to destdir where to place unit test code
# - auxdir directory relative to destdir where to place build aux files
-# - inctests true if --with-tests was given, blank otherwise
+# - inctests true if --with-tests was given, false otherwise
# - incobsolete true if --with-obsolete was given, blank otherwise
# - inc_cxx_tests true if --with-c++-tests was given, blank otherwise
# - inc_longrunning_tests true if --with-longrunning-tests was given, blank
fi
fi
# Require the tests if specified either way.
- if test -z "$inctests"; then
+ if ! $inctests; then
inctests="$cached_inctests"
+ if test -z "$inctests"; then
+ inctests=false
+ fi
fi
# The libname defaults to the cached one.
if test -z "$supplied_libname"; then
vc_files="$cached_vc_files"
fi
# Ensure constraints.
- if test "$cond_dependencies" = true && test -n "$inctests"; then
+ if test "$cond_dependencies" = true && $inctests; then
echo "gnulib-tool: option --conditional-dependencies is not supported with --with-tests" 1>&2
func_exit 1
fi
if test -n "$docfiles"; then
echo "$docbase"
fi
- if test -n "$inctests"; then
+ if $inctests; then
echo "$testsbase"
fi
echo "$auxdir"
func_append actioncmd " --doc-base=$docbase"
func_append actioncmd " --tests-base=$testsbase"
func_append actioncmd " --aux-dir=$auxdir"
- if test -n "$inctests"; then
+ if $inctests; then
func_append actioncmd " --with-tests"
fi
if test -n "$incobsolete"; then
pobase_base=`basename "$pobase"`
func_note_Makefile_am_edit "$pobase_dir" SUBDIRS "$pobase_base"
fi
- if test -n "$inctests"; then
+ if $inctests; then
if test "$makefile_am" = Makefile.am; then
testsbase_dir=`echo "$testsbase" | sed -n -e 's,/[^/]*$,/,p'`
testsbase_base=`basename "$testsbase"`
&& ! { test -f "${destdir}/${dir1}Makefile.am" \
|| test "${dir1}Makefile.am" = "$sourcebase/$makefile_am" \
|| test "./${dir1}Makefile.am" = "$sourcebase/$makefile_am" \
- || { test -n "$inctests" \
+ || { $inctests \
&& { test "${dir1}Makefile.am" = "$testsbase/$makefile_am" \
|| test "./${dir1}Makefile.am" = "$testsbase/$makefile_am"; }; }; }; do
dir2=`echo "$dir1" | sed -e "$sed_last"`"$dir2"
modules="$main_modules"
func_emit_lib_Makefile_am > "$tmpfile"
if test -f "$destdir"/$sourcebase/$makefile_am; then
- if cmp "$destdir"/$sourcebase/$makefile_am "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir"/$sourcebase/$makefile_am "$tmpfile"; then
rm -f "$tmpfile"
else
if $doit; then
func_lookup_file build-aux/po/$file
cat "$lookedup_file" > "$tmpfile"
if test -f "$destdir"/$pobase/$file; then
- if cmp "$destdir"/$pobase/$file "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir"/$pobase/$file "$tmpfile"; then
rm -f "$tmpfile"
else
if $doit; then
func_dest_tmpfilename $pobase/Makevars
func_emit_po_Makevars > "$tmpfile"
if test -f "$destdir"/$pobase/Makevars; then
- if cmp "$destdir"/$pobase/Makevars "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir"/$pobase/Makevars "$tmpfile"; then
rm -f "$tmpfile"
else
if $doit; then
func_dest_tmpfilename $pobase/POTFILES.in
func_emit_po_POTFILES_in > "$tmpfile"
if test -f "$destdir"/$pobase/POTFILES.in; then
- if cmp "$destdir"/$pobase/POTFILES.in "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir"/$pobase/POTFILES.in "$tmpfile"; then
rm -f "$tmpfile"
else
if $doit; then
}
) > "$tmpfile"
if test -f "$destdir"/$pobase/LINGUAS; then
- if cmp "$destdir"/$pobase/LINGUAS "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir"/$pobase/LINGUAS "$tmpfile"; then
rm -f "$tmpfile"
else
echo "Updating $pobase/LINGUAS (backup in $pobase/LINGUAS~)"
echo "gl_PO_BASE([$pobase])"
echo "gl_DOC_BASE([$docbase])"
echo "gl_TESTS_BASE([$testsbase])"
- test -z "$inctests" || echo "gl_WITH_TESTS"
+ if $inctests; then
+ echo "gl_WITH_TESTS"
+ fi
echo "gl_LIB([$libname])"
if test -n "$lgpl"; then
if test "$lgpl" = yes; then
fi
echo "gl_MACRO_PREFIX([$macro_prefix])"
echo "gl_PO_DOMAIN([$po_domain])"
- echo "gl_WITNESS_C_DOMAIN([$witness_c_macro])"
+ echo "gl_WITNESS_C_MACRO([$witness_c_macro])"
if test -n "$vc_files"; then
echo "gl_VC_FILES([$vc_files])"
fi
) > "$tmpfile"
if test -f "$destdir"/$m4base/gnulib-cache.m4; then
- if cmp "$destdir"/$m4base/gnulib-cache.m4 "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir"/$m4base/gnulib-cache.m4 "$tmpfile"; then
rm -f "$tmpfile"
else
if $doit; then
echo "])"
) > "$tmpfile"
if test -f "$destdir"/$m4base/gnulib-comp.m4; then
- if cmp "$destdir"/$m4base/gnulib-comp.m4 "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir"/$m4base/gnulib-comp.m4 "$tmpfile"; then
rm -f "$tmpfile"
else
if $doit; then
fi
fi
- if test -n "$inctests"; then
+ if $inctests; then
# Create tests makefile.
func_dest_tmpfilename $testsbase/$makefile_am
destfile="$testsbase/$makefile_am"
modules="$testsrelated_modules"
func_emit_tests_Makefile_am "${macro_prefix}tests_WITNESS" > "$tmpfile"
if test -f "$destdir"/$testsbase/$makefile_am; then
- if cmp "$destdir"/$testsbase/$makefile_am "$tmpfile" > /dev/null; then
+ if cmp -s "$destdir"/$testsbase/$makefile_am "$tmpfile"; then
rm -f "$tmpfile"
else
if $doit; then
if test -n "$pobase"; then
echo " - add \"$pobase/Makefile.in\" to AC_CONFIG_FILES in $configure_ac,"
fi
- if test -n "$inctests"; then
+ if $inctests; then
if test "$makefile_am" = Makefile.am; then
echo " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES in $configure_ac,"
else
# - local_gnulib_dir from --local-dir
# - modcache true or false, from --cache-modules/--no-cache-modules
# - auxdir directory relative to destdir where to place build aux files
-# - inctests true if tests should be included, blank otherwise
+# - inctests true if tests should be included, false otherwise
# - incobsolete true if obsolete modules among dependencies should be
# included, blank otherwise
# - excl_cxx_tests true if C++ interoperability tests should be excluded,
# its dependencies.
saved_inctests="$inctests"
# When computing transitive closures, don't consider $module to depend on
- # $module-tests. Need this becauses tests are implicitly GPL and may depend
+ # $module-tests. Need this because tests are implicitly GPL and may depend
# on GPL modules - therefore we don't want a warning in this case.
- inctests=""
+ inctests=false
for requested_module in $specified_modules; do
requested_license=`func_get_license "$requested_module"`
if test "$requested_license" != GPL; then
func_append subdirs " po"
fi
- if test -n "$inctests"; then
+ if $inctests; then
test -d "$testdir/$testsbase" || mkdir "$testdir/$testsbase"
if $single_configure; then
# Create $testsbase/Makefile.am.
func_execute_command ${AUTOHEADER} || func_exit 1
func_execute_command ${AUTOMAKE} --add-missing --copy || func_exit 1
) || func_exit 1
- if test -n "$inctests" && ! $single_configure; then
+ if $inctests && ! $single_configure; then
# Create autogenerated files.
(cd "$testdir/$testsbase" || func_exit 1
# Do not use "${AUTORECONF} --force --install", because it may invoke
esac;
done`
tests_distributed_built_sources=
- if test -n "$inctests"; then
+ if $inctests; then
# Likewise for built files in the $testsbase directory.
tests_cleaned_files=`sed -e "$sed_remove_backslash_newline" < "$testdir/$testsbase/Makefile.am" \
| sed -n -e 's,^CLEANFILES[ ]*+=\([^#]*\).*$,\1,p' -e 's,^MOSTLYCLEANFILES[ ]*+=\([^#]*\).*$,\1,p'`