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-09-21 14:22:48 $'
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 AUTORECONF="${AUTOCONFPATH}autoreconf"
41 # outputs to stdout the --help usage message.
45 Usage: gnulib-tool --list
46 gnulib-tool --import [MODULE...]
47 gnulib-tool --create-testdir --dir=directory module1 ... moduleN
48 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN]
49 gnulib-tool --test --dir=directory module1 ... moduleN
50 gnulib-tool --megatest --dir=directory [module1 ... moduleN]
51 gnulib-tool --extract-description module
52 gnulib-tool --extract-filelist module
53 gnulib-tool --extract-dependencies module
54 gnulib-tool --extract-autoconf-snippet module
55 gnulib-tool --extract-automake-snippet module
56 gnulib-tool --extract-include-directive module
57 gnulib-tool --extract-maintainer module
60 --list print the available module names
61 --import import the given modules into the current package
62 --create-testdir create a scratch package with the given modules
63 --create-megatestdir create a mega scratch package with the given modules
64 one by one and all together
65 --test test the combination of the given modules
66 (recommended to use CC=\"gcc -Wall\" here)
67 --megatest test the given modules one by one and all together
68 (recommended to use CC=\"gcc -Wall\" here)
69 --extract-description extract the description
70 --extract-filelist extract the list of files
71 --extract-dependencies extract the dependencies
72 --extract-autoconf-snippet extract the snippet for configure.ac
73 --extract-automake-snippet extract the snippet for lib/Makefile.am
74 --extract-include-directive extract the #include directive
75 --extract-maintainer report the maintainer(s) inside gnulib
78 --dir=DIRECTORY specify the target directory
79 For --import, this specify where your
80 configure.ac can be found. Defaults to current
82 --lib=LIBRARY Specify the library name. Defaults to 'libgnu'.
83 --source-base=DIRECTORY
84 Directory relative --dir where source code is
85 placed (default \"lib\"), for --import.
86 --m4-base=DIRECTORY Directory relative --dir where *.m4 macros are
87 placed (default \"m4\"), for --import.
88 --libtool Use libtool rules, for --import.
89 --no-changelog don't update or create ChangeLog files
90 --dry-run For --import, only print what would have been done.
92 Report bugs to <bug-gnulib@gnu.org>."
96 # outputs to stdout the --version message.
99 echo "$progname (GNU $package) $version"
100 echo "Copyright (C) 2002 Free Software Foundation, Inc.
101 This is free software; see the source for copying conditions. There is NO
102 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
103 echo "Written by" "Bruno Haible"
106 # func_fatal_error message
107 # outputs to stderr a fatal error message, and terminates the program.
110 echo "gnulib-tool: *** $1" 1>&2
111 echo "gnulib-tool: *** Stop." 1>&2
115 # Command-line option processing.
116 # Removes the OPTIONS from the arguments. Sets the variables:
117 # - mode list or import or create-testdir or create-megatestdir
118 # - destdir from --dir
119 # - libname from --lib
120 # - sourcebase from --source-base
121 # - m4base from --m4-base
122 # - libtool true if --libtool was given, blank otherwise
123 # - do_changelog false if --no-changelog was given, : otherwise
124 # - dry_run true if --dry-run was given, blank otherwise
137 while test $# -gt 0; do
142 --import | --impor | --impo | --imp | --im | --i )
145 --create-testdir | --create-testdi | --create-testd | --create-test | --create-tes | --create-te | --create-t )
148 --create-megatestdir | --create-megatestdi | --create-megatestd | --create-megatest | --create-megates | --create-megate | --create-megat | --create-mega | --create-meg | --create-me | --create-m )
149 mode=create-megatestdir
151 --test | --tes | --te | --t )
154 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m )
158 mode=`echo "X$1" | sed -e 's/^X--//'`
163 func_fatal_error "missing argument for --dir"
168 destdir=`echo "X$1" | sed -e 's/^X--dir=//'`
173 func_fatal_error "missing argument for --lib"
176 supplied_libname=true
179 libname=`echo "X$1" | sed -e 's/^X--lib=//'`
180 supplied_libname=true
185 func_fatal_error "missing argument for --source-base"
190 sourcebase=`echo "X$1" | sed -e 's/^X--source-base=//'`
195 func_fatal_error "missing argument for --m4-base"
200 m4base=`echo "X$1" | sed -e 's/^X--m4-base=//'`
205 --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c )
211 --help | --hel | --he | --h )
214 --version | --versio | --versi | --vers | --ver | --ve | --v )
218 # Stop option prcessing
222 echo "gnulib-tool: unknown option $1" 1>&2
223 echo "Try 'gnulib-tool --help' for more information." 1>&2
232 /*) self_abspathname="$0" ;;
233 */*) self_abspathname=`pwd`/"$0" ;;
234 *) for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'`; do
235 if test -x "$d/$0" && test ! -d "$d/$0"; then
236 self_abspathname="$d/$0"
240 if test -z "$self_abspathname"; then
241 func_fatal_error "could not locate the gnulib-tool program - how did you invoke it?"
245 while test -h "$self_abspathname"; do
246 # Resolve symbolic link.
247 sedexpr1='s, -> ,#%%#,'
248 sedexpr2='s,^.*#%%#\(.*\)$,\1,p'
249 linkval=`LC_ALL=C ls -l "$self_abspathname" | sed -e "$sedexpr1" | sed -n -e "$sedexpr2"`
250 test -n "$linkval" || break
252 /* ) self_abspathname="$linkval" ;;
253 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
256 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
261 (cd "$gnulib_dir/modules" && ls -1) \
262 | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^TEMPLATE$/d' -e '/~$/d' \
267 # verifies a module name
268 func_verify_module ()
270 if test ! -f "$gnulib_dir/modules/$module" \
271 || test "CVS" = "$module" \
272 || test "ChangeLog" = "$module" \
273 || test "TEMPLATE" = "$module"; then
274 echo "gnulib-tool: module $module doesn't exist" 1>&2
279 sed_extract_prog=':[ ]*$/ {
282 s/^Description:[ ]*$//
284 s/^Depends-on:[ ]*$//
285 s/^configure\.ac:[ ]*$//
286 s/^Makefile\.am:[ ]*$//
288 s/^Maintainer:[ ]*$//
295 # func_get_description module
296 func_get_description ()
298 sed -n -e "/^Description$sed_extract_prog" < "$gnulib_dir/modules/$1"
301 # func_get_filelist module
304 sed -n -e "/^Files$sed_extract_prog" < "$gnulib_dir/modules/$1"
306 echo m4/onceonly_2_57.m4
309 # func_get_dependencies module
310 func_get_dependencies ()
312 sed -n -e "/^Depends-on$sed_extract_prog" < "$gnulib_dir/modules/$1"
315 # func_get_autoconf_snippet module
316 func_get_autoconf_snippet ()
318 sed -n -e "/^configure\.ac$sed_extract_prog" < "$gnulib_dir/modules/$1"
321 # func_get_automake_snippet module
322 func_get_automake_snippet ()
324 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$gnulib_dir/modules/$1"
327 # func_get_include_directive module
328 func_get_include_directive ()
330 sed -n -e "/^Include$sed_extract_prog" < "$gnulib_dir/modules/$1" | \
331 sed -e 's/^\(["<]\)/#include \1/'
334 # func_get_maintainer module
335 func_get_maintainer ()
337 sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1"
340 # func_create_testdir testdir modules
341 func_create_testdir ()
345 modules=`for m in $modules; do echo $m; done | sort | uniq`
347 # Determine final module list.
350 for module in $modules; do
352 if test -n "$module"; then
353 # Duplicate dependenies are harmless, but Jim wants a warning.
354 duplicated_deps=`func_get_dependencies $module | sort | uniq -d`
355 if test -n "$duplicated_deps"; then
356 echo "warning: module $module has duplicated dependencies: "`echo $duplicated_deps` 1>&2
358 xmodules="$xmodules $module "`func_get_dependencies $module`
361 xmodules=`for m in $xmodules; do echo $m; done | sort | uniq`
362 if test "$xmodules" = "$modules"; then
367 echo "Module list with included dependencies:"
368 echo "$modules" | sed -e 's/^/ /'
370 # Determine final file list.
372 for module in $modules; do
374 if test -n "$module"; then
375 files="$files "`func_get_filelist $module`
378 files=`for f in $files; do echo $f; done | sort | uniq`
380 echo "$files" | sed -e 's/^/ /'
382 # Create directories.
383 for d in `echo "$files" | sed -n -e 's,^\(.*\)/[^/]*,\1,p'`; do
384 if test "$d" != config; then
385 mkdir -p "$testdir/$d"
392 config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;;
395 ln "$gnulib_dir/$f" "$testdir/$g" 2>/dev/null ||
396 cp -p "$gnulib_dir/$f" "$testdir/$g"
399 # Create lib/Makefile.am.
400 mkdir -p "$testdir/lib"
401 (echo "## Process this file with automake to produce Makefile.in."
403 echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies"
405 echo "noinst_LIBRARIES = $libname.a"
407 echo "$libname"'_a_SOURCES ='
408 echo "$libname"'_a_LIBADD = @LIBOBJS@'
409 echo '#'"$libname"'_la_LIBADD = @LTLIBOBJS@'
411 echo "BUILT_SOURCES ="
413 echo "MOSTLYCLEANFILES ="
415 echo "DISTCLEANFILES ="
416 echo "MAINTAINERCLEANFILES ="
417 for module in $modules; do
419 if test -n "$module"; then
420 func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,$libname"'_a_SOURCES,g' -e "s,lib_OBJECTS,$libname"'_a_OBJECTS,g'
421 if test "$module" = 'alloca'; then
422 echo "$libname"'_a_LIBADD += @ALLOCA@'
423 echo '#'"$libname"'_la_LIBADD += @LTALLOCA@'
427 ) > "$testdir/lib/Makefile.am"
429 # Create m4/Makefile.am.
430 mkdir -p "$testdir/m4"
431 (echo "## Process this file with automake to produce Makefile.in."
437 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;;
440 ) > "$testdir/m4/Makefile.am"
444 if test -f "$testdir"/m4/gettext.m4; then
445 # Avoid stupid error message from automake:
446 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS"
447 mkdir -p "$testdir/po"
448 (echo "## Process this file with automake to produce Makefile.in."
449 ) > "$testdir/po/Makefile.am"
450 subdirs="$subdirs po"
453 # Create Makefile.am.
454 (echo "## Process this file with automake to produce Makefile.in."
456 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
458 echo "SUBDIRS = $subdirs"
460 echo "ACLOCAL_AMFLAGS = -I m4"
461 ) > "$testdir/Makefile.am"
463 # Create configure.ac.
464 (echo "# Process this file with autoconf to produce a configure script."
465 echo "AC_INIT(dummy,0)"
466 echo "AM_INIT_AUTOMAKE"
468 echo "AM_CONFIG_HEADER(config.h)"
471 echo "AC_PROG_INSTALL"
472 echo "AC_PROG_MAKE_SET"
473 echo "AC_PROG_RANLIB"
475 if grep AC_GNU_SOURCE "$testdir"/m4/*.m4 > /dev/null; then
479 if grep gl_USE_SYSTEM_EXTENSIONS "$testdir"/m4/*.m4 > /dev/null; then
480 echo "gl_USE_SYSTEM_EXTENSIONS"
483 for module in $modules; do
485 if test -n "$module"; then
486 func_get_autoconf_snippet "$module"
491 for d in $subdirs; do
492 makefiles="$makefiles $d/Makefile"
494 echo "AC_OUTPUT([$makefiles])"
495 ) > "$testdir/configure.ac"
497 # Create autogenerated files.
499 echo "executing ${AUTORECONF} --force --install"
500 ${AUTORECONF} --force --install
502 if grep '^BUILT_SOURCES *+=' "$testdir/lib/Makefile.am" > /dev/null; then
506 built_sources=`grep '^BUILT_SOURCES *=' Makefile.in | sed -e 's/^BUILT_SOURCES *=//'`
507 if test -n "$built_sources"; then
516 # func_create_megatestdir megatestdir allmodules
517 func_create_megatestdir ()
521 if test -z "$allmodules"; then
522 allmodules=`func_all_modules`
526 # First, all modules one by one.
527 for onemodule in $allmodules; do
528 func_create_testdir "$megatestdir/$onemodule" $onemodule
529 megasubdirs="${megasubdirs}$onemodule "
531 # Then, all modules all together.
532 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME.
533 allmodules=`for m in $allmodules; do if test $m != fnmatch-posix; then echo $m; fi; done`
534 func_create_testdir "$megatestdir/ALL" "$allmodules"
535 megasubdirs="${megasubdirs}ALL"
537 # Create Makefile.am.
538 (echo "## Process this file with automake to produce Makefile.in."
540 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
542 echo "SUBDIRS = $megasubdirs"
543 ) > "$megatestdir/Makefile.am"
545 # Create configure.ac.
546 (echo "# Process this file with autoconf to produce a configure script."
547 echo "AC_INIT(dummy,0)"
548 echo "AM_INIT_AUTOMAKE"
550 echo "AC_PROG_MAKE_SET"
552 echo "AC_CONFIG_SUBDIRS([$megasubdirs])"
553 echo "AC_OUTPUT([Makefile])"
554 ) > "$megatestdir/configure.ac"
556 # Create autogenerated files.
558 echo "executing ${AUTORECONF} --force --install"
559 ${AUTORECONF} --force --install
565 func_fatal_error "no mode specified" ;;
573 if test -z "$destdir"; then
577 || func_fatal_error "destination directory does not exist: $destdir"
579 # Prefer configure.ac to configure.in
580 test -f $destdir/configure.in && configure_ac=$destdir/configure.in
581 test -f $destdir/configure.ac && configure_ac=$destdir/configure.ac
582 test -f "$configure_ac" \
583 || func_fatal_error "cannot find $destdir/configure.ac"
586 my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
588 s,^.*gl_MODULES([[ ]*\([^])]*\).*$,ac_modules="\1",; p;
591 s,^.*gl_SOURCE_BASE([[ ]*\([^])]*\).*$,ac_sourcebase="\1",; p;
594 s,^.*gl_M4_BASE([[ ]*\([^])]*\).*$,ac_m4base="\1",; p;
597 s,^.*gl_LIB([[ ]*\([^])]*\).*$,ac_libname="\1",; p;
599 /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; };
600 /LT_INIT/ { s,^.*$,seen_libtool=:,; p; };
602 eval `cat $configure_ac | sed "$my_sed_traces"`
605 if test -z "$supplied_libname" && test -n "$ac_libname"; then
606 libname="$ac_libname"
609 # Set up source base.
610 test -z "$sourcebase" && sourcebase="$ac_sourcebase"
611 test -z "$sourcebase" && sourcebase="lib"
612 test -d "$destdir/$sourcebase" || \
613 (test -z "$dry_run" && mkdir "$destdir/$sourcebase") || \
614 func_fatal_error "source base $destdir/$sourcebase doesn't exist"
617 test -z "$m4base" && m4base="$ac_m4base"
618 test -z "$sourcebase" && m4base="m4"
619 test -d "$destdir/$m4base" || \
620 (test -z "$dry_run" && mkdir "$destdir/$m4base") || \
621 func_fatal_error "m4 base $destdir/$m4base doesn't exist"
624 if test x$seen_libtool != x; then
628 # What modules to extract.
629 supplied_modules="$*"
630 modules=`for m in $supplied_modules; do echo $m; done | sort | uniq`
631 if test -z "$modules"; then
632 modules="$ac_modules"
635 # Determine final module list.
638 for module in $modules; do
640 if test -n "$module"; then
641 # Duplicate dependenies are harmless, but Jim wants a warning.
642 duplicated_deps=`func_get_dependencies $module | sort | uniq -d`
643 if test -n "$duplicated_deps"; then
644 echo "warning: module $module has duplicated dependencies: "`echo $duplicated_deps` 1>&2
646 xmodules="$xmodules $module "`func_get_dependencies $module`
649 xmodules=`for m in $xmodules; do echo $m; done | sort | uniq`
650 if test "$xmodules" = "$modules"; then
655 echo "Module list with included dependencies:"
656 echo "$modules" | sed -e 's/^/ /'
658 # Determine final file list.
660 for module in $modules; do
662 if test -n "$module"; then
663 files="$files "`func_get_filelist $module`
666 files=`for f in $files; do echo $f; done | sort | uniq`
668 echo "$files" | sed -e 's/^/ /'
671 || func_fatal_error "refusing to do nothing"
676 config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;;
677 lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;;
678 m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
681 test -n "$dry_run" && dry=echo
682 $dry cp -p "$gnulib_dir/$f" "$destdir/$g"
685 # Commands printed in a comment in generated files.
686 cmd="gnulib-tool $supplied_opts"
688 if test -n "$libtool"; then
689 opt_libtool="--libtool"
691 actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base $opt_libtool `echo $modules`"
693 # Create lib/Makefile.am.
694 echo "Creating $destdir/$sourcebase/Makefile.am..."
695 if test -n "$libtool"; then
703 if test -z "$dry_run"; then
704 exec > $destdir/$sourcebase/Makefile.am
706 echo "# $destdir/$sourcebase/Makefile.am"
708 echo "## Process this file with automake to produce Makefile.in."
709 echo "# Copyright (C) 2004 Free Software Foundation, Inc."
711 echo "# This file is free software, distributed under the terms of the GNU"
712 echo "# General Public License. As a special exception to the GNU General"
713 echo "# Public License, this file may be distributed as part of a program"
714 echo "# that contains a configuration script generated by Automake, under"
715 echo "# the same distribution terms as the rest of that program."
717 echo "# Generated by gnulib-tool."
719 echo "# Invoked as: $cmd"
720 echo "# Reproduce by: $actioncmd"
722 echo "AUTOMAKE_OPTIONS = 1.8 gnits"
724 echo "noinst_${perhapsLT}LIBRARIES = $libname.$libext"
726 echo "${libname}_${libext}_SOURCES ="
727 echo "${libname}_${libext}_LIBADD = @${perhapsLT}LIBOBJS@"
729 echo "BUILT_SOURCES ="
731 echo "MOSTLYCLEANFILES ="
733 echo "DISTCLEANFILES ="
734 echo "MAINTAINERCLEANFILES ="
735 for module in $modules; do
737 if test -n "$module"; then
738 func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,${libname}_${libext}_SOURCES,g" -e "s,lib_OBJECTS,${libname}_${libext}_OBJECTS,g"
739 if test "$module" = 'alloca'; then
740 echo "${libname}_${libext}_LIBADD += @ALLOCA@"
745 echo "# Makefile.am ends here"
749 echo "Creating $destdir/$m4base/gnulib.m4..."
751 if test -z "$dry_run"; then
752 exec > $destdir/$m4base/gnulib.m4
754 echo "# $destdir/$m4base/gnulib.m4"
756 echo "# Copyright (C) 2004 Free Software Foundation, Inc."
757 echo "# This file is free software, distributed under the terms of the GNU"
758 echo "# General Public License. As a special exception to the GNU General"
759 echo "# Public License, this file may be distributed as part of a program"
760 echo "# that contains a configuration script generated by Autoconf, under"
761 echo "# the same distribution terms as the rest of that program."
763 echo "# Generated by gnulib-tool."
765 echo "# Invoked as: $cmd"
766 echo "# Reproduce by: $actioncmd"
768 echo "AC_DEFUN([gl_EARLY],"
770 if grep AC_GNU_SOURCE "$destdir"/$m4base/*.m4 > /dev/null; then
771 echo " AC_GNU_SOURCE"
773 if grep gl_USE_SYSTEM_EXTENSIONS "$destdir"/$m4base/*.m4 > /dev/null; then
774 echo " gl_USE_SYSTEM_EXTENSIONS"
778 echo "AC_DEFUN([gl_INIT],"
780 for module in $modules; do
782 if test -n "$module"; then
783 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./'
788 echo "dnl Usage: gl_MODULES(module1 module2 ...)"
789 echo "AC_DEFUN([gl_MODULES], [])"
791 echo "dnl Usage: gl_SOURCE_BASE(DIR)"
792 echo "AC_DEFUN([gl_SOURCE_BASE], [])"
794 echo "dnl Usage: gl_M4_BASE(DIR)"
795 echo "AC_DEFUN([gl_M4_BASE], [])"
797 echo "dnl Usage: gl_LIB(LIBNAME)"
798 echo "AC_DEFUN([gl_LIB], [])"
800 echo "# gnulib.m4 ends here"
804 echo "Don't forget to add \"$sourcebase/Makefile\""
805 echo "to AC_CONFIG_FILES in \"$configure_ac\" and to mention"
806 echo "\"`basename $sourcebase`\" in SUBDIRS in some Makefile.am."
810 if test -z "$destdir"; then
811 func_fatal_error "please specify --dir option"
815 || func_fatal_error "could not create destination directory"
816 func_create_testdir "$destdir" "$*"
820 if test -z "$destdir"; then
821 func_fatal_error "please specify --dir option"
823 mkdir "$destdir" || func_fatal_error "could not create destination directory"
824 func_create_megatestdir "$destdir" "$*"
828 test -n "$destdir" || destdir=testdir$$
829 mkdir "$destdir" || func_fatal_error "could not create destination directory"
830 func_create_testdir "$destdir" "$*"
838 remaining=`find . -type f -print`
839 if test -n "$remaining"; then
840 echo "Remaining files:" $remaining 1>&2
841 echo "gnulib-tool: *** Stop." 1>&2
850 test -n "$destdir" || destdir=testdir$$
851 mkdir "$destdir" || func_fatal_error "could not create destination directory"
852 func_create_megatestdir "$destdir" "$*"
860 remaining=`find . -type f -print`
861 if test -n "$remaining"; then
862 echo "Remaining files:" $remaining 1>&2
863 echo "gnulib-tool: *** Stop." 1>&2
871 extract-description )
875 if test -n "$module"; then
876 func_get_description "$module"
885 if test -n "$module"; then
886 func_get_filelist "$module"
891 extract-dependencies )
895 if test -n "$module"; then
896 func_get_dependencies "$module"
901 extract-autoconf-snippet )
905 if test -n "$module"; then
906 func_get_autoconf_snippet "$module"
911 extract-automake-snippet )
915 if test -n "$module"; then
916 func_get_automake_snippet "$module"
921 extract-include-directive )
925 if test -n "$module"; then
926 func_get_include_directive "$module"
935 if test -n "$module"; then
936 func_get_maintainer "$module"
942 func_fatal_error "unknown operation mode --$mode" ;;