3 # Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # This program is meant for authors or maintainers which want to import
21 # modules from gnulib into their packages.
25 cvsdatestamp='$Date: 2004-08-17 23:36:21 $'
26 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
27 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
29 # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH.
33 AUTOCONFBINDIR=/packages/gnu-inst-autoconf/2.57/bin
34 AUTOCONFPATH="eval env PATH=${AUTOCONFBINDIR}:\$PATH "
38 AUTOCONF="${AUTOCONFPATH}autoconf"
39 AUTOHEADER="${AUTOCONFPATH}autoheader"
40 AUTOMAKE="${AUTOCONFPATH}automake-1.7"
44 # outputs to stdout the --help usage message.
48 Usage: gnulib-tool --list
49 gnulib-tool --import [MODULE...]
50 gnulib-tool --create-testdir --dir=directory module1 ... moduleN
51 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN]
52 gnulib-tool --test --dir=directory module1 ... moduleN
53 gnulib-tool --megatest --dir=directory [module1 ... moduleN]
54 gnulib-tool --extract-description module
55 gnulib-tool --extract-filelist module
56 gnulib-tool --extract-dependencies module
57 gnulib-tool --extract-autoconf-snippet module
58 gnulib-tool --extract-automake-snippet module
59 gnulib-tool --extract-include-directive module
60 gnulib-tool --extract-maintainer module
63 --list print the available module names
64 --import import the given modules into the current package
65 --create-testdir create a scratch package with the given modules
66 --create-megatestdir create a mega scratch package with the given modules
67 one by one and all together
68 --test test the combination of the given modules
69 (recommended to use CC=\"gcc -Wall\" here)
70 --megatest test the given modules one by one and all together
71 (recommended to use CC=\"gcc -Wall\" here)
72 --extract-description extract the description
73 --extract-filelist extract the list of files
74 --extract-dependencies extract the dependencies
75 --extract-autoconf-snippet extract the snippet for configure.ac
76 --extract-automake-snippet extract the snippet for lib/Makefile.am
77 --extract-include-directive extract the #include directive
78 --extract-maintainer report the maintainer(s) inside gnulib
81 --dir=DIRECTORY specify the target directory
82 For --import, this specify where your
83 configure.ac can be found. Defaults to current
85 --lib=LIBRARY Specify the library name. Defaults to 'libgnu'.
86 --source-base=DIRECTORY
87 Directory relative --dir where source code is
88 placed (default \"lib\"), for --import.
89 --m4-base=DIRECTORY Directory relative --dir where *.m4 macros are
90 placed (default \"m4\"), for --import.
91 --libtool Use libtool rules, for --import.
92 --no-changelog don't update or create ChangeLog files
93 --dry-run For --import, only print what would have been done.
95 Report bugs to <bug-gnulib@gnu.org>."
99 # outputs to stdout the --version message.
102 echo "$progname (GNU $package) $version"
103 echo "Copyright (C) 2002 Free Software Foundation, Inc.
104 This is free software; see the source for copying conditions. There is NO
105 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
106 echo "Written by" "Bruno Haible"
109 # func_fatal_error message
110 # outputs to stderr a fatal error message, and terminates the program.
113 echo "gnulib-tool: *** $1" 1>&2
114 echo "gnulib-tool: *** Stop." 1>&2
118 # Command-line option processing.
119 # Removes the OPTIONS from the arguments. Sets the variables:
120 # - mode list or import or create-testdir or create-megatestdir
121 # - destdir from --dir
122 # - libname from --lib
123 # - sourcebase from --source-base
124 # - m4base from --m4-base
125 # - libtool true if --libtool was given, blank otherwise
126 # - do_changelog false if --no-changelog was given, : otherwise
127 # - dry_run true if --dry-run was given, blank otherwise
140 while test $# -gt 0; do
145 --import | --impor | --impo | --imp | --im | --i )
148 --create-testdir | --create-testdi | --create-testd | --create-test | --create-tes | --create-te | --create-t )
151 --create-megatestdir | --create-megatestdi | --create-megatestd | --create-megatest | --create-megates | --create-megate | --create-megat | --create-mega | --create-meg | --create-me | --create-m )
152 mode=create-megatestdir
154 --test | --tes | --te | --t )
157 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m )
161 mode=`echo "X$1" | sed -e 's/^X--//'`
166 func_fatal_error "missing argument for --dir"
171 destdir=`echo "X$1" | sed -e 's/^X--dir=//'`
176 func_fatal_error "missing argument for --lib"
179 supplied_libname=true
182 libname=`echo "X$1" | sed -e 's/^X--lib=//'`
183 supplied_libname=true
188 func_fatal_error "missing argument for --source-base"
193 sourcebase=`echo "X$1" | sed -e 's/^X--source-base=//'`
198 func_fatal_error "missing argument for --m4-base"
203 m4base=`echo "X$1" | sed -e 's/^X--m4-base=//'`
208 --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c )
214 --help | --hel | --he | --h )
217 --version | --versio | --versi | --vers | --ver | --ve | --v )
221 # Stop option prcessing
225 echo "gnulib-tool: unknown option $1" 1>&2
226 echo "Try 'gnulib-tool --help' for more information." 1>&2
235 /*) self_abspathname="$0" ;;
236 */*) self_abspathname=`pwd`/"$0" ;;
237 *) for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'`; do
238 if test -x "$d/$0" && test ! -d "$d/$0"; then
239 self_abspathname="$d/$0"
243 if test -z "$self_abspathname"; then
244 func_fatal_error "could not locate the gnulib-tool program - how did you invoke it?"
248 while test -h "$self_abspathname"; do
249 # Resolve symbolic link.
250 sedexpr1='s, -> ,#%%#,'
251 sedexpr2='s,^.*#%%#\(.*\)$,\1,p'
252 linkval=`LC_ALL=C ls -l "$self_abspathname" | sed -e "$sedexpr1" | sed -n -e "$sedexpr2"`
253 test -n "$linkval" || break
255 /* ) self_abspathname="$linkval" ;;
256 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
259 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
264 (cd "$gnulib_dir/modules" && ls -1) \
265 | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^TEMPLATE$/d' -e '/~$/d' \
270 # verifies a module name
271 func_verify_module ()
273 if test ! -f "$gnulib_dir/modules/$module" \
274 || test "CVS" = "$module" \
275 || test "ChangeLog" = "$module" \
276 || test "TEMPLATE" = "$module"; then
277 echo "gnulib-tool: module $module doesn't exist" 1>&2
282 sed_extract_prog=':[ ]*$/ {
285 s/^Description:[ ]*$//
287 s/^Depends-on:[ ]*$//
288 s/^configure\.ac:[ ]*$//
289 s/^Makefile\.am:[ ]*$//
291 s/^Maintainer:[ ]*$//
298 # func_get_description module
299 func_get_description ()
301 sed -n -e "/^Description$sed_extract_prog" < "$gnulib_dir/modules/$1"
304 # func_get_filelist module
307 sed -n -e "/^Files$sed_extract_prog" < "$gnulib_dir/modules/$1"
309 echo m4/onceonly_2_57.m4
312 # func_get_dependencies module
313 func_get_dependencies ()
315 sed -n -e "/^Depends-on$sed_extract_prog" < "$gnulib_dir/modules/$1"
318 # func_get_autoconf_snippet module
319 func_get_autoconf_snippet ()
321 sed -n -e "/^configure\.ac$sed_extract_prog" < "$gnulib_dir/modules/$1"
324 # func_get_automake_snippet module
325 func_get_automake_snippet ()
327 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$gnulib_dir/modules/$1"
330 # func_get_include_directive module
331 func_get_include_directive ()
333 sed -n -e "/^Include$sed_extract_prog" < "$gnulib_dir/modules/$1" | \
334 sed -e 's/^\(["<]\)/#include \1/'
337 # func_get_maintainer module
338 func_get_maintainer ()
340 sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1"
343 # func_create_testdir testdir modules
344 func_create_testdir ()
348 modules=`for m in $modules; do echo $m; done | sort | uniq`
350 # Determine final module list.
353 for module in $modules; do
355 if test -n "$module"; then
356 # Duplicate dependenies are harmless, but Jim wants a warning.
357 duplicated_deps=`func_get_dependencies $module | sort | uniq -d`
358 if test -n "$duplicated_deps"; then
359 echo "warning: module $module has duplicated dependencies: "`echo $duplicated_deps` 1>&2
361 xmodules="$xmodules $module "`func_get_dependencies $module`
364 xmodules=`for m in $xmodules; do echo $m; done | sort | uniq`
365 if test "$xmodules" = "$modules"; then
370 echo "Module list with included dependencies:"
371 echo "$modules" | sed -e 's/^/ /'
373 # Determine final file list.
375 for module in $modules; do
377 if test -n "$module"; then
378 files="$files "`func_get_filelist $module`
381 files=`for f in $files; do echo $f; done | sort | uniq`
383 echo "$files" | sed -e 's/^/ /'
385 # Create directories.
386 for d in `echo "$files" | sed -n -e 's,^\(.*\)/[^/]*,\1,p'`; do
387 if test "$d" != config; then
388 mkdir -p "$testdir/$d"
395 config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;;
398 ln "$gnulib_dir/$f" "$testdir/$g" 2>/dev/null ||
399 cp -p "$gnulib_dir/$f" "$testdir/$g"
402 # Create lib/Makefile.am.
403 mkdir -p "$testdir/lib"
404 (echo "## Process this file with automake to produce Makefile.in."
406 echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies"
408 echo "noinst_LIBRARIES = $libname.a"
410 echo "$libname"'_a_SOURCES ='
411 echo "$libname"'_a_LIBADD = @LIBOBJS@'
412 echo '#'"$libname"'_la_LIBADD = @LTLIBOBJS@'
414 echo "BUILT_SOURCES ="
416 echo "MOSTLYCLEANFILES ="
418 echo "DISTCLEANFILES ="
419 echo "MAINTAINERCLEANFILES ="
420 for module in $modules; do
422 if test -n "$module"; then
423 func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,$libname"'_a_SOURCES,g' -e "s,lib_OBJECTS,$libname"'_a_OBJECTS,g'
424 if test "$module" = 'alloca'; then
425 echo "$libname"'_a_LIBADD += @ALLOCA@'
426 echo '#'"$libname"'_la_LIBADD += @LTALLOCA@'
430 ) > "$testdir/lib/Makefile.am"
432 # Create m4/Makefile.am.
433 mkdir -p "$testdir/m4"
434 (echo "## Process this file with automake to produce Makefile.in."
440 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;;
443 ) > "$testdir/m4/Makefile.am"
447 if test -f "$testdir"/m4/gettext.m4; then
448 # Avoid stupid error message from automake:
449 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS"
450 mkdir -p "$testdir/po"
451 (echo "## Process this file with automake to produce Makefile.in."
452 ) > "$testdir/po/Makefile.am"
453 subdirs="$subdirs po"
456 # Create Makefile.am.
457 (echo "## Process this file with automake to produce Makefile.in."
459 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
461 echo "SUBDIRS = $subdirs"
463 echo "ACLOCAL_AMFLAGS = -I m4"
464 ) > "$testdir/Makefile.am"
466 # Create configure.ac.
467 (echo "# Process this file with autoconf to produce a configure script."
468 echo "AC_INIT(dummy,0)"
469 echo "AM_INIT_AUTOMAKE"
471 echo "AM_CONFIG_HEADER(config.h)"
474 echo "AC_PROG_INSTALL"
475 echo "AC_PROG_MAKE_SET"
476 echo "AC_PROG_RANLIB"
478 if grep AC_GNU_SOURCE "$testdir"/m4/*.m4 > /dev/null; then
482 if grep gl_USE_SYSTEM_EXTENSIONS "$testdir"/m4/*.m4 > /dev/null; then
483 echo "gl_USE_SYSTEM_EXTENSIONS"
486 for module in $modules; do
488 if test -n "$module"; then
489 func_get_autoconf_snippet "$module"
494 for d in $subdirs; do
495 makefiles="$makefiles $d/Makefile"
497 echo "AC_OUTPUT([$makefiles])"
498 ) > "$testdir/configure.ac"
500 # Create autogenerated files.
502 echo "executing ${ACLOCAL} -I m4"
504 echo "executing ${AUTOHEADER}"
506 echo "executing ${AUTOCONF}"
508 echo "executing ${AUTOMAKE} --add-missing --copy"
509 ${AUTOMAKE} --add-missing --copy
511 if grep '^BUILT_SOURCES *+=' "$testdir/lib/Makefile.am" > /dev/null; then
515 built_sources=`grep '^BUILT_SOURCES *=' Makefile.in | sed -e 's/^BUILT_SOURCES *=//'`
516 if test -n "$built_sources"; then
525 # func_create_megatestdir megatestdir allmodules
526 func_create_megatestdir ()
530 if test -z "$allmodules"; then
531 allmodules=`func_all_modules`
535 # First, all modules one by one.
536 for onemodule in $allmodules; do
537 func_create_testdir "$megatestdir/$onemodule" $onemodule
538 megasubdirs="${megasubdirs}$onemodule "
540 # Then, all modules all together.
541 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME.
542 allmodules=`for m in $allmodules; do if test $m != fnmatch-posix; then echo $m; fi; done`
543 func_create_testdir "$megatestdir/ALL" "$allmodules"
544 megasubdirs="${megasubdirs}ALL"
546 # Create Makefile.am.
547 (echo "## Process this file with automake to produce Makefile.in."
549 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
551 echo "SUBDIRS = $megasubdirs"
552 ) > "$megatestdir/Makefile.am"
554 # Create configure.ac.
555 (echo "# Process this file with autoconf to produce a configure script."
556 echo "AC_INIT(dummy,0)"
557 echo "AM_INIT_AUTOMAKE"
559 echo "AC_PROG_MAKE_SET"
561 echo "AC_CONFIG_SUBDIRS([$megasubdirs])"
562 echo "AC_OUTPUT([Makefile])"
563 ) > "$megatestdir/configure.ac"
565 # Create autogenerated files.
567 echo "executing ${ACLOCAL}"
569 echo "executing ${AUTOCONF}"
571 echo "executing ${AUTOMAKE} --add-missing --copy Makefile"
572 ${AUTOMAKE} --add-missing --copy Makefile
578 func_fatal_error "no mode specified" ;;
586 if test -z "$destdir"; then
590 || func_fatal_error "destination directory does not exist: $destdir"
592 # Prefer configure.ac to configure.in
593 test -f $destdir/configure.in && configure_ac=$destdir/configure.in
594 test -f $destdir/configure.ac && configure_ac=$destdir/configure.ac
595 test -f "$configure_ac" \
596 || func_fatal_error "cannot find $destdir/configure.ac"
599 my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
601 s,^.*gl_MODULES([[ ]*\([^])]*\).*$,ac_modules="\1",; p;
604 s,^.*gl_SOURCE_BASE([[ ]*\([^])]*\).*$,ac_sourcebase="\1",; p;
607 s,^.*gl_M4_BASE([[ ]*\([^])]*\).*$,ac_m4base="\1",; p;
610 s,^.*gl_LIB([[ ]*\([^])]*\).*$,ac_libname="\1",; p;
612 /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; };
613 /LT_INIT/ { s,^.*$,seen_libtool=:,; p; };
615 eval `cat $configure_ac | sed "$my_sed_traces"`
618 if test -z "$supplied_libname" && test -n "$ac_libname"; then
619 libname="$ac_libname"
622 # Set up source base.
623 test -z "$sourcebase" && sourcebase="$ac_sourcebase"
624 test -z "$sourcebase" && sourcebase="lib"
625 test -d "$destdir/$sourcebase" || \
626 (test -z "$dry_run" && mkdir "$destdir/$sourcebase") || \
627 func_fatal_error "source base $destdir/$sourcebase doesn't exist"
630 test -z "$m4base" && m4base="$ac_m4base"
631 test -z "$sourcebase" && m4base="m4"
632 test -d "$destdir/$m4base" || \
633 (test -z "$dry_run" && mkdir "$destdir/$m4base") || \
634 func_fatal_error "m4 base $destdir/$m4base doesn't exist"
637 if test x$seen_libtool != x; then
641 # What modules to extract.
642 supplied_modules="$*"
643 modules=`for m in $supplied_modules; do echo $m; done | sort | uniq`
644 if test -z "$modules"; then
645 modules="$ac_modules"
648 # Determine final module list.
651 for module in $modules; do
653 if test -n "$module"; then
654 # Duplicate dependenies are harmless, but Jim wants a warning.
655 duplicated_deps=`func_get_dependencies $module | sort | uniq -d`
656 if test -n "$duplicated_deps"; then
657 echo "warning: module $module has duplicated dependencies: "`echo $duplicated_deps` 1>&2
659 xmodules="$xmodules $module "`func_get_dependencies $module`
662 xmodules=`for m in $xmodules; do echo $m; done | sort | uniq`
663 if test "$xmodules" = "$modules"; then
668 echo "Module list with included dependencies:"
669 echo "$modules" | sed -e 's/^/ /'
671 # Determine final file list.
673 for module in $modules; do
675 if test -n "$module"; then
676 files="$files "`func_get_filelist $module`
679 files=`for f in $files; do echo $f; done | sort | uniq`
681 echo "$files" | sed -e 's/^/ /'
684 || func_fatal_error "refusing to do nothing"
689 config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;;
690 lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;;
691 m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
694 test -n "$dry_run" && dry=echo
695 $dry cp -p "$gnulib_dir/$f" "$destdir/$g"
698 # Commands printed in a comment in generated files.
699 cmd="gnulib-tool $supplied_opts"
701 if test -n "$libtool"; then
702 opt_libtool="--libtool"
704 actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base $opt_libtool `echo $modules`"
706 # Create lib/Makefile.am.
707 echo "Creating $destdir/$sourcebase/Makefile.am..."
708 if test -n "$libtool"; then
716 if test -z "$dry_run"; then
717 exec > $destdir/$sourcebase/Makefile.am
719 echo "# $destdir/$sourcebase/Makefile.am"
721 echo "## Process this file with automake to produce Makefile.in."
722 echo "# Copyright (C) 2004 Free Software Foundation, Inc."
724 echo "# This file is free software, distributed under the terms of the GNU"
725 echo "# General Public License. As a special exception to the GNU General"
726 echo "# Public License, this file may be distributed as part of a program"
727 echo "# that contains a configuration script generated by Automake, under"
728 echo "# the same distribution terms as the rest of that program."
730 echo "# Generated by gnulib-tool."
732 echo "# Invoked as: $cmd"
733 echo "# Reproduce by: $actioncmd"
735 echo "AUTOMAKE_OPTIONS = 1.8 gnits"
737 echo "noinst_${perhapsLT}LIBRARIES = $libname.$libext"
739 echo "${libname}_${libext}_SOURCES ="
740 echo "${libname}_${libext}_LIBADD = @${perhapsLT}LIBOBJS@"
742 echo "BUILT_SOURCES ="
744 echo "MOSTLYCLEANFILES ="
746 echo "DISTCLEANFILES ="
747 echo "MAINTAINERCLEANFILES ="
748 for module in $modules; do
750 if test -n "$module"; then
751 func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,${libname}_${libext}_SOURCES,g" -e "s,lib_OBJECTS,${libname}_${libext}_OBJECTS,g"
752 if test "$module" = 'alloca'; then
753 echo "${libname}_${libext}_LIBADD += @ALLOCA@"
758 echo "# Makefile.am ends here"
762 echo "Creating $destdir/$m4base/gnulib.m4..."
764 if test -z "$dry_run"; then
765 exec > $destdir/$m4base/gnulib.m4
767 echo "# $destdir/$m4base/gnulib.m4"
769 echo "# Copyright (C) 2004 Free Software Foundation, Inc."
770 echo "# This file is free software, distributed under the terms of the GNU"
771 echo "# General Public License. As a special exception to the GNU General"
772 echo "# Public License, this file may be distributed as part of a program"
773 echo "# that contains a configuration script generated by Autoconf, under"
774 echo "# the same distribution terms as the rest of that program."
776 echo "# Generated by gnulib-tool."
778 echo "# Invoked as: $cmd"
779 echo "# Reproduce by: $actioncmd"
781 echo "AC_DEFUN([gl_EARLY],"
783 if grep AC_GNU_SOURCE "$destdir"/$m4base/*.m4 > /dev/null; then
784 echo " AC_GNU_SOURCE"
786 if grep gl_USE_SYSTEM_EXTENSIONS "$destdir"/$m4base/*.m4 > /dev/null; then
787 echo " gl_USE_SYSTEM_EXTENSIONS"
791 echo "AC_DEFUN([gl_INIT],"
793 for module in $modules; do
795 if test -n "$module"; then
796 func_get_autoconf_snippet "$module" | sed -e '/^$/d;' -e 's/^/ /' -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./'
801 echo "dnl Usage: gl_MODULES(module1 module2 ...)"
802 echo "AC_DEFUN([gl_MODULES], [])"
804 echo "dnl Usage: gl_SOURCE_BASE(DIR)"
805 echo "AC_DEFUN([gl_SOURCE_BASE], [])"
807 echo "dnl Usage: gl_M4_BASE(DIR)"
808 echo "AC_DEFUN([gl_M4_BASE], [])"
810 echo "# gnulib.m4 ends here"
814 echo "Don't forget to add \"$sourcebase/Makefile\""
815 echo "to AC_CONFIG_FILES in \"$configure_ac\" and to mention"
816 echo "\"`basename $sourcebase`\" in SUBDIRS in some Makefile.am."
820 if test -z "$destdir"; then
821 func_fatal_error "please specify --dir option"
825 || func_fatal_error "could not create destination directory"
826 func_create_testdir "$destdir" "$*"
830 if test -z "$destdir"; then
831 func_fatal_error "please specify --dir option"
833 mkdir "$destdir" || func_fatal_error "could not create destination directory"
834 func_create_megatestdir "$destdir" "$*"
838 test -n "$destdir" || destdir=testdir$$
839 mkdir "$destdir" || func_fatal_error "could not create destination directory"
840 func_create_testdir "$destdir" "$*"
848 remaining=`find . -type f -print`
849 if test -n "$remaining"; then
850 echo "Remaining files:" $remaining 1>&2
851 echo "gnulib-tool: *** Stop." 1>&2
860 test -n "$destdir" || destdir=testdir$$
861 mkdir "$destdir" || func_fatal_error "could not create destination directory"
862 func_create_megatestdir "$destdir" "$*"
870 remaining=`find . -type f -print`
871 if test -n "$remaining"; then
872 echo "Remaining files:" $remaining 1>&2
873 echo "gnulib-tool: *** Stop." 1>&2
881 extract-description )
885 if test -n "$module"; then
886 func_get_description "$module"
895 if test -n "$module"; then
896 func_get_filelist "$module"
901 extract-dependencies )
905 if test -n "$module"; then
906 func_get_dependencies "$module"
911 extract-autoconf-snippet )
915 if test -n "$module"; then
916 func_get_autoconf_snippet "$module"
921 extract-automake-snippet )
925 if test -n "$module"; then
926 func_get_automake_snippet "$module"
931 extract-include-directive )
935 if test -n "$module"; then
936 func_get_include_directive "$module"
945 if test -n "$module"; then
946 func_get_maintainer "$module"
952 func_fatal_error "unknown operation mode --$mode" ;;