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-10-15 14:49:59 $'
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-license module
58 gnulib-tool --extract-maintainer module
61 --list print the available module names
62 --import import the given modules into the current package
63 --create-testdir create a scratch package with the given modules
64 --create-megatestdir create a mega scratch package with the given modules
65 one by one and all together
66 --test test the combination of the given modules
67 (recommended to use CC=\"gcc -Wall\" here)
68 --megatest test the given modules one by one and all together
69 (recommended to use CC=\"gcc -Wall\" here)
70 --extract-description extract the description
71 --extract-filelist extract the list of files
72 --extract-dependencies extract the dependencies
73 --extract-autoconf-snippet extract the snippet for configure.ac
74 --extract-automake-snippet extract the snippet for lib/Makefile.am
75 --extract-include-directive extract the #include directive
76 --extract-license report the license terms of the source files
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 --lgpl Abort if modules aren't available under the LGPL.
92 Also modify license template from GPL to LGPL.
93 --libtool Use libtool rules, for --import.
94 --no-changelog don't update or create ChangeLog files
95 --dry-run For --import, only print what would have been done.
97 Report bugs to <bug-gnulib@gnu.org>."
101 # outputs to stdout the --version message.
104 echo "$progname (GNU $package) $version"
105 echo "Copyright (C) 2002 Free Software Foundation, Inc.
106 This is free software; see the source for copying conditions. There is NO
107 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
108 echo "Written by" "Bruno Haible"
111 # func_fatal_error message
112 # outputs to stderr a fatal error message, and terminates the program.
115 echo "gnulib-tool: *** $1" 1>&2
116 echo "gnulib-tool: *** Stop." 1>&2
120 # Command-line option processing.
121 # Removes the OPTIONS from the arguments. Sets the variables:
122 # - mode list or import or create-testdir or create-megatestdir
123 # - destdir from --dir
124 # - libname from --lib
125 # - sourcebase from --source-base
126 # - m4base from --m4-base
127 # - libtool true if --libtool was given, blank otherwise
128 # - do_changelog false if --no-changelog was given, : otherwise
129 # - dry_run true if --dry-run was given, blank otherwise
143 while test $# -gt 0; do
148 --import | --impor | --impo | --imp | --im | --i )
151 --create-testdir | --create-testdi | --create-testd | --create-test | --create-tes | --create-te | --create-t )
154 --create-megatestdir | --create-megatestdi | --create-megatestd | --create-megatest | --create-megates | --create-megate | --create-megat | --create-mega | --create-meg | --create-me | --create-m )
155 mode=create-megatestdir
157 --test | --tes | --te | --t )
160 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m )
164 mode=`echo "X$1" | sed -e 's/^X--//'`
169 func_fatal_error "missing argument for --dir"
174 destdir=`echo "X$1" | sed -e 's/^X--dir=//'`
179 func_fatal_error "missing argument for --lib"
182 supplied_libname=true
185 libname=`echo "X$1" | sed -e 's/^X--lib=//'`
186 supplied_libname=true
191 func_fatal_error "missing argument for --source-base"
196 sourcebase=`echo "X$1" | sed -e 's/^X--source-base=//'`
201 func_fatal_error "missing argument for --m4-base"
206 m4base=`echo "X$1" | sed -e 's/^X--m4-base=//'`
214 --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c )
220 --help | --hel | --he | --h )
223 --version | --versio | --versi | --vers | --ver | --ve | --v )
227 # Stop option prcessing
231 echo "gnulib-tool: unknown option $1" 1>&2
232 echo "Try 'gnulib-tool --help' for more information." 1>&2
241 /*) self_abspathname="$0" ;;
242 */*) self_abspathname=`pwd`/"$0" ;;
243 *) for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'`; do
244 if test -x "$d/$0" && test ! -d "$d/$0"; then
245 self_abspathname="$d/$0"
249 if test -z "$self_abspathname"; then
250 func_fatal_error "could not locate the gnulib-tool program - how did you invoke it?"
254 while test -h "$self_abspathname"; do
255 # Resolve symbolic link.
256 sedexpr1='s, -> ,#%%#,'
257 sedexpr2='s,^.*#%%#\(.*\)$,\1,p'
258 linkval=`LC_ALL=C ls -l "$self_abspathname" | sed -e "$sedexpr1" | sed -n -e "$sedexpr2"`
259 test -n "$linkval" || break
261 /* ) self_abspathname="$linkval" ;;
262 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
265 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
270 (cd "$gnulib_dir/modules" && ls -1) \
271 | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^README$/d' -e '/^TEMPLATE$/d' -e '/~$/d' \
276 # verifies a module name
277 func_verify_module ()
279 if test ! -f "$gnulib_dir/modules/$module" \
280 || test "CVS" = "$module" \
281 || test "ChangeLog" = "$module" \
282 || test "README" = "$module" \
283 || test "TEMPLATE" = "$module"; then
284 echo "gnulib-tool: module $module doesn't exist" 1>&2
289 sed_extract_prog=':[ ]*$/ {
292 s/^Description:[ ]*$//
294 s/^Depends-on:[ ]*$//
295 s/^configure\.ac:[ ]*$//
296 s/^Makefile\.am:[ ]*$//
299 s/^Maintainer:[ ]*$//
306 # func_get_description module
307 func_get_description ()
309 sed -n -e "/^Description$sed_extract_prog" < "$gnulib_dir/modules/$1"
312 # func_get_filelist module
315 sed -n -e "/^Files$sed_extract_prog" < "$gnulib_dir/modules/$1"
317 echo m4/onceonly_2_57.m4
320 # func_get_dependencies module
321 func_get_dependencies ()
323 sed -n -e "/^Depends-on$sed_extract_prog" < "$gnulib_dir/modules/$1"
326 # func_get_autoconf_snippet module
327 func_get_autoconf_snippet ()
329 sed -n -e "/^configure\.ac$sed_extract_prog" < "$gnulib_dir/modules/$1"
332 # func_get_automake_snippet module
333 func_get_automake_snippet ()
335 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$gnulib_dir/modules/$1"
338 # func_get_include_directive module
339 func_get_include_directive ()
341 sed -n -e "/^Include$sed_extract_prog" < "$gnulib_dir/modules/$1" | \
342 sed -e 's/^\(["<]\)/#include \1/'
345 # func_get_license module
348 sed -n -e "/^License$sed_extract_prog" < "$gnulib_dir/modules/$1"
351 # func_get_maintainer module
352 func_get_maintainer ()
354 sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1"
357 # func_create_testdir testdir modules
358 func_create_testdir ()
362 modules=`for m in $modules; do echo $m; done | sort | uniq`
364 # Determine final module list.
367 for module in $modules; do
369 if test -n "$module"; then
370 # Duplicate dependenies are harmless, but Jim wants a warning.
371 duplicated_deps=`func_get_dependencies $module | sort | uniq -d`
372 if test -n "$duplicated_deps"; then
373 echo "warning: module $module has duplicated dependencies: "`echo $duplicated_deps` 1>&2
375 xmodules="$xmodules $module "`func_get_dependencies $module`
378 xmodules=`for m in $xmodules; do echo $m; done | sort | uniq`
379 if test "$xmodules" = "$modules"; then
384 echo "Module list with included dependencies:"
385 echo "$modules" | sed -e 's/^/ /'
387 # Determine final file list.
389 for module in $modules; do
391 if test -n "$module"; then
392 files="$files "`func_get_filelist $module`
395 files=`for f in $files; do echo $f; done | sort | uniq`
397 echo "$files" | sed -e 's/^/ /'
399 # Create directories.
400 for d in `echo "$files" | sed -n -e 's,^\(.*\)/[^/]*,\1,p'`; do
401 if test "$d" != config; then
402 mkdir -p "$testdir/$d"
409 config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;;
412 ln "$gnulib_dir/$f" "$testdir/$g" 2>/dev/null ||
413 cp -p "$gnulib_dir/$f" "$testdir/$g"
416 # Create lib/Makefile.am.
417 mkdir -p "$testdir/lib"
418 (echo "## Process this file with automake to produce Makefile.in."
420 echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies"
422 echo "noinst_LIBRARIES = $libname.a"
424 echo "$libname"'_a_SOURCES ='
425 echo "$libname"'_a_LIBADD = @LIBOBJS@'
426 echo '#'"$libname"'_la_LIBADD = @LTLIBOBJS@'
428 echo "BUILT_SOURCES ="
430 echo "MOSTLYCLEANFILES ="
432 echo "DISTCLEANFILES ="
433 echo "MAINTAINERCLEANFILES ="
434 for module in $modules; do
436 if test -n "$module"; then
437 func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,$libname"'_a_SOURCES,g' -e "s,lib_OBJECTS,$libname"'_a_OBJECTS,g'
438 if test "$module" = 'alloca'; then
439 echo "$libname"'_a_LIBADD += @ALLOCA@'
440 echo '#'"$libname"'_la_LIBADD += @LTALLOCA@'
444 ) > "$testdir/lib/Makefile.am"
446 # Create m4/Makefile.am.
447 mkdir -p "$testdir/m4"
448 (echo "## Process this file with automake to produce Makefile.in."
454 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;;
457 ) > "$testdir/m4/Makefile.am"
461 if test -f "$testdir"/m4/gettext.m4; then
462 # Avoid stupid error message from automake:
463 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS"
464 mkdir -p "$testdir/po"
465 (echo "## Process this file with automake to produce Makefile.in."
466 ) > "$testdir/po/Makefile.am"
467 subdirs="$subdirs po"
470 # Create Makefile.am.
471 (echo "## Process this file with automake to produce Makefile.in."
473 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
475 echo "SUBDIRS = $subdirs"
477 echo "ACLOCAL_AMFLAGS = -I m4"
478 ) > "$testdir/Makefile.am"
480 # Create configure.ac.
481 (echo "# Process this file with autoconf to produce a configure script."
482 echo "AC_INIT(dummy,0)"
483 echo "AM_INIT_AUTOMAKE"
485 echo "AM_CONFIG_HEADER(config.h)"
488 echo "AC_PROG_INSTALL"
489 echo "AC_PROG_MAKE_SET"
490 echo "AC_PROG_RANLIB"
492 if grep AC_GNU_SOURCE "$testdir"/m4/*.m4 > /dev/null; then
496 if grep gl_USE_SYSTEM_EXTENSIONS "$testdir"/m4/*.m4 > /dev/null; then
497 echo "gl_USE_SYSTEM_EXTENSIONS"
500 for module in $modules; do
502 if test -n "$module"; then
503 func_get_autoconf_snippet "$module"
508 for d in $subdirs; do
509 makefiles="$makefiles $d/Makefile"
511 echo "AC_OUTPUT([$makefiles])"
512 ) > "$testdir/configure.ac"
514 # Create autogenerated files.
516 echo "executing ${AUTORECONF} --force --install"
517 ${AUTORECONF} --force --install
519 if grep '^BUILT_SOURCES *+=' "$testdir/lib/Makefile.am" > /dev/null; then
523 built_sources=`grep '^BUILT_SOURCES *=' Makefile.in | sed -e 's/^BUILT_SOURCES *=//'`
524 if test -n "$built_sources"; then
533 # func_create_megatestdir megatestdir allmodules
534 func_create_megatestdir ()
538 if test -z "$allmodules"; then
539 allmodules=`func_all_modules`
543 # First, all modules one by one.
544 for onemodule in $allmodules; do
545 func_create_testdir "$megatestdir/$onemodule" $onemodule
546 megasubdirs="${megasubdirs}$onemodule "
548 # Then, all modules all together.
549 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME.
550 allmodules=`for m in $allmodules; do if test $m != fnmatch-posix; then echo $m; fi; done`
551 func_create_testdir "$megatestdir/ALL" "$allmodules"
552 megasubdirs="${megasubdirs}ALL"
554 # Create Makefile.am.
555 (echo "## Process this file with automake to produce Makefile.in."
557 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
559 echo "SUBDIRS = $megasubdirs"
560 ) > "$megatestdir/Makefile.am"
562 # Create configure.ac.
563 (echo "# Process this file with autoconf to produce a configure script."
564 echo "AC_INIT(dummy,0)"
565 echo "AM_INIT_AUTOMAKE"
567 echo "AC_PROG_MAKE_SET"
569 echo "AC_CONFIG_SUBDIRS([$megasubdirs])"
570 echo "AC_OUTPUT([Makefile])"
571 ) > "$megatestdir/configure.ac"
573 # Create autogenerated files.
575 echo "executing ${AUTORECONF} --force --install"
576 ${AUTORECONF} --force --install
582 func_fatal_error "no mode specified" ;;
590 if test -z "$destdir"; then
594 || func_fatal_error "destination directory does not exist: $destdir"
596 # Prefer configure.ac to configure.in
597 test -f $destdir/configure.in && configure_ac=$destdir/configure.in
598 test -f $destdir/configure.ac && configure_ac=$destdir/configure.ac
599 test -f "$configure_ac" \
600 || func_fatal_error "cannot find $destdir/configure.ac"
603 my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,;
605 s,^.*gl_MODULES([[ ]*\([^])]*\).*$,ac_modules="\1",; p;
608 s,^.*gl_SOURCE_BASE([[ ]*\([^])]*\).*$,ac_sourcebase="\1",; p;
611 s,^.*gl_M4_BASE([[ ]*\([^])]*\).*$,ac_m4base="\1",; p;
614 s,^.*gl_LIB([[ ]*\([^])]*\).*$,ac_libname="\1",; p;
616 /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; };
617 /LT_INIT/ { s,^.*$,seen_libtool=:,; p; };
618 /gl_LGPL/ { s,^.*$,lgpl=true,; p; };
620 eval `cat $configure_ac | sed "$my_sed_traces"`
623 if test -z "$supplied_libname" && test -n "$ac_libname"; then
624 libname="$ac_libname"
627 # Set up source base.
628 test -z "$sourcebase" && sourcebase="$ac_sourcebase"
629 test -z "$sourcebase" && sourcebase="lib"
630 test -d "$destdir/$sourcebase" \
631 || (test -z "$dry_run" && mkdir "$destdir/$sourcebase") \
632 || func_fatal_error "source base $destdir/$sourcebase doesn't exist"
635 test -z "$m4base" && m4base="$ac_m4base"
636 test -z "$m4base" && m4base="m4"
637 test -d "$destdir/$m4base" \
638 || (test -z "$dry_run" && mkdir "$destdir/$m4base") \
639 || func_fatal_error "m4 base $destdir/$m4base doesn't exist"
642 if test x$seen_libtool != x; then
646 # What modules to extract.
647 supplied_modules="$*"
648 modules=`for m in $supplied_modules; do echo $m; done | sort | uniq`
649 if test -z "$modules"; then
650 modules="$ac_modules"
653 # Determine final module list.
656 for module in $modules; do
658 if test -n "$module"; then
659 # Duplicate dependenies are harmless, but Jim wants a warning.
660 duplicated_deps=`func_get_dependencies $module | sort | uniq -d`
661 if test -n "$duplicated_deps"; then
662 echo "warning: module $module has duplicated dependencies: "`echo $duplicated_deps` 1>&2
664 xmodules="$xmodules $module "`func_get_dependencies $module`
667 xmodules=`for m in $xmodules; do echo $m; done | sort | uniq`
668 if test "$xmodules" = "$modules"; then
673 echo "Module list with included dependencies:"
674 echo "$modules" | sed -e 's/^/ /'
676 # If --lgpl, check the license of modules are compatible.
677 if test -n "$lgpl"; then
678 for module in $modules; do
679 license=`sed -n -e "/^License$sed_extract_prog" < "$gnulib_dir/modules/$module"`
680 if test $license != LGPL; then
681 func_fatal_error "incompatible license on module \`$module\`: $license"
686 # Determine final file list.
688 for module in $modules; do
690 if test -n "$module"; then
691 files="$files "`func_get_filelist $module`
694 files=`for f in $files; do echo $f; done | sort | uniq`
696 echo "$files" | sed -e 's/^/ /'
699 || func_fatal_error "refusing to do nothing"
705 config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;;
706 lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"`; source=true ;;
707 m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
710 test -n "$dry_run" && dry=echo
711 $dry cp -p "$gnulib_dir/$f" "$destdir/$g"
713 if test -z "$dry_run" -a -n "$lgpl" -a -n "$source"; then
714 perl -pi -e 's/GNU General/GNU Lesser General/g;' \
715 -e 's/version 2([ ,])/version 2.1\1/g' \
720 # Commands printed in a comment in generated files.
721 cmd="gnulib-tool $supplied_opts"
723 if test -n "$libtool"; then
724 opt_libtool="--libtool"
726 if test -n "$lgpl"; then
729 actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base $opt_libtool $opt_lgpl `echo $modules`"
731 # Create lib/Makefile.am.
732 echo "Creating $destdir/$sourcebase/Makefile.am..."
733 if test -n "$libtool"; then
741 if test -z "$dry_run"; then
742 exec > $destdir/$sourcebase/Makefile.am
744 echo "# $destdir/$sourcebase/Makefile.am"
746 echo "## Process this file with automake to produce Makefile.in."
747 echo "# Copyright (C) 2004 Free Software Foundation, Inc."
749 echo "# This file is free software, distributed under the terms of the GNU"
750 echo "# General Public License. As a special exception to the GNU General"
751 echo "# Public License, this file may be distributed as part of a program"
752 echo "# that contains a configuration script generated by Automake, under"
753 echo "# the same distribution terms as the rest of that program."
755 echo "# Generated by gnulib-tool."
757 echo "# Invoked as: $cmd"
758 echo "# Reproduce by: $actioncmd"
760 echo "AUTOMAKE_OPTIONS = 1.8 gnits"
762 echo "noinst_${perhapsLT}LIBRARIES = $libname.$libext"
764 echo "${libname}_${libext}_SOURCES ="
765 echo "${libname}_${libext}_LIBADD = @${perhapsLT}LIBOBJS@"
767 echo "BUILT_SOURCES ="
769 echo "MOSTLYCLEANFILES ="
771 echo "DISTCLEANFILES ="
772 echo "MAINTAINERCLEANFILES ="
773 for module in $modules; do
775 if test -n "$module"; then
776 func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,${libname}_${libext}_SOURCES,g" -e "s,lib_OBJECTS,${libname}_${libext}_OBJECTS,g"
777 if test "$module" = 'alloca'; then
778 echo "${libname}_${libext}_LIBADD += @ALLOCA@"
783 echo "# Makefile.am ends here"
787 echo "Creating $destdir/$m4base/gnulib.m4..."
789 if test -z "$dry_run"; then
790 exec > $destdir/$m4base/gnulib.m4
792 echo "# $destdir/$m4base/gnulib.m4"
794 echo "# Copyright (C) 2004 Free Software Foundation, Inc."
795 echo "# This file is free software, distributed under the terms of the GNU"
796 echo "# General Public License. As a special exception to the GNU General"
797 echo "# Public License, this file may be distributed as part of a program"
798 echo "# that contains a configuration script generated by Autoconf, under"
799 echo "# the same distribution terms as the rest of that program."
801 echo "# Generated by gnulib-tool."
803 echo "# Invoked as: $cmd"
804 echo "# Reproduce by: $actioncmd"
806 echo "AC_DEFUN([gl_EARLY],"
808 if grep AC_GNU_SOURCE "$destdir"/$m4base/*.m4 > /dev/null; then
809 echo " AC_GNU_SOURCE"
811 if grep gl_USE_SYSTEM_EXTENSIONS "$destdir"/$m4base/*.m4 > /dev/null; then
812 echo " gl_USE_SYSTEM_EXTENSIONS"
816 echo "AC_DEFUN([gl_INIT],"
818 for module in $modules; do
820 if test -n "$module"; then
821 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./'
826 echo "dnl Usage: gl_MODULES(module1 module2 ...)"
827 echo "AC_DEFUN([gl_MODULES], [])"
829 echo "dnl Usage: gl_SOURCE_BASE(DIR)"
830 echo "AC_DEFUN([gl_SOURCE_BASE], [])"
832 echo "dnl Usage: gl_M4_BASE(DIR)"
833 echo "AC_DEFUN([gl_M4_BASE], [])"
835 echo "dnl Usage: gl_LIB(LIBNAME)"
836 echo "AC_DEFUN([gl_LIB], [])"
838 echo "dnl Usage: gl_LGPL"
839 echo "AC_DEFUN([gl_LGPL], [])"
841 echo "# gnulib.m4 ends here"
845 echo "Don't forget to add \"$sourcebase/Makefile\""
846 echo "to AC_CONFIG_FILES in \"$configure_ac\" and to mention"
847 echo "\"`basename $sourcebase`\" in SUBDIRS in some Makefile.am."
851 if test -z "$destdir"; then
852 func_fatal_error "please specify --dir option"
856 || func_fatal_error "could not create destination directory"
857 func_create_testdir "$destdir" "$*"
861 if test -z "$destdir"; then
862 func_fatal_error "please specify --dir option"
864 mkdir "$destdir" || func_fatal_error "could not create destination directory"
865 func_create_megatestdir "$destdir" "$*"
869 test -n "$destdir" || destdir=testdir$$
870 mkdir "$destdir" || func_fatal_error "could not create destination directory"
871 func_create_testdir "$destdir" "$*"
879 remaining=`find . -type f -print`
880 if test -n "$remaining"; then
881 echo "Remaining files:" $remaining 1>&2
882 echo "gnulib-tool: *** Stop." 1>&2
891 test -n "$destdir" || destdir=testdir$$
892 mkdir "$destdir" || func_fatal_error "could not create destination directory"
893 func_create_megatestdir "$destdir" "$*"
901 remaining=`find . -type f -print`
902 if test -n "$remaining"; then
903 echo "Remaining files:" $remaining 1>&2
904 echo "gnulib-tool: *** Stop." 1>&2
912 extract-description )
916 if test -n "$module"; then
917 func_get_description "$module"
926 if test -n "$module"; then
927 func_get_filelist "$module"
932 extract-dependencies )
936 if test -n "$module"; then
937 func_get_dependencies "$module"
942 extract-autoconf-snippet )
946 if test -n "$module"; then
947 func_get_autoconf_snippet "$module"
952 extract-automake-snippet )
956 if test -n "$module"; then
957 func_get_automake_snippet "$module"
962 extract-include-directive )
966 if test -n "$module"; then
967 func_get_include_directive "$module"
976 if test -n "$module"; then
977 func_get_license "$module"
986 if test -n "$module"; then
987 func_get_maintainer "$module"
993 func_fatal_error "unknown operation mode --$mode" ;;