+
+ if test "$mode" = update; then
+ if test $# != 0; then
+ echo "gnulib-tool: too many arguments in 'update' mode" 1>&2
+ echo "Try 'gnulib-tool --help' for more information." 1>&2
+ echo "If you really want to modify the gnulib configuration of your project," 1>&2
+ echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
+ func_exit 1
+ fi
+ if test -n "$local_gnulib_dir" || test -n "$supplied_libname" \
+ || test -n "$sourcebase" || test -n "$m4base" || test -n "$pobase" \
+ || test -n "$docbase" || test -n "$testsbase" || test -n "$auxdir" \
+ || test -n "$inctests" || test -n "$avoidlist" || test -n "$lgpl" \
+ || test -n "$makefile_name" || test -n "$macro_prefix" \
+ || test -n "$po_domain"; then
+ echo "gnulib-tool: invalid options for 'update' mode" 1>&2
+ echo "Try 'gnulib-tool --help' for more information." 1>&2
+ echo "If you really want to modify the gnulib configuration of your project," 1>&2
+ echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
+ func_exit 1
+ fi
+ do_changelog=false
+ fi
+ if test -n "$pobase" && test -z "$po_domain"; then
+ echo "gnulib-tool: together with --po-base, you need to specify --po-domain" 1>&2
+ echo "Try 'gnulib-tool --help' for more information." 1>&2
+ func_exit 1
+ fi
+ if test -z "$pobase" && test -n "$po_domain"; then
+ echo "gnulib-tool: warning: --po-domain has no effect without a --po-base option" 1>&2
+ fi
+
+ # Determine the minimum supported autoconf version from the project's
+ # configure.ac.
+ DEFAULT_AUTOCONF_MINVERSION="2.59"
+ autoconf_minversion=
+ configure_ac=
+ if { test "$mode" = import || test "$mode" = update; } && test -n "$destdir"; then
+ if test -f "$destdir"/configure.ac; then
+ configure_ac="$destdir/configure.ac"
+ else
+ if test -f "$destdir"/configure.in; then
+ configure_ac="$destdir/configure.in"
+ fi
+ fi
+ else
+ if test -f configure.ac; then
+ configure_ac="configure.ac"
+ else
+ if test -f configure.in; then
+ configure_ac="configure.in"
+ fi
+ fi
+ fi
+ if test -n "$configure_ac"; then
+ # Use sed, not autoconf --trace, to look for the AC_PREREQ invocation,
+ # because when some m4 files are omitted from a CVS repository,
+ # "autoconf --trace=AC_PREREQ" fails with an error message like this:
+ # m4: aclocal.m4:851: Cannot open m4/absolute-header.m4: No such file or directory
+ # autom4te: m4 failed with exit status: 1
+ prereqs=
+ my_sed_traces='
+ s,#.*$,,
+ s,^dnl .*$,,
+ s, dnl .*$,,
+ /AC_PREREQ/ {
+ s,^.*AC_PREREQ([[ ]*\([^])]*\).*$,\1,p
+ }'
+ prereqs=`sed -n -e "$my_sed_traces" < "$configure_ac"`
+ if test -n "$prereqs"; then
+ autoconf_minversion=`
+ for version in $prereqs; do echo $version; done |
+ LC_ALL=C sort -nru | sed 1q
+ `
+ fi
+ fi
+ if test -z "$autoconf_minversion"; then
+ autoconf_minversion=$DEFAULT_AUTOCONF_MINVERSION
+ fi
+ case "$autoconf_minversion" in
+ 1.* | 2.[0-4]* | 2.5[0-8]*)
+ func_fatal_error "minimum supported autoconf version is 2.59. Try adding AC_PREREQ([$DEFAULT_AUTOCONF_MINVERSION]) to your configure.ac." ;;
+ esac
+
+ # Remove trailing slashes from the directory names. This is necessary for
+ # m4base (to avoid an error in func_import) and optional for the others.
+ sed_trimtrailingslashes='s,\([^/]\)//*$,\1,'
+ case "$local_gnulib_dir" in
+ */ ) local_gnulib_dir=`echo "$local_gnulib_dir" | sed -e "$sed_trimtrailingslashes"` ;;
+ esac
+ case "$sourcebase" in
+ */ ) sourcebase=`echo "$sourcebase" | sed -e "$sed_trimtrailingslashes"` ;;
+ esac
+ case "$m4base" in
+ */ ) m4base=`echo "$m4base" | sed -e "$sed_trimtrailingslashes"` ;;
+ esac
+ case "$pobase" in
+ */ ) pobase=`echo "$pobase" | sed -e "$sed_trimtrailingslashes"` ;;
+ esac
+ case "$docbase" in
+ */ ) docbase=`echo "$docbase" | sed -e "$sed_trimtrailingslashes"` ;;
+ esac
+ case "$testsbase" in
+ */ ) testsbase=`echo "$testsbase" | sed -e "$sed_trimtrailingslashes"` ;;
+ esac
+ case "$auxdir" in
+ */ ) auxdir=`echo "$auxdir" | sed -e "$sed_trimtrailingslashes"` ;;
+ esac