annotate gnulib-tool @ 6966:42730fffa002

help message tweaks
author Karl Berry <karl@freefriends.org>
date Sat, 15 Jul 2006 23:07:01 +0000
parents 7715890c929a
children dc8f2a1ff75f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 #! /bin/sh
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 #
6512
f8abe8d41137 RANLIB is needed.
Bruno Haible <bruno@clisp.org>
parents: 6464
diff changeset
3 # Copyright (C) 2002-2006 Free Software Foundation, Inc.
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 #
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 # This program is free software; you can redistribute it and/or modify
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 # it under the terms of the GNU General Public License as published by
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 # the Free Software Foundation; either version 2, or (at your option)
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 # any later version.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 #
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 # This program is distributed in the hope that it will be useful,
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 # GNU General Public License for more details.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 #
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License
6549
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
16 # along with this program; if not, write to the Free Software Foundation,
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 # This program is meant for authors or maintainers which want to import
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 # modules from gnulib into their packages.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 progname=$0
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 package=gnulib
6966
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
25 cvsdatestamp='$Date: 2006-07-15 23:07:01 $'
4124
5b5f22d7530e (last_checkin_date): don't expand the $Date here.
Karl Berry <karl@freefriends.org>
parents: 4112
diff changeset
26 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 AUTOCONFPATH=
5250
46a747db97f2 Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents: 5237
diff changeset
31 #case $USER in
46a747db97f2 Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents: 5237
diff changeset
32 # bruno )
46a747db97f2 Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents: 5237
diff changeset
33 # AUTOCONFBINDIR=/packages/gnu-inst-autoconf/2.57/bin
46a747db97f2 Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents: 5237
diff changeset
34 # AUTOCONFPATH="eval env PATH=${AUTOCONFBINDIR}:\$PATH "
46a747db97f2 Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents: 5237
diff changeset
35 # ;;
46a747db97f2 Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents: 5237
diff changeset
36 #esac
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37
6547
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
38 # You can set AUTOMAKEPATH to empty if automake 1.9.x is already in your PATH.
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
39 AUTOMAKEPATH=
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
40
6551
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
41 # If you didn't set AUTOCONFPATH and AUTOMAKEPATH, you can also set the
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
42 # variables AUTOCONF, ACLOCAL, AUTOMAKE, AUTORECONF individually.
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
43 if test -z "${AUTOCONF}" || test -n "${AUTOCONFPATH}"; then
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
44 AUTOCONF="${AUTOCONFPATH}autoconf"
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
45 fi
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
46 if test -z "${ACLOCAL}" || test -n "${AUTOMAKEPATH}"; then
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
47 ACLOCAL="${AUTOMAKEPATH}aclocal"
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
48 fi
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
49 if test -z "${AUTOMAKE}" || test -n "${AUTOMAKEPATH}"; then
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
50 AUTOMAKE="${AUTOMAKEPATH}automake"
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
51 fi
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
52 if test -z "${AUTORECONF}" || test -n "${AUTOCONFPATH}"; then
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
53 AUTORECONF="${AUTOCONFPATH}autoreconf"
d37637700b4e Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents: 6550
diff changeset
54 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 # func_usage
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 # outputs to stdout the --help usage message.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 func_usage ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 echo "\
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 Usage: gnulib-tool --list
5344
c2f5677fc6ed Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents: 5343
diff changeset
62 gnulib-tool --import [module1 ... moduleN]
6443
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
63 gnulib-tool --update
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 gnulib-tool --create-testdir --dir=directory module1 ... moduleN
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN]
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 gnulib-tool --test --dir=directory module1 ... moduleN
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 gnulib-tool --megatest --dir=directory [module1 ... moduleN]
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 gnulib-tool --extract-description module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 gnulib-tool --extract-filelist module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 gnulib-tool --extract-dependencies module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 gnulib-tool --extract-autoconf-snippet module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 gnulib-tool --extract-automake-snippet module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 gnulib-tool --extract-include-directive module
5251
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
74 gnulib-tool --extract-license module
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
75 gnulib-tool --extract-maintainer module
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
76 gnulib-tool --extract-tests-module module
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 Operation modes:
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 --list print the available module names
6633
5118aa463328 * gnulib-tool (Usage): Fix --import, from
Simon Josefsson <simon@josefsson.org>
parents: 6614
diff changeset
80 --import import the given modules into the current package;
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
81 if no modules are specified, update the current
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
82 package from the current gnulib
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
83 --update update the current package, restore files omitted
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
84 from CVS
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 --create-testdir create a scratch package with the given modules
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 --create-megatestdir create a mega scratch package with the given modules
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 one by one and all together
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 --test test the combination of the given modules
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
89 (recommended to use CC=\"gcc -Wall\" here)
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 --megatest test the given modules one by one and all together
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
91 (recommended to use CC=\"gcc -Wall\" here)
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 --extract-description extract the description
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 --extract-filelist extract the list of files
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 --extract-dependencies extract the dependencies
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 --extract-autoconf-snippet extract the snippet for configure.ac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 --extract-automake-snippet extract the snippet for lib/Makefile.am
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 --extract-include-directive extract the #include directive
5251
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
98 --extract-license report the license terms of the source files
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
99 under lib/
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
100 --extract-maintainer report the maintainer(s) inside gnulib
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
101 --extract-tests-module report the unit test module, if it exists
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 Options:
6966
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
104 --avoid=MODULE Avoid including the given MODULE. Useful if you
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
105 have code that provides equivalent functionality.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
106 This option can be repeated.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
107 --dry-run For --import, only print what would have been done.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
108 --lgpl Abort if modules aren't available under the LGPL.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
109 Also modify license template from GPL to LGPL.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
110 --lib=LIBRARY Specify the library name. Defaults to 'libgnu'.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
111 --libtool Use libtool rules, for --import.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
112 --macro-prefix=PREFIX Specify the prefix of the macros gl_EARLY and
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
113 gl_INIT. Default is "gl".
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
114 --no-changelog don't update or create ChangeLog files
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
115 -s, --symbolic, --symlink Make symbolic links instead of copying files.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
116 --with-tests Include unit tests for the included modules.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
117
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
118 Directory options:
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 --dir=DIRECTORY specify the target directory
5344
c2f5677fc6ed Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents: 5343
diff changeset
120 For --import, this specifies where your
5198
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
121 configure.ac can be found. Defaults to current
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
122 directory.
6966
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
123 --aux-dir=DIRECTORY Directory relative to --dir where auxiliary build
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
124 tools are placed (default \"build-aux\").
6966
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
125 --doc-base=DIRECTORY Directory relative to --dir where doc files are
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
126 placed (default \"doc\"), for --import.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
127 --m4-base=DIRECTORY Directory relative to --dir where *.m4 macros are
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
128 placed (default \"m4\"), for --import.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
129 --source-base=DIRECTORY Directory relative to --dir where source code is
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
130 placed (default \"lib\"), for --import.
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
131 --tests-base=DIRECTORY Directory relative to --dir where unit tests are
42730fffa002 help message tweaks
Karl Berry <karl@freefriends.org>
parents: 6955
diff changeset
132 placed (default \"tests\"), for --import.
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
134 Report bugs to <bug-gnulib@gnu.org>."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137 # func_version
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 # outputs to stdout the --version message.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 func_version ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 {
6777
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
141 year=`echo "$last_checkin_date" | sed -e 's,/.*$,,'`
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 echo "$progname (GNU $package) $version"
6777
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
143 echo "Copyright (C) $year Free Software Foundation, Inc.
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144 This is free software; see the source for copying conditions. There is NO
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6111
4bc400780d6a Update copyright year and authors.
Bruno Haible <bruno@clisp.org>
parents: 6110
diff changeset
146 echo "Written by" "Bruno Haible" "and" "Simon Josefsson"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148
6777
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
149 # func_emit_copyright_notice
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
150 # outputs to stdout a header for a generated file.
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
151 func_emit_copyright_notice ()
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
152 {
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
153 echo "# Copyright (C) 2004-2006 Free Software Foundation, Inc."
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
154 echo "#"
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
155 echo "# This file is free software, distributed under the terms of the GNU"
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
156 echo "# General Public License. As a special exception to the GNU General"
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
157 echo "# Public License, this file may be distributed as part of a program"
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
158 echo "# that contains a configuration script generated by Autoconf, under"
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
159 echo "# the same distribution terms as the rest of that program."
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
160 echo "#"
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
161 echo "# Generated by gnulib-tool."
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
162 }
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
163
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
164 # func_tmpdir
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
165 # creates a temporary directory.
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
166 # Sets variable
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
167 # - tmp pathname of freshly created temporary directory
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
168 func_tmpdir ()
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
169 {
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
170 # Use the environment variable TMPDIR, falling back to /tmp. This allows
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
171 # users to specify a different temporary directory, for example, if their
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
172 # /tmp is filled up or too small.
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
173 : ${TMPDIR=/tmp}
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
174 {
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
175 # Use the mktemp program if available. If not available, hide the error
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
176 # message.
6581
bc61a0c9a750 * gnulib-tool, build-aux/csharpcomp.sh.in: Do not pass `-q' to mktemp.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6570
diff changeset
177 tmp=`(umask 077 && mktemp -d "$TMPDIR/glXXXXXX") 2>/dev/null` &&
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
178 test -n "$tmp" && test -d "$tmp"
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
179 } ||
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
180 {
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
181 # Use a simple mkdir command. It is guaranteed to fail if the directory
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
182 # already exists. $RANDOM is bash specific and expands to empty in shells
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
183 # other than bash, ksh and zsh. Its use does not increase security;
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
184 # rather, it minimizes the probability of failure in a very cluttered /tmp
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
185 # directory.
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
186 tmp=$TMPDIR/gl$$-$RANDOM
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
187 (umask 077 && mkdir "$tmp")
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
188 } ||
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
189 {
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
190 echo "$0: cannot create a temporary directory in $TMPDIR" >&2
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
191 { (exit 1); exit 1; }
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
192 }
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
193 }
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
194
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
195 # func_fatal_error message
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
196 # outputs to stderr a fatal error message, and terminates the program.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
197 func_fatal_error ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
198 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
199 echo "gnulib-tool: *** $1" 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
200 echo "gnulib-tool: *** Stop." 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
201 exit 1
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
202 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
203
6248
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
204 # func_readlink SYMLINK
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
205 # outputs the target of the given symlink.
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
206 if (type -p readlink) > /dev/null 2>&1; then
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
207 func_readlink ()
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
208 {
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
209 # Use the readlink program from GNU coreutils.
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
210 readlink "$1"
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
211 }
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
212 else
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
213 func_readlink ()
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
214 {
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
215 # Use two sed invocations. A single sed -n -e 's,^.* -> \(.*\)$,\1,p'
6263
9750529a8cf5 Sort in a locale-independent way.
Bruno Haible <bruno@clisp.org>
parents: 6262
diff changeset
216 # would do the wrong thing if the link target contains " -> ".
6248
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
217 LC_ALL=C ls -l "$1" | sed -e 's, -> ,#%%#,' | sed -n -e 's,^.*#%%#\(.*\)$,\1,p'
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
218 }
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
219 fi
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
220
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
221 # func_ln_if_changed SRC DEST
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
222 # Like ln -s, but avoids munging timestamps if the link is correct.
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
223 func_ln_if_changed ()
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
224 {
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
225 if test $# -ne 2; then
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
226 echo "usage: func_ln_if_changed SRC DEST" >&2
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
227 fi
6248
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
228 if test -L "$2" && test "$1" = "`func_readlink "$2"`"; then
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
229 :
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
230 else
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
231 rm -f "$2"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
232 ln -s "$1" "$2"
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
233 fi
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
234 }
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
235
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
236 # Command-line option processing.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
237 # Removes the OPTIONS from the arguments. Sets the variables:
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
238 # - mode list or import or create-testdir or create-megatestdir
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
239 # - destdir from --dir
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
240 # - libname, supplied_libname from --lib
5198
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
241 # - sourcebase from --source-base
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
242 # - m4base from --m4-base
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
243 # - docbase from --doc-base
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
244 # - testsbase from --tests-base
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
245 # - auxdir from --aux-dir
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
246 # - inctests true if --with-tests was given, blank otherwise
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
247 # - avoidlist list of modules to avoid, from --avoid
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
248 # - lgpl true if --lgpl was given, blank otherwise
5198
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
249 # - libtool true if --libtool was given, blank otherwise
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
250 # - do_changelog false if --no-changelog was given, : otherwise
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
251 # - doit : if actions shall be executed, false if only to be printed
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
252 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
253 mode=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
254 destdir=
5198
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
255 libname=libgnu
5344
c2f5677fc6ed Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents: 5343
diff changeset
256 supplied_libname=
5202
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
257 sourcebase=
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
258 m4base=
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
259 docbase=
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
260 testsbase=
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
261 auxdir=
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
262 inctests=
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
263 avoidlist=
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
264 lgpl=
5198
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
265 libtool=
6176
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
266 macro_prefix=
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
267 do_changelog=:
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
268 doit=:
5799
ad9eff556694 2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5798
diff changeset
269 symbolic=
5202
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
270
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
271 supplied_opts="$@"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
272
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
273 while test $# -gt 0; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
274 case "$1" in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
275 --list | --lis )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
276 mode=list
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
277 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
278 --import | --impor | --impo | --imp | --im | --i )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
279 mode=import
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
280 shift ;;
6443
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
281 --update | --updat | --upda | --upd | --up | --u )
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
282 mode=update
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
283 shift ;;
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
284 --create-testdir | --create-testdi | --create-testd | --create-test | --create-tes | --create-te | --create-t )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
285 mode=create-testdir
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
286 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
287 --create-megatestdir | --create-megatestdi | --create-megatestd | --create-megatest | --create-megates | --create-megate | --create-megat | --create-mega | --create-meg | --create-me | --create-m )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
288 mode=create-megatestdir
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
289 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
290 --test | --tes | --te | --t )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
291 mode=test
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
292 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
293 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
294 mode=megatest
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
295 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
296 --extract-* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
297 mode=`echo "X$1" | sed -e 's/^X--//'`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
298 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
299 --dir )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
300 shift
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
301 if test $# = 0; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
302 func_fatal_error "missing argument for --dir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
303 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
304 destdir=$1
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
305 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
306 --dir=* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
307 destdir=`echo "X$1" | sed -e 's/^X--dir=//'`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
308 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
309 --lib )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
310 shift
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
311 if test $# = 0; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
312 func_fatal_error "missing argument for --lib"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
313 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
314 libname=$1
5343
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
315 supplied_libname=true
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
316 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
317 --lib=* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
318 libname=`echo "X$1" | sed -e 's/^X--lib=//'`
5343
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
319 supplied_libname=true
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
320 shift ;;
5198
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
321 --source-base )
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
322 shift
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
323 if test $# = 0; then
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
324 func_fatal_error "missing argument for --source-base"
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
325 fi
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
326 sourcebase=$1
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
327 shift ;;
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
328 --source-base=* )
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
329 sourcebase=`echo "X$1" | sed -e 's/^X--source-base=//'`
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
330 shift ;;
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
331 --m4-base )
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
332 shift
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
333 if test $# = 0; then
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
334 func_fatal_error "missing argument for --m4-base"
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
335 fi
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
336 m4base=$1
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
337 shift ;;
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
338 --m4-base=* )
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
339 m4base=`echo "X$1" | sed -e 's/^X--m4-base=//'`
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
340 shift ;;
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
341 --doc-base )
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
342 shift
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
343 if test $# = 0; then
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
344 func_fatal_error "missing argument for --doc-base"
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
345 fi
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
346 docbase=$1
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
347 shift ;;
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
348 --doc-base=* )
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
349 docbase=`echo "X$1" | sed -e 's/^X--doc-base=//'`
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
350 shift ;;
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
351 --tests-base )
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
352 shift
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
353 if test $# = 0; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
354 func_fatal_error "missing argument for --tests-base"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
355 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
356 testsbase=$1
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
357 shift ;;
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
358 --tests-base=* )
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
359 testsbase=`echo "X$1" | sed -e 's/^X--tests-base=//'`
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
360 shift ;;
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
361 --aux-dir )
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
362 shift
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
363 if test $# = 0; then
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
364 func_fatal_error "missing argument for --aux-dir"
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
365 fi
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
366 auxdir=$1
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
367 shift ;;
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
368 --aux-dir=* )
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
369 auxdir=`echo "X$1" | sed -e 's/^X--aux-dir=//'`
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
370 shift ;;
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
371 --with-tests )
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
372 inctests=true
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
373 shift ;;
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
374 --avoid )
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
375 shift
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
376 if test $# = 0; then
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
377 func_fatal_error "missing argument for --avoid"
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
378 fi
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
379 avoidlist="$avoidlist $1"
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
380 shift ;;
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
381 --avoid=* )
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
382 avoidlist="$avoidlist "`echo "X$1" | sed -e 's/^X--avoid=//'`
5198
9317c9ebe82c Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4717
diff changeset
383 shift ;;
5262
97ed4b64d853 New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents: 5255
diff changeset
384 --lgpl )
97ed4b64d853 New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents: 5255
diff changeset
385 lgpl=true
97ed4b64d853 New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents: 5255
diff changeset
386 shift ;;
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
387 --libtool )
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
388 libtool=true
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
389 shift ;;
6176
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
390 --macro-prefix )
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
391 shift
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
392 if test $# = 0; then
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
393 func_fatal_error "missing argument for --macro-prefix"
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
394 fi
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
395 macro_prefix="$1"
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
396 shift ;;
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
397 --macro-prefix=* )
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
398 macro_prefix=`echo "X$1" | sed -e 's/^X--macro-prefix=//'`
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
399 shift ;;
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
400 --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
401 do_changelog=false
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
402 shift ;;
5202
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
403 --dry-run )
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
404 doit=false
5202
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
405 shift ;;
6443
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
406 -s | --symbolic | --symboli | --symbol | --symbo | --symb | --symlink | --symlin | --symli | --syml | --sym | --sy )
5799
ad9eff556694 2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5798
diff changeset
407 symbolic=true
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
408 shift ;;
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
409 --help | --hel | --he | --h )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
410 func_usage
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
411 exit 0 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
412 --version | --versio | --versi | --vers | --ver | --ve | --v )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
413 func_version
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
414 exit 0 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
415 -- )
6264
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
416 # Stop option processing
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
417 shift
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
418 break ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
419 -* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
420 echo "gnulib-tool: unknown option $1" 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
421 echo "Try 'gnulib-tool --help' for more information." 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
422 exit 1 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
423 * )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
424 break ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
425 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
426 done
6264
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
427
6443
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
428 if test "$mode" = update; then
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
429 if test $# != 0; then
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
430 echo "gnulib-tool: too many arguments in 'update' mode" 1>&2
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
431 echo "Try 'gnulib-tool --help' for more information." 1>&2
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
432 echo "If you really want to modify the gnulib configuration of your project," 1>&2
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
433 echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
434 exit 1
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
435 fi
6765
eccab879e7e7 Make --update option actually work.
Bruno Haible <bruno@clisp.org>
parents: 6756
diff changeset
436 if test -n "$supplied_libname" || test -n "$sourcebase" || test -n "$m4base" \
6443
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
437 || test -n "$testsbase" || test -n "$auxdir" || test -n "$inctests" \
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
438 || test -n "$docbase" \
6443
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
439 || test -n "$avoidlist" || test -n "$lgpl" || test -n "$macro_prefix"; then
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
440 echo "gnulib-tool: invalid options for 'update' mode" 1>&2
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
441 echo "Try 'gnulib-tool --help' for more information." 1>&2
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
442 echo "If you really want to modify the gnulib configuration of your project," 1>&2
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
443 echo "you need to use 'gnulib --import' - at your own risk!" 1>&2
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
444 exit 1
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
445 fi
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
446 do_changelog=false
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
447 fi
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
448
6264
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
449 # Remove trailing slashes from the directory names. This is necessary for
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
450 # m4base (to avoid an error in func_import) and optional for the others.
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
451 sed_trimtrailingslashes='s,\([^/]\)//*$,\1,'
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
452 case "$sourcebase" in
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
453 */ ) sourcebase=`echo "$sourcebase" | sed -e "$sed_trimtrailingslashes"` ;;
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
454 esac
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
455 case "$m4base" in
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
456 */ ) m4base=`echo "$m4base" | sed -e "$sed_trimtrailingslashes"` ;;
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
457 esac
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
458 case "$docbase" in
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
459 */ ) docbase=`echo "$docbase" | sed -e "$sed_trimtrailingslashes"` ;;
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
460 esac
6264
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
461 case "$testsbase" in
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
462 */ ) testsbase=`echo "$testsbase" | sed -e "$sed_trimtrailingslashes"` ;;
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
463 esac
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
464 case "$auxdir" in
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
465 */ ) auxdir=`echo "$auxdir" | sed -e "$sed_trimtrailingslashes"` ;;
eaa3b6787ec9 Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents: 6263
diff changeset
466 esac
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
467 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
468
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
469 case "$0" in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
470 /*) self_abspathname="$0" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
471 */*) self_abspathname=`pwd`/"$0" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
472 *) for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'`; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
473 if test -x "$d/$0" && test ! -d "$d/$0"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
474 self_abspathname="$d/$0"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
475 break
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
476 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
477 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
478 if test -z "$self_abspathname"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
479 func_fatal_error "could not locate the gnulib-tool program - how did you invoke it?"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
480 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
481 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
482 esac
4717
ed7cd4050365 Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents: 4712
diff changeset
483 while test -h "$self_abspathname"; do
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
484 # Resolve symbolic link.
6248
ba937772eda4 Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents: 6247
diff changeset
485 linkval=`func_readlink "$self_abspathname"`
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
486 test -n "$linkval" || break
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
487 case "$linkval" in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
488 /* ) self_abspathname="$linkval" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
489 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
490 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
491 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
492 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
493
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
494 # func_all_modules
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
495 func_all_modules ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
496 {
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
497 # Filter out metainformation files like README, which are not modules.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
498 # Filter out unit test modules; they can be retrieved through
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
499 # --extract-tests-module if desired.
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
500 (cd "$gnulib_dir/modules" && ls -1) \
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
501 | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^README$/d' -e '/^TEMPLATE$/d' -e '/^TEMPLATE-TESTS$/d' -e '/~$/d' \
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
502 | sed -e '/-tests$/d' \
6263
9750529a8cf5 Sort in a locale-independent way.
Bruno Haible <bruno@clisp.org>
parents: 6262
diff changeset
503 | LC_ALL=C sort
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
504 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
505
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
506 # func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
507 # verifies a module name
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
508 func_verify_module ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
509 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
510 if test ! -f "$gnulib_dir/modules/$module" \
4128
1346b5405a74 (func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents: 4126
diff changeset
511 || test "CVS" = "$module" \
1346b5405a74 (func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents: 4126
diff changeset
512 || test "ChangeLog" = "$module" \
5312
47f04c1cec16 'README' is not a module.
Bruno Haible <bruno@clisp.org>
parents: 5268
diff changeset
513 || test "README" = "$module" \
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
514 || test "TEMPLATE" = "$module" \
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
515 || test "TEMPLATE-TESTS" = "$module"; then
4128
1346b5405a74 (func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents: 4126
diff changeset
516 echo "gnulib-tool: module $module doesn't exist" 1>&2
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
517 module=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
518 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
519 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
520
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
521 # func_verify_nontests_module
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
522 # verifies a module name, excluding tests modules
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
523 func_verify_nontests_module ()
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
524 {
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
525 case "$module" in
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
526 *-tests ) module= ;;
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
527 * ) func_verify_module ;;
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
528 esac
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
529 }
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
530
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
531 # func_verify_tests_module
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
532 # verifies a module name, considering only tests modules
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
533 func_verify_tests_module ()
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
534 {
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
535 case "$module" in
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
536 *-tests ) func_verify_module ;;
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
537 * ) module= ;;
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
538 esac
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
539 }
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
540
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
541 sed_extract_prog=':[ ]*$/ {
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
542 :a
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
543 n
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
544 s/^Description:[ ]*$//
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
545 s/^Files:[ ]*$//
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
546 s/^Depends-on:[ ]*$//
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
547 s/^configure\.ac:[ ]*$//
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
548 s/^Makefile\.am:[ ]*$//
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
549 s/^Include:[ ]*$//
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
550 s/^License:[ ]*$//
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
551 s/^Maintainer:[ ]*$//
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
552 tb
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
553 p
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
554 ba
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
555 :b
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
556 }'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
557
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
558 # func_get_description module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
559 func_get_description ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
560 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
561 sed -n -e "/^Description$sed_extract_prog" < "$gnulib_dir/modules/$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
562 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
563
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
564 # func_get_filelist module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
565 func_get_filelist ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
566 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
567 sed -n -e "/^Files$sed_extract_prog" < "$gnulib_dir/modules/$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
568 #echo m4/onceonly.m4
6940
ca8592ba8eba * gnulib-tool (func_get_filelist): Don't echo m4/onceonly_2_57.m4,
Paul Eggert <eggert@cs.ucla.edu>
parents: 6862
diff changeset
569 #echo m4/onceonly_2_57.m4
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
570 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
571
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
572 # func_get_dependencies module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
573 func_get_dependencies ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
574 {
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
575 # ${module}-tests always implicitly depends on ${module}.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
576 echo "$1" | sed -n -e 's/-tests//p'
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
577 # Then the explicit dependencies listed in the module description.
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
578 sed -n -e "/^Depends-on$sed_extract_prog" < "$gnulib_dir/modules/$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
579 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
580
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
581 # func_get_autoconf_snippet module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
582 func_get_autoconf_snippet ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
583 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
584 sed -n -e "/^configure\.ac$sed_extract_prog" < "$gnulib_dir/modules/$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
585 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
586
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
587 # func_get_automake_snippet module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
588 func_get_automake_snippet ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
589 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
590 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$gnulib_dir/modules/$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
591 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
592
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
593 # func_get_include_directive module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
594 func_get_include_directive ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
595 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
596 sed -n -e "/^Include$sed_extract_prog" < "$gnulib_dir/modules/$1" | \
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
597 sed -e 's/^\(["<]\)/#include \1/'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
598 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
599
5251
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
600 # func_get_license module
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
601 func_get_license ()
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
602 {
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
603 sed -n -e "/^License$sed_extract_prog" < "$gnulib_dir/modules/$1"
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
604 }
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
605
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
606 # func_get_maintainer module
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
607 func_get_maintainer ()
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
608 {
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
609 sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1"
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
610 }
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
611
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
612 # func_get_tests_module module
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
613 func_get_tests_module ()
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
614 {
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
615 # The naming convention for tests modules is hardwired: ${module}-tests.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
616 if test -f modules/"$1"-tests; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
617 echo "$1"-tests
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
618 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
619 }
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
620
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
621 # func_acceptable module
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
622 # tests whether a module is acceptable.
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
623 # Input:
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
624 # - avoidlist list of modules to avoid
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
625 func_acceptable ()
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
626 {
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
627 for avoid in $avoidlist; do
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
628 if test "$avoid" = "$1"; then
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
629 return 1
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
630 fi
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
631 done
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
632 return 0
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
633 }
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
634
5347
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
635 # func_modules_transitive_closure
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
636 # Input:
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
637 # - modules list of specified modules
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
638 # - inctests true if tests should be included, blank otherwise
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
639 # - avoidlist list of modules to avoid
5347
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
640 # Output:
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
641 # - modules list of modules, including dependencies
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
642 func_modules_transitive_closure ()
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
643 {
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
644 while true; do
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
645 xmodules=
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
646 for module in $modules; do
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
647 func_verify_module
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
648 if test -n "$module"; then
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
649 # Duplicate dependencies are harmless, but Jim wants a warning.
6263
9750529a8cf5 Sort in a locale-independent way.
Bruno Haible <bruno@clisp.org>
parents: 6262
diff changeset
650 duplicated_deps=`func_get_dependencies $module | LC_ALL=C sort | LC_ALL=C uniq -d`
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
651 if test -n "$duplicated_deps"; then
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
652 echo "warning: module $module has duplicated dependencies: "`echo $duplicated_deps` 1>&2
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
653 fi
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
654 if func_acceptable $module; then
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
655 xmodules="$xmodules $module"
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
656 for depmodule in `func_get_dependencies $module`; do
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
657 if func_acceptable $depmodule; then
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
658 xmodules="$xmodules $depmodule"
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
659 fi
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
660 done
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
661 if test -n "$inctests"; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
662 testsmodule=`func_get_tests_module $module`
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
663 if test -n "$testsmodule"; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
664 if func_acceptable $testsmodule; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
665 xmodules="$xmodules $testsmodule"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
666 for depmodule in `func_get_dependencies $testsmodule`; do
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
667 if func_acceptable $depmodule; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
668 xmodules="$xmodules $depmodule"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
669 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
670 done
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
671 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
672 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
673 fi
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
674 fi
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
675 fi
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
676 done
6263
9750529a8cf5 Sort in a locale-independent way.
Bruno Haible <bruno@clisp.org>
parents: 6262
diff changeset
677 xmodules=`for m in $xmodules; do echo $m; done | LC_ALL=C sort | LC_ALL=C uniq`
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
678 if test "$xmodules" = "$modules"; then
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
679 break
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
680 fi
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
681 modules="$xmodules"
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
682 done
5347
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
683 }
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
684
6550
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
685 # func_modules_add_dummy
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
686 # Input:
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
687 # - modules list of modules, including dependencies
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
688 # Output:
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
689 # - modules list of modules, including 'dummy' if needed
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
690 func_modules_add_dummy ()
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
691 {
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
692 have_lib_SOURCES=
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
693 sed_remove_backslash_newline=':a
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
694 /\\$/{
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
695 s/\\$//
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
696 N
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
697 s/\n//
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
698 ba
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
699 }'
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
700 for module in $modules; do
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
701 func_verify_nontests_module
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
702 if test -n "$module"; then
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
703 # Extract the value of "lib_SOURCES += ...".
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
704 for file in `func_get_automake_snippet "$module" | sed -e "$sed_remove_backslash_newline" | sed -n -e 's,^lib_SOURCES[ ]*+=\([^#]*\).*$,\1,p'`; do
6550
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
705 # Ignore .h files since they are not compiled.
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
706 case "$file" in
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
707 *.h) ;;
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
708 *) have_lib_SOURCES=yes ;;
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
709 esac
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
710 done
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
711 fi
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
712 done
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
713 # Add the dummy module, to make sure the library will be non-empty.
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
714 if test -z "$have_lib_SOURCES"; then
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
715 modules="$modules dummy"
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
716 fi
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
717 }
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
718
5348
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
719 # func_modules_to_filelist
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
720 # Input:
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
721 # - modules list of modules, including dependencies
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
722 # Output:
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
723 # - files list of files
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
724 func_modules_to_filelist ()
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
725 {
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
726 files=
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
727 for module in $modules; do
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
728 func_verify_module
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
729 if test -n "$module"; then
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
730 files="$files "`func_get_filelist $module`
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
731 fi
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
732 done
6263
9750529a8cf5 Sort in a locale-independent way.
Bruno Haible <bruno@clisp.org>
parents: 6262
diff changeset
733 files=`for f in $files; do echo $f; done | LC_ALL=C sort | LC_ALL=C uniq`
5348
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
734 }
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
735
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
736 # func_emit_lib_Makefile_am
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
737 # emits the contents of lib/Makefile.am to standard output.
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
738 # Input:
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
739 # - modules list of modules, including dependencies
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
740 # - libname library name
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
741 # - libtool true if libtool will be used, blank otherwise
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
742 # - actioncmd (optional) command that will reproduce this invocation
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
743 func_emit_lib_Makefile_am ()
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
744 {
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
745 if test -n "$libtool"; then
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
746 libext=la
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
747 perhapsLT=LT
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
748 else
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
749 libext=a
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
750 perhapsLT=
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
751 fi
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
752 echo "## Process this file with automake to produce Makefile.in."
6777
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
753 func_emit_copyright_notice
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
754 if test -n "$actioncmd"; then
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
755 echo "# Reproduce by: $actioncmd"
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
756 fi
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
757 echo
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
758 # No need to generate dependencies since the sources are in gnulib, not here.
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
759 echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies"
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
760 echo
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
761 echo "noinst_${perhapsLT}LIBRARIES = $libname.$libext"
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
762 echo
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
763 echo "${libname}_${libext}_SOURCES ="
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
764 echo "${libname}_${libext}_LIBADD = @${perhapsLT}LIBOBJS@"
6548
060487c0b13c Initialize also noinst_HEADERS to empty.
Bruno Haible <bruno@clisp.org>
parents: 6547
diff changeset
765 echo "noinst_HEADERS ="
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
766 echo "EXTRA_DIST ="
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
767 echo "BUILT_SOURCES ="
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
768 echo "SUFFIXES ="
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
769 echo "MOSTLYCLEANFILES ="
6862
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
770 echo "MOSTLYCLEANDIRS ="
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
771 echo "CLEANFILES ="
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
772 echo "DISTCLEANFILES ="
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
773 echo "MAINTAINERCLEANFILES ="
5352
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
774 echo
6750
608add4e5b80 Support for packages that use "gettextize --intl". From Claudio Fontana.
Bruno Haible <bruno@clisp.org>
parents: 6745
diff changeset
775 echo "AM_CPPFLAGS ="
608add4e5b80 Support for packages that use "gettextize --intl". From Claudio Fontana.
Bruno Haible <bruno@clisp.org>
parents: 6745
diff changeset
776 echo
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
777 for module in $modules; do
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
778 func_verify_nontests_module
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
779 if test -n "$module"; then
5352
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
780 {
5527
1270fb7d6695 (func_emit_lib_Makefile_am): Shorten a long sed command.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5358
diff changeset
781 func_get_automake_snippet "$module" |
1270fb7d6695 (func_emit_lib_Makefile_am): Shorten a long sed command.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5358
diff changeset
782 sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g'
5352
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
783 if test "$module" = 'alloca'; then
5358
e3d296179cc6 (func_emit_lib_Makefile_am): Fix typo: a $ was
Paul Eggert <eggert@cs.ucla.edu>
parents: 5357
diff changeset
784 echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@"
5352
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
785 fi
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
786 } > amsnippet.tmp
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
787 # Skip the contents if its entirely empty.
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
788 if grep '[^ ]' amsnippet.tmp > /dev/null ; then
5352
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
789 echo "## begin gnulib module $module"
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
790 echo
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
791 cat amsnippet.tmp
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
792 echo "## end gnulib module $module"
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
793 echo
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
794 fi
5352
f1f20fc1ff2f Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents: 5351
diff changeset
795 rm -f amsnippet.tmp
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
796 fi
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
797 done
5357
8bce169f70cc Fix comments. Fix parse problem.
Simon Josefsson <simon@josefsson.org>
parents: 5356
diff changeset
798 echo
6862
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
799 echo "mostlyclean-local:"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
800 echo " @test -z \"\$(MOSTLYCLEANDIRS)\" || \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
801 echo " for dir in \$(MOSTLYCLEANDIRS); do \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
802 echo " if test -d \$\$dir; then \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
803 echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
804 echo " fi; \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
805 echo " done"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
806 echo
5357
8bce169f70cc Fix comments. Fix parse problem.
Simon Josefsson <simon@josefsson.org>
parents: 5356
diff changeset
807 echo "# Makefile.am ends here"
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
808 }
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
809
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
810 # func_emit_tests_Makefile_am
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
811 # emits the contents of tests/Makefile.am to standard output.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
812 # Input:
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
813 # - modules list of modules, including dependencies
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
814 # - libname library name
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
815 # - libtool true if libtool will be used, blank otherwise
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
816 # - sourcebase relative directory containing lib source code
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
817 # - m4base relative directory containing autoconf macros
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
818 # - testsbase relative directory containing unit test code
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
819 func_emit_tests_Makefile_am ()
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
820 {
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
821 if test -n "$libtool"; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
822 libext=la
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
823 else
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
824 libext=a
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
825 fi
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
826 testsbase_inverse=`echo "$testsbase" | sed -e 's,/$,,' | sed -e 's,[^/][^/]*,..,g'`
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
827 echo "## Process this file with automake to produce Makefile.in."
6777
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
828 func_emit_copyright_notice
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
829 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
830 # Generate dependencies here, since it eases the debugging of test failures.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
831 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
832 echo
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
833 echo "ACLOCAL_AMFLAGS = -I ${testsbase_inverse}/${m4base}"
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
834 echo
6533
6bc4290ca85f Avoid an automake error regarding the 'gettext' module.
Bruno Haible <bruno@clisp.org>
parents: 6512
diff changeset
835 # Nothing is being added to SUBDIRS; nevertheless the existence of this
6bc4290ca85f Avoid an automake error regarding the 'gettext' module.
Bruno Haible <bruno@clisp.org>
parents: 6512
diff changeset
836 # variable is needed to avoid an error from automake:
6bc4290ca85f Avoid an automake error regarding the 'gettext' module.
Bruno Haible <bruno@clisp.org>
parents: 6512
diff changeset
837 # "AM_GNU_GETTEXT used but SUBDIRS not defined"
6bc4290ca85f Avoid an automake error regarding the 'gettext' module.
Bruno Haible <bruno@clisp.org>
parents: 6512
diff changeset
838 echo "SUBDIRS ="
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
839 echo "TESTS ="
6380
9bc99115d4d6 Small tweaks.
Bruno Haible <bruno@clisp.org>
parents: 6264
diff changeset
840 echo "TESTS_ENVIRONMENT ="
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
841 echo "noinst_PROGRAMS ="
6570
c965a389db71 Simplify my *-tests modules.
Simon Josefsson <simon@josefsson.org>
parents: 6556
diff changeset
842 echo "check_PROGRAMS ="
6548
060487c0b13c Initialize also noinst_HEADERS to empty.
Bruno Haible <bruno@clisp.org>
parents: 6547
diff changeset
843 echo "noinst_HEADERS ="
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
844 echo "EXTRA_DIST ="
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
845 echo "BUILT_SOURCES ="
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
846 echo "SUFFIXES ="
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
847 echo "MOSTLYCLEANFILES ="
6862
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
848 echo "MOSTLYCLEANDIRS ="
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
849 echo "CLEANFILES ="
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
850 echo "DISTCLEANFILES ="
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
851 echo "MAINTAINERCLEANFILES ="
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
852 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
853 echo "AM_CPPFLAGS = \\"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
854 echo " -I. -I\$(srcdir) \\"
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
855 echo " -I${testsbase_inverse} -I\$(srcdir)/${testsbase_inverse} \\"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
856 echo " -I${testsbase_inverse}/${sourcebase-lib} -I\$(srcdir)/${testsbase_inverse}/${sourcebase-lib}"
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
857 echo
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
858 echo "LDADD = ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext}"
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
859 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
860 for module in $modules; do
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
861 func_verify_tests_module
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
862 if test -n "$module"; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
863 func_get_automake_snippet "$module" > amsnippet.tmp
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
864 # Skip the contents if its entirely empty.
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
865 if grep '[^ ]' amsnippet.tmp > /dev/null ; then
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
866 echo "## begin gnulib module $module"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
867 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
868 cat amsnippet.tmp
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
869 echo "## end gnulib module $module"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
870 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
871 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
872 rm -f amsnippet.tmp
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
873 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
874 done
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
875 echo "# Clean up after Solaris cc."
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
876 echo "clean-local:"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
877 echo " rm -rf SunWS_cache"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
878 echo
6862
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
879 echo "mostlyclean-local:"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
880 echo " @test -z \"\$(MOSTLYCLEANDIRS)\" || \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
881 echo " for dir in \$(MOSTLYCLEANDIRS); do \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
882 echo " if test -d \$\$dir; then \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
883 echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
884 echo " fi; \\"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
885 echo " done"
ba1b5722df42 Invent MOSTLYCLEANDIRS.
Bruno Haible <bruno@clisp.org>
parents: 6777
diff changeset
886 echo
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
887 echo "# Makefile.am ends here"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
888 }
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
889
5347
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
890 # func_import modules
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
891 # Uses also the variables
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
892 # - destdir target directory
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
893 # - libname library name
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
894 # - sourcebase directory relative to destdir where to place source code
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
895 # - m4base directory relative to destdir where to place *.m4 macros
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
896 # - docbase directory relative to destdir where to place doc files
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
897 # - testsbase directory relative to destdir where to place unit test code
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
898 # - auxdir directory relative to destdir where to place build aux files
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
899 # - inctests true if --with-tests was given, blank otherwise
5981
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
900 # - avoidlist list of modules to avoid, from --avoid
09850e201e79 New option --avoid.
Bruno Haible <bruno@clisp.org>
parents: 5963
diff changeset
901 # - lgpl true if library's license shall be LGPL, blank otherwise
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
902 # - libtool true if libtool will be used, blank otherwise
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
903 # - guessed_libtool true if the configure.ac file uses libtool, blank otherwise
6176
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
904 # - macro_prefix prefix of gl_EARLY, gl_INIT macros to use
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
905 # - doit : if actions shall be executed, false if only to be printed
5799
ad9eff556694 2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5798
diff changeset
906 # - symbolic true if files should be symlinked, copied otherwise
5347
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
907 func_import ()
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
908 {
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
909 # Get the cached settings.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
910 cached_specified_modules=
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
911 cached_avoidlist=
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
912 cached_sourcebase=
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
913 cached_m4base=
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
914 cached_docbase=
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
915 cached_testsbase=
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
916 cached_libname=
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
917 cached_lgpl=
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
918 cached_libtool=
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
919 cached_macro_prefix=
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
920 cached_files=
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
921 if test -f "$destdir"/$m4base/gnulib-cache.m4; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
922 my_sed_traces='
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
923 s,#.*$,,
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
924 s,^dnl .*$,,
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
925 s, dnl .*$,,
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
926 /gl_MODULES(/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
927 s,^.*gl_MODULES([[ ]*\([^])]*\).*$,cached_specified_modules="\1",p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
928 }
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
929 /gl_AVOID(/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
930 s,^.*gl_AVOID([[ ]*\([^])]*\).*$,cached_avoidlist="\1",p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
931 }
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
932 /gl_SOURCE_BASE(/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
933 s,^.*gl_SOURCE_BASE([[ ]*\([^])]*\).*$,cached_sourcebase="\1",p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
934 }
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
935 /gl_M4_BASE(/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
936 s,^.*gl_M4_BASE([[ ]*\([^])]*\).*$,cached_m4base="\1",p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
937 }
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
938 /gl_DOC_BASE(/ {
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
939 s,^.*gl_DOC_BASE([[ ]*\([^])]*\).*$,cached_docbase="\1",p
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
940 }
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
941 /gl_TESTS_BASE(/ {
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
942 s,^.*gl_TESTS_BASE([[ ]*\([^])]*\).*$,cached_testsbase="\1",p
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
943 }
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
944 /gl_LIB(/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
945 s,^.*gl_LIB([[ ]*\([^])]*\).*$,cached_libname="\1",p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
946 }
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
947 /gl_LGPL/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
948 s,^.*$,cached_lgpl=true,p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
949 }
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
950 /gl_LIBTOOL/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
951 s,^.*$,cached_libtool=true,p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
952 }
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
953 /gl_MACRO_PREFIX(/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
954 s,^.*gl_MACRO_PREFIX([[ ]*\([^])]*\).*$,cached_macro_prefix="\1",p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
955 }'
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
956 eval `sed -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-cache.m4`
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
957 if test -f "$destdir"/$m4base/gnulib-comp.m4; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
958 my_sed_traces='
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
959 s,#.*$,,
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
960 s,^dnl .*$,,
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
961 s, dnl .*$,,
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
962 /AC_DEFUN(\['"${cached_macro_prefix}"'_FILE_LIST\], \[/ {
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
963 s,^.*$,cached_files=",p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
964 n
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
965 ta
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
966 :a
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
967 s,^\]).*$,",
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
968 tb
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
969 p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
970 n
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
971 ba
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
972 :b
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
973 p
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
974 }'
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
975 eval `sed -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-comp.m4`
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
976 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
977 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
978
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
979 # Merge the cached settings with the specified ones.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
980 # The m4base must be the same as expected from the pathname.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
981 if test -n "$cached_m4base" && test "$cached_m4base" != "$m4base"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
982 func_fatal_error "$m4base/gnulib-cache.m4 is expected to contain gl_M4_BASE([$m4base])"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
983 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
984 # Append the cached and the specified module names. So that
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
985 # "gnulib-tool --import foo" means to add the module foo.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
986 specified_modules="$cached_specified_modules $1"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
987 # Append the cached and the specified avoidlist. This is probably better
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
988 # than dropping the cached one when --avoid is specified at least once.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
989 avoidlist=`echo $cached_avoidlist $avoidlist`
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
990 # The sourcebase defaults to the cached one.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
991 if test -z "$sourcebase"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
992 sourcebase="$cached_sourcebase"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
993 if test -z "$sourcebase"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
994 func_fatal_error "missing --source-base option"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
995 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
996 fi
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
997 # The docbase defaults to the cached one.
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
998 if test -z "$docbase"; then
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
999 docbase="$cached_docbase"
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1000 if test -z "$docbase"; then
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1001 func_fatal_error "missing --doc-base option"
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1002 fi
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1003 fi
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1004 # The testsbase defaults to the cached one.
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1005 if test -z "$testsbase"; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1006 testsbase="$cached_testsbase"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1007 if test -z "$testsbase"; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1008 func_fatal_error "missing --tests-base option"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1009 fi
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1010 fi
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1011 # The libname defaults to the cached one.
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1012 if test -z "$supplied_libname"; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1013 libname="$cached_libname"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1014 if test -z "$libname"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1015 func_fatal_error "missing --lib option"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1016 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1017 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1018 # Require LGPL if specified either way.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1019 if test -z "$lgpl"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1020 lgpl="$cached_lgpl"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1021 fi
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1022 # Use libtool if specified either way, or if guessed.
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1023 if test -z "$libtool"; then
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1024 if test -n "$cached_m4base"; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1025 libtool="$cached_libtool"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1026 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1027 libtool="$guessed_libtool"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1028 fi
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1029 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1030 # The macro_prefix defaults to the cached one.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1031 if test -z "$macro_prefix"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1032 macro_prefix="$cached_macro_prefix"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1033 if test -z "$macro_prefix"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1034 func_fatal_error "missing --macro-prefix option"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1035 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1036 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1037
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1038 # Canonicalize the list of specified modules.
6263
9750529a8cf5 Sort in a locale-independent way.
Bruno Haible <bruno@clisp.org>
parents: 6262
diff changeset
1039 specified_modules=`for m in $specified_modules; do echo $m; done | LC_ALL=C sort | LC_ALL=C uniq`
5347
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
1040
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
1041 # Determine final module list.
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1042 modules="$specified_modules"
5347
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
1043 func_modules_transitive_closure
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1044 echo "Module list with included dependencies:"
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1045 echo "$modules" | sed -e 's/^/ /'
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1046
6550
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
1047 # Add the dummy module if needed.
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
1048 func_modules_add_dummy
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
1049
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1050 # If --lgpl, check the license of modules are compatible.
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1051 if test -n "$lgpl"; then
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1052 for module in $modules; do
5346
40f5d74050d5 Use func_get_license.
Bruno Haible <bruno@clisp.org>
parents: 5345
diff changeset
1053 license=`func_get_license $module`
5963
6fb8c48c4dcd * gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5848
diff changeset
1054 case $license in
6464
d4112cb80f32 Accept GPLed build tool modules when --lgpl is given.
Bruno Haible <bruno@clisp.org>
parents: 6443
diff changeset
1055 LGPL | 'GPLed build tool' | 'public domain' | 'unlimited') ;;
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1056 *) func_fatal_error "incompatible license on module $module: $license" ;;
5963
6fb8c48c4dcd * gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5848
diff changeset
1057 esac
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1058 done
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1059 fi
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1060
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1061 # Determine final file list.
5348
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
1062 func_modules_to_filelist
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1063 echo "File list:"
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1064 echo "$files" | sed -e 's/^/ /'
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1065
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1066 test -n "$files" \
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1067 || func_fatal_error "refusing to do nothing"
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1068
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1069 # Add m4/gnulib-tool.m4 to the file list. It is not part of any module.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1070 new_files="$files m4/gnulib-tool.m4"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1071 old_files="$cached_files"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1072 if test -f "$destdir"/$m4base/gnulib-tool.m4; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1073 old_files="$old_files m4/gnulib-tool.m4"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1074 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1075
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1076 # Create directories.
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1077 if test ! -d "$destdir/$sourcebase"; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1078 if $doit; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1079 echo "Creating directory $destdir/$sourcebase"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1080 mkdir "$destdir/$sourcebase" || func_fatal_error "failed"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1081 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1082 echo "Create directory $destdir/$sourcebase"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1083 fi
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1084 fi
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1085 if test ! -d "$destdir/$m4base"; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1086 if $doit; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1087 echo "Creating directory $destdir/$m4base"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1088 mkdir "$destdir/$m4base" || func_fatal_error "failed"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1089 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1090 echo "Create directory $destdir/$m4base"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1091 fi
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1092 fi
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1093 if test ! -d "$destdir/$docbase"; then
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1094 if $doit; then
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1095 echo "Creating directory $destdir/$docbase"
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1096 mkdir "$destdir/$docbase" || func_fatal_error "failed"
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1097 else
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1098 echo "Create directory $destdir/$docbase"
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1099 fi
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1100 fi
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1101 if test -n "$inctests"; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1102 if test ! -d "$destdir/$testsbase"; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1103 if $doit; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1104 echo "Creating directory $destdir/$testsbase"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1105 mkdir "$destdir/$testsbase" || func_fatal_error "failed"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1106 else
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1107 echo "Create directory $destdir/$testsbase"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1108 fi
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1109 fi
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1110 fi
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1111 if test ! -d "$destdir/$auxdir"; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1112 if $doit; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1113 echo "Creating directory $destdir/$auxdir"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1114 mkdir "$destdir/$auxdir" || func_fatal_error "failed"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1115 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1116 echo "Create directory $destdir/$auxdir"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1117 fi
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1118 fi
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1119
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1120 func_tmpdir
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1121 trap 'rm -rf "$tmp"' 0 1 2 3 15
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1122 # func_dest_tmpfilename file
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1123 # determines the name of a temporary file (file is relative to destdir).
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1124 # Sets variable:
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1125 # - tmpfile absolute filename of the temporary file
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1126 func_dest_tmpfilename ()
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1127 {
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1128 if $doit; then
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1129 # Put the new contents of $file in a file in the same directory (needed
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1130 # to guarantee that an 'mv' to "$destdir/$file" works).
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1131 tmpfile="$destdir/$1.tmp"
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1132 else
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1133 # Put the new contents of $file in a file in a temporary directory
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1134 # (because the directory of "$file" might not exist).
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1135 tmpfile="$tmp"/`basename "$1"`.tmp
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1136 fi
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1137 }
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1138
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1139 # Copy files or make symbolic links. Remove obsolete files.
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1140 delimiter=' '
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1141 for f in $old_files; do
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1142 case "$f" in
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1143 build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
1144 doc/*) g=`echo "$f" | sed -e "s,^doc/,$cached_docbase/,"` ;;
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1145 lib/*) g=`echo "$f" | sed -e "s,^lib/,$cached_sourcebase/,"` ;;
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1146 m4/*) g=`echo "$f" | sed -e "s,^m4/,$cached_m4base/,"` ;;
6425
d33210bfaeae * gnulib-tool: Fix --tests-base.
Simon Josefsson <simon@josefsson.org>
parents: 6418
diff changeset
1147 tests/*) g=`echo "$f" | sed -e "s,^tests/,$cached_testsbase/,"` ;;
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1148 *) g="$f" ;;
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1149 esac
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1150 echo "$g""$delimiter""$f"
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1151 done | LC_ALL=C sort > "$tmp"/old-files
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1152 for f in $new_files; do
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1153 case "$f" in
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1154 build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
1155 doc/*) g=`echo "$f" | sed -e "s,^doc/,$docbase/,"` ;;
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1156 lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;;
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1157 m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
6425
d33210bfaeae * gnulib-tool: Fix --tests-base.
Simon Josefsson <simon@josefsson.org>
parents: 6418
diff changeset
1158 tests/*) g=`echo "$f" | sed -e "s,^tests/,$testsbase/,"` ;;
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1159 *) g="$f" ;;
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1160 esac
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1161 echo "$g""$delimiter""$f"
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1162 done | LC_ALL=C sort > "$tmp"/new-files
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1163 # First the files that are in old-files, but not in new-files:
6595
0c67f1400c5b Fix portability problem to Solaris 9 sh.
Bruno Haible <bruno@clisp.org>
parents: 6581
diff changeset
1164 sed_take_first_column='s,'"$delimiter"'.*,,'
0c67f1400c5b Fix portability problem to Solaris 9 sh.
Bruno Haible <bruno@clisp.org>
parents: 6581
diff changeset
1165 for g in `LC_ALL=C join -t"$delimiter" -v1 "$tmp"/old-files "$tmp"/new-files | sed -e "$sed_take_first_column"`; do
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1166 # Remove the file. Do nothing if the user already removed it.
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1167 if test -f "$destdir/$g"; then
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1168 if $doit; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1169 echo "Removing file $g (backup in ${g}~)"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1170 mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1171 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1172 echo "Remove file $g (backup in ${g}~)"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1173 fi
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1174 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1175 done
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1176 # func_add_or_update handles a file that ought to be present afterwards.
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1177 # Uses parameters f, g, already_present.
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1178 func_add_or_update ()
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1179 {
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1180 func_dest_tmpfilename "$g"
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1181 cp "$gnulib_dir/$f" "$tmpfile" || func_fatal_error "failed"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1182 if test -n "$lgpl"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1183 # Update license.
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1184 case "$f" in
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1185 lib/*)
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1186 sed -e 's/GNU General/GNU Lesser General/g' \
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1187 -e 's/version 2\([ ,]\)/version 2.1\1/g' \
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1188 < "$gnulib_dir/$f" > "$tmpfile" || func_fatal_error "failed"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1189 ;;
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1190 esac
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1191 fi
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1192 if test -f "$destdir/$g"; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1193 # The file already exists.
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1194 if cmp "$destdir/$g" "$tmpfile" > /dev/null; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1195 : # The file has not changed.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1196 else
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1197 # Replace the file.
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1198 if $doit; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1199 if test -n "$already_present"; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1200 echo "Updating file $g (backup in ${g}~)"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1201 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1202 echo "Replacing file $g (non-gnulib code backuped in ${g}~) !!"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1203 fi
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1204 mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1205 if test -n "$symbolic" && cmp "$gnulib_dir/$f" "$tmpfile" > /dev/null; then
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1206 func_ln_if_changed "$gnulib_dir/$f" "$destdir/$g"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1207 else
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1208 mv -f "$tmpfile" "$destdir/${g}" || func_fatal_error "failed"
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1209 fi
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1210 else
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1211 if test -n "$already_present"; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1212 echo "Update file $g (backup in ${g}~)"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1213 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1214 echo "Replace file $g (non-gnulib code backuped in ${g}~) !!"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1215 fi
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1216 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1217 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1218 else
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1219 # Install the file.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1220 # Don't protest if the file should be there but isn't: it happens
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1221 # frequently that developers don't put autogenerated files into CVS.
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1222 if $doit; then
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1223 echo "Copying file $g"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1224 if test -n "$symbolic" && cmp "$gnulib_dir/$f" "$tmpfile" > /dev/null; then
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1225 func_ln_if_changed "$gnulib_dir/$f" "$destdir/$g"
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1226 else
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1227 mv -f "$tmpfile" "$destdir/${g}" || func_fatal_error "failed"
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1228 fi
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1229 else
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1230 echo "Copy file $g"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1231 fi
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1232 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1233 rm -f "$tmpfile"
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1234 }
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1235 # Then the files that are in new-files, but not in old-files:
6595
0c67f1400c5b Fix portability problem to Solaris 9 sh.
Bruno Haible <bruno@clisp.org>
parents: 6581
diff changeset
1236 sed_take_last_column='s,^.*'"$delimiter"',,'
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1237 already_present=
6595
0c67f1400c5b Fix portability problem to Solaris 9 sh.
Bruno Haible <bruno@clisp.org>
parents: 6581
diff changeset
1238 for f in `LC_ALL=C join -t"$delimiter" -v2 "$tmp"/old-files "$tmp"/new-files | sed -e "$sed_take_last_column"`; do
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1239 case "$f" in
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1240 build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
1241 doc/*) g=`echo "$f" | sed -e "s,^doc/,$docbase/,"` ;;
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1242 lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;;
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1243 m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
6425
d33210bfaeae * gnulib-tool: Fix --tests-base.
Simon Josefsson <simon@josefsson.org>
parents: 6418
diff changeset
1244 tests/*) g=`echo "$f" | sed -e "s,^tests/,$testsbase/,"` ;;
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1245 *) g="$f" ;;
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1246 esac
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1247 func_add_or_update
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1248 done
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1249 # Then the files that are in new-files and in old-files:
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1250 already_present=true
6595
0c67f1400c5b Fix portability problem to Solaris 9 sh.
Bruno Haible <bruno@clisp.org>
parents: 6581
diff changeset
1251 for f in `LC_ALL=C join -t"$delimiter" "$tmp"/old-files "$tmp"/new-files | sed -e "$sed_take_last_column"`; do
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1252 case "$f" in
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1253 build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
1254 doc/*) g=`echo "$f" | sed -e "s,^doc/,$docbase/,"` ;;
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1255 lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;;
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1256 m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;;
6425
d33210bfaeae * gnulib-tool: Fix --tests-base.
Simon Josefsson <simon@josefsson.org>
parents: 6418
diff changeset
1257 tests/*) g=`echo "$f" | sed -e "s,^tests/,$testsbase/,"` ;;
6245
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1258 *) g="$f" ;;
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1259 esac
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1260 func_add_or_update
07b16a28510d Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents: 6213
diff changeset
1261 done
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1262
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1263 # Command-line invocation printed in a comment in generated gnulib-cache.m4.
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1264 actioncmd="gnulib-tool --import"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1265 actioncmd="$actioncmd --dir=$destdir"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1266 actioncmd="$actioncmd --lib=$libname"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1267 actioncmd="$actioncmd --source-base=$sourcebase"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1268 actioncmd="$actioncmd --m4-base=$m4base"
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
1269 actioncmd="$actioncmd --doc-base=$docbase"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1270 actioncmd="$actioncmd --aux-dir=$auxdir"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1271 for module in $avoidlist; do
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1272 actioncmd="$actioncmd --avoid=$module"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1273 done
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1274 if test -n "$lgpl"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1275 actioncmd="$actioncmd --lgpl"
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1276 fi
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1277 if test -n "$libtool"; then
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1278 actioncmd="$actioncmd --libtool"
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1279 fi
6208
c72d8c259348 2005-09-03 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 6204
diff changeset
1280 actioncmd="$actioncmd --macro-prefix=$macro_prefix"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1281 actioncmd="$actioncmd `echo $specified_modules`"
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1282
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1283 # Create lib/Makefile.am.
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1284 func_dest_tmpfilename $sourcebase/Makefile.am
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1285 func_emit_lib_Makefile_am > "$tmpfile"
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1286 if test -f "$destdir"/$sourcebase/Makefile.am; then
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1287 if cmp "$destdir"/$sourcebase/Makefile.am "$tmpfile" > /dev/null; then
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1288 rm -f "$tmpfile"
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1289 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1290 if $doit; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1291 echo "Updating $sourcebase/Makefile.am (backup in $sourcebase/Makefile.am~)"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1292 mv -f "$destdir"/$sourcebase/Makefile.am "$destdir"/$sourcebase/Makefile.am~
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1293 mv -f "$tmpfile" "$destdir"/$sourcebase/Makefile.am
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1294 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1295 echo "Update $sourcebase/Makefile.am (backup in $sourcebase/Makefile.am~)"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1296 rm -f "$tmpfile"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1297 fi
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1298 fi
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1299 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1300 if $doit; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1301 echo "Creating $sourcebase/Makefile.am"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1302 mv -f "$tmpfile" "$destdir"/$sourcebase/Makefile.am
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1303 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1304 echo "Create $sourcebase/Makefile.am"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1305 rm -f "$tmpfile"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1306 fi
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
1307 fi
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1308
6180
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1309 # Create m4/gnulib-cache.m4.
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1310 func_dest_tmpfilename $m4base/gnulib-cache.m4
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1311 (
6777
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
1312 func_emit_copyright_notice
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1313 echo "#"
6180
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1314 echo "# This file represents the specification of how gnulib-tool is used."
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1315 echo "# It acts as a cache: It is written and read by gnulib-tool."
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1316 echo "# In projects using CVS, this file is meant to be stored in CVS,"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1317 echo "# like the configure.ac and various Makefile.am files."
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1318 echo
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1319 echo
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1320 echo "# Specification in the form of a command-line invocation:"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1321 echo "# $actioncmd"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1322 echo
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1323 echo "# Specification in the form of a few gnulib-tool.m4 macro invocations:"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1324 echo "gl_MODULES(["`echo $specified_modules`"])"
6180
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1325 echo "gl_AVOID([$avoidlist])"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1326 echo "gl_SOURCE_BASE([$sourcebase])"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1327 echo "gl_M4_BASE([$m4base])"
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1328 echo "gl_DOC_BASE([$docbase])"
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1329 echo "gl_TESTS_BASE([$testsbase])"
6180
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1330 echo "gl_LIB([$libname])"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1331 test -z "$lgpl" || echo "gl_LGPL"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1332 test -z "$libtool" || echo "gl_LIBTOOL"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1333 echo "gl_MACRO_PREFIX([$macro_prefix])"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1334 ) > "$tmpfile"
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1335 if test -f "$destdir"/$m4base/gnulib-cache.m4; then
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1336 if cmp "$destdir"/$m4base/gnulib-cache.m4 "$tmpfile" > /dev/null; then
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1337 rm -f "$tmpfile"
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1338 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1339 if $doit; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1340 echo "Updating $m4base/gnulib-cache.m4 (backup in $m4base/gnulib-cache.m4~)"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1341 mv -f "$destdir"/$m4base/gnulib-cache.m4 "$destdir"/$m4base/gnulib-cache.m4~
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1342 mv -f "$tmpfile" "$destdir"/$m4base/gnulib-cache.m4
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1343 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1344 echo "Update $m4base/gnulib-cache.m4 (backup in $m4base/gnulib-cache.m4~)"
6249
564133adbd69 Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents: 6248
diff changeset
1345 if false; then
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1346 cat "$tmpfile"
6249
564133adbd69 Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents: 6248
diff changeset
1347 echo
564133adbd69 Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents: 6248
diff changeset
1348 echo "# gnulib-cache.m4 ends here"
564133adbd69 Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents: 6248
diff changeset
1349 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1350 rm -f "$tmpfile"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1351 fi
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1352 fi
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1353 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1354 if $doit; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1355 echo "Creating $m4base/gnulib-cache.m4"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1356 mv -f "$tmpfile" "$destdir"/$m4base/gnulib-cache.m4
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1357 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1358 echo "Create $m4base/gnulib-cache.m4"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1359 cat "$tmpfile"
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1360 rm -f "$tmpfile"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1361 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1362 fi
6180
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1363
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1364 # Create m4/gnulib-comp.m4.
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1365 func_dest_tmpfilename $m4base/gnulib-comp.m4
6180
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1366 (
6777
d9b10884dc69 * gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents: 6765
diff changeset
1367 func_emit_copyright_notice
6180
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1368 echo "#"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1369 echo "# This file represents the compiled summary of the specification in"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1370 echo "# gnulib-cache.m4. It lists the computed macro invocations that need"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1371 echo "# to be invoked from configure.ac."
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1372 echo "# In projects using CVS, this file can be treated like other built files."
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1373 echo
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1374 echo
6160
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1375 echo "# This macro should be invoked from $configure_ac, in the section"
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1376 echo "# \"Checks for programs\", right after AC_PROG_CC, and certainly before"
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1377 echo "# any checks for libraries, header files, types and library functions."
6176
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
1378 echo "AC_DEFUN([${macro_prefix}_EARLY],"
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1379 echo "["
6512
f8abe8d41137 RANLIB is needed.
Bruno Haible <bruno@clisp.org>
parents: 6464
diff changeset
1380 echo " AC_REQUIRE([AC_PROG_RANLIB])"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1381 if grep AC_GNU_SOURCE "$destdir"/$m4base/*.m4 >/dev/null 2>/dev/null; then
6179
76e367ba26d3 Avoid multiple copies of AC_GNU_SOURCE in the configure file.
Bruno Haible <bruno@clisp.org>
parents: 6178
diff changeset
1382 echo " AC_REQUIRE([AC_GNU_SOURCE])"
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1383 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1384 if grep gl_USE_SYSTEM_EXTENSIONS "$destdir"/$m4base/*.m4 >/dev/null 2>/dev/null; then
6179
76e367ba26d3 Avoid multiple copies of AC_GNU_SOURCE in the configure file.
Bruno Haible <bruno@clisp.org>
parents: 6178
diff changeset
1385 echo " AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])"
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1386 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1387 if grep gl_LOCK "$destdir"/$m4base/*.m4 >/dev/null 2>/dev/null; then
6549
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
1388 echo " AC_REQUIRE([gl_LOCK])"
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
1389 fi
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1390 echo "])"
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1391 echo
6160
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1392 echo "# This macro should be invoked from $configure_ac, in the section"
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1393 echo "# \"Check for header files, types and library functions\"."
6176
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
1394 echo "AC_DEFUN([${macro_prefix}_INIT],"
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1395 echo "["
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1396 if test -z "$libtool"; then
6512
f8abe8d41137 RANLIB is needed.
Bruno Haible <bruno@clisp.org>
parents: 6464
diff changeset
1397 echo " AM_CONDITIONAL([GL_COND_LIBTOOL], [false])"
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1398 else
6512
f8abe8d41137 RANLIB is needed.
Bruno Haible <bruno@clisp.org>
parents: 6464
diff changeset
1399 echo " AM_CONDITIONAL([GL_COND_LIBTOOL], [true])"
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1400 fi
6556
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1401 if test "$auxdir" != "build-aux"; then
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1402 sed_replace_build_aux='
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1403 :a
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1404 /AC_CONFIG_FILES(.*:build-aux\/.*)/{
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1405 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)|
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1406 ba
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1407 }'
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1408 sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'`
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1409 else
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1410 sed_replace_build_aux=
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1411 fi
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1412 for module in $modules; do
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1413 func_verify_module
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1414 if test -n "$module"; then
6546
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1415 func_get_autoconf_snippet "$module" \
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1416 | sed -e '/^$/d;' -e 's/^/ /' \
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1417 -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' \
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1418 -e "$sed_replace_build_aux"
5357
8bce169f70cc Fix comments. Fix parse problem.
Simon Josefsson <simon@josefsson.org>
parents: 5356
diff changeset
1419 if test "$module" = 'alloca' && test -n "$libtool"; then
5356
144b29bba7b7 Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents: 5353
diff changeset
1420 echo 'changequote(,)dnl'
144b29bba7b7 Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents: 5353
diff changeset
1421 echo 'LTALLOCA=`echo "$ALLOCA" | sed '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`'
144b29bba7b7 Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents: 5353
diff changeset
1422 echo 'changequote([, ])dnl'
6106
66bd85c8a9cd Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents: 6039
diff changeset
1423 echo 'AC_SUBST([LTALLOCA])'
5356
144b29bba7b7 Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents: 5353
diff changeset
1424 fi
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1425 fi
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1426 done
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1427 echo "])"
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1428 echo
6180
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1429 echo "# This macro records the list of files which have been installed by"
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1430 echo "# gnulib-tool and may be removed by future gnulib-tool invocations."
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1431 echo "AC_DEFUN([${macro_prefix}_FILE_LIST], ["
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1432 echo "$files" | sed -e 's,^, ,'
a0904de304e5 Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents: 6179
diff changeset
1433 echo "])"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1434 ) > "$tmpfile"
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1435 if test -f "$destdir"/$m4base/gnulib-comp.m4; then
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1436 if cmp "$destdir"/$m4base/gnulib-comp.m4 "$tmpfile" > /dev/null; then
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1437 rm -f "$tmpfile"
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1438 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1439 if $doit; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1440 echo "Updating $m4base/gnulib-comp.m4 (backup in $m4base/gnulib-comp.m4~)"
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1441 mv -f "$destdir"/$m4base/gnulib-comp.m4 "$destdir"/$m4base/gnulib-comp.m4~
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1442 mv -f "$tmpfile" "$destdir"/$m4base/gnulib-comp.m4
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1443 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1444 echo "Update $m4base/gnulib-comp.m4 (backup in $m4base/gnulib-comp.m4~)"
6249
564133adbd69 Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents: 6248
diff changeset
1445 if false; then
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1446 cat "$tmpfile"
6249
564133adbd69 Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents: 6248
diff changeset
1447 echo
564133adbd69 Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents: 6248
diff changeset
1448 echo "# gnulib-comp.m4 ends here"
564133adbd69 Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents: 6248
diff changeset
1449 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1450 rm -f "$tmpfile"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1451 fi
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1452 fi
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1453 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1454 if $doit; then
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1455 echo "Creating $m4base/gnulib-comp.m4"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1456 mv -f "$tmpfile" "$destdir"/$m4base/gnulib-comp.m4
6246
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1457 else
7c089b3b2200 Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents: 6245
diff changeset
1458 echo "Create $m4base/gnulib-comp.m4"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1459 cat "$tmpfile"
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1460 rm -f "$tmpfile"
6181
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1461 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1462 fi
95b89dc3f638 Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents: 6180
diff changeset
1463
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1464 if test -n "$inctests"; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1465 # Create tests/Makefile.am.
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1466 func_dest_tmpfilename $testsbase/Makefile.am
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1467 func_emit_tests_Makefile_am > "$tmpfile"
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1468 if test -f "$destdir"/$testsbase/Makefile.am; then
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1469 if cmp "$destdir"/$testsbase/Makefile.am "$tmpfile" > /dev/null; then
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1470 rm -f "$tmpfile"
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1471 else
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1472 if $doit; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1473 echo "Updating $testsbase/Makefile.am (backup in $testsbase/Makefile.am~)"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1474 mv -f "$destdir"/$testsbase/Makefile.am "$destdir"/$testsbase/Makefile.am~
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1475 mv -f "$tmpfile" "$destdir"/$testsbase/Makefile.am
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1476 else
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1477 echo "Update $testsbase/Makefile.am (backup in $testsbase/Makefile.am~)"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1478 rm -f "$tmpfile"
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1479 fi
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1480 fi
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1481 else
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1482 if $doit; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1483 echo "Creating $testsbase/Makefile.am"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1484 mv -f "$tmpfile" "$destdir"/$testsbase/Makefile.am
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1485 else
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1486 echo "Create $testsbase/Makefile.am"
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1487 rm -f "$tmpfile"
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1488 fi
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1489 fi
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1490 fi
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1491
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1492 rm -rf "$tmp"
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1493 # Undo the effect of the previous 'trap' command. Some shellology:
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1494 # We cannot use "trap - 0 1 2 3 15", because Solaris sh would attempt to
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1495 # execute the command "-". "trap '' ..." is fine only for signal 0 (= normal
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1496 # exit); for the others we need to call 'exit' explicitly. The value of $? is
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1497 # 128 + signal number and is set before the trap-registered command is run.
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1498 trap '' 0
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1499 trap 'exit $?' 1 2 3 15
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1500
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1501 echo "Finished."
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1502 echo
5572
54000928a33d Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents: 5527
diff changeset
1503 echo "You may need to add #include directives for the following .h files."
6756
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1504 (
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1505 # First the #include <...> directives without #ifs, sorted for convenience.
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1506 for module in $modules; do
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1507 if func_get_include_directive "$module" | grep '^#if' >/dev/null; then
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1508 :
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1509 else
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1510 func_get_include_directive "$module" | grep -v 'include "'
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1511 fi
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1512 done | LC_ALL=C sort -u
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1513 # Then the #include "..." directives without #ifs, sorted for convenience.
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1514 for module in $modules; do
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1515 if func_get_include_directive "$module" | grep '^#if' >/dev/null; then
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1516 :
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1517 else
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1518 func_get_include_directive "$module" | grep 'include "'
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1519 fi
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1520 done | LC_ALL=C sort -u
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1521 # Then the #include directives that are surrounded by #ifs. Not sorted.
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1522 for module in $modules; do
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1523 if func_get_include_directive "$module" | grep '^#if' >/dev/null; then
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1524 func_get_include_directive "$module"
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1525 fi
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1526 done
4d481eff340f Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents: 6750
diff changeset
1527 ) | sed -e '/^$/d;' -e 's/^/ /'
5572
54000928a33d Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents: 5527
diff changeset
1528 echo
6160
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1529 echo "Don't forget to"
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1530 echo " - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in $configure_ac,"
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1531 if test -n "$inctests"; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1532 echo " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES in $configure_ac,"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1533 fi
6160
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1534 sourcebase_dir=`echo "$sourcebase" | sed -n -e 's,/[^/]*$,/,p'`
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1535 sourcebase_base=`basename "$sourcebase"`
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1536 echo " - mention \"${sourcebase_base}\" in SUBDIRS in ${sourcebase_dir}Makefile.am,"
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1537 if test -n "$inctests"; then
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1538 testsbase_dir=`echo "$testsbase" | sed -n -e 's,/[^/]*$,/,p'`
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1539 testsbase_base=`basename "$testsbase"`
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1540 echo " - mention \"${testsbase_base}\" in SUBDIRS in ${testsbase_dir}Makefile.am,"
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1541 fi
6160
2fb771c0af6b Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents: 6159
diff changeset
1542 echo " - mention \"-I ${m4base}\" in ACLOCAL_AMFLAGS in Makefile.am,"
6176
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
1543 echo " - invoke ${macro_prefix}_EARLY in $configure_ac, right after AC_PROG_CC,"
1a1e2f878f04 New option --macro-prefix.
Bruno Haible <bruno@clisp.org>
parents: 6175
diff changeset
1544 echo " - invoke ${macro_prefix}_INIT in $configure_ac."
5345
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1545 }
8394c9bf619f Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents: 5344
diff changeset
1546
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1547 # func_create_testdir testdir modules
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1548 # Input:
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1549 # - auxdir directory relative to destdir where to place build aux files
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1550 func_create_testdir ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1551 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1552 testdir="$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1553 modules="$2"
6263
9750529a8cf5 Sort in a locale-independent way.
Bruno Haible <bruno@clisp.org>
parents: 6262
diff changeset
1554 modules=`for m in $modules; do echo $m; done | LC_ALL=C sort | LC_ALL=C uniq`
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1555
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1556 # Determine final module list.
5347
0318c37925dc Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents: 5346
diff changeset
1557 func_modules_transitive_closure
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1558 echo "Module list with included dependencies:"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1559 echo "$modules" | sed -e 's/^/ /'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1560
6550
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
1561 # Add the dummy module if needed.
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
1562 func_modules_add_dummy
3bb57675fc1b Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents: 6549
diff changeset
1563
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1564 # Determine final file list.
5348
6afb021e2fc1 Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents: 5347
diff changeset
1565 func_modules_to_filelist
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1566 echo "File list:"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1567 echo "$files" | sed -e 's/^/ /'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1568
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1569 # Create directories.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1570 for d in `echo "$files" | sed -n -e 's,^\(.*\)/[^/]*,\1,p'`; do
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1571 if test "$d" = build-aux; then
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1572 mkdir -p "$testdir/$auxdir"
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1573 else
4175
ace040a2b821 Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents: 4171
diff changeset
1574 mkdir -p "$testdir/$d"
ace040a2b821 Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents: 4171
diff changeset
1575 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1576 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1577
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1578 # Copy files or make symbolic links.
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1579 for f in $files; do
4175
ace040a2b821 Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents: 4171
diff changeset
1580 case "$f" in
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1581 build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;;
4175
ace040a2b821 Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents: 4171
diff changeset
1582 *) g="$f" ;;
ace040a2b821 Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents: 4171
diff changeset
1583 esac
ace040a2b821 Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents: 4171
diff changeset
1584 ln "$gnulib_dir/$f" "$testdir/$g" 2>/dev/null ||
5799
ad9eff556694 2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents: 5798
diff changeset
1585 if test -z "$symbolic"; then
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1586 cp -p "$gnulib_dir/$f" "$testdir/$g"
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1587 else
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1588 ln -s "$gnulib_dir/$f" "$testdir/$g"
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1589 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1590 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1591
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1592 # Create lib/Makefile.am.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1593 mkdir -p "$testdir/lib"
5351
7c565c8ecabc Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents: 5350
diff changeset
1594 func_emit_lib_Makefile_am > "$testdir/lib/Makefile.am"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1595
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1596 # Create m4/Makefile.am.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1597 mkdir -p "$testdir/m4"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1598 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1599 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1600 echo "EXTRA_DIST ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1601 for f in $files; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1602 case "$f" in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1603 m4/* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1604 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1605 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1606 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1607 ) > "$testdir/m4/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1608
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1609 subdirs="lib m4"
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1610 subdirs_with_configure_ac=""
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1611
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1612 if test -f "$testdir"/m4/gettext.m4; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1613 # Avoid stupid error message from automake:
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1614 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1615 mkdir -p "$testdir/po"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1616 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1617 ) > "$testdir/po/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1618 subdirs="$subdirs po"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1619 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1620
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1621 if test -n "$inctests"; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1622 test -d "$testdir/tests" || mkdir "$testdir/tests"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1623 # Create tests/Makefile.am.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1624 sourcebase=lib
6250
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1625 m4base=m4
2c772fe1e1d0 Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents: 6249
diff changeset
1626 testsbase=tests
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1627 func_emit_tests_Makefile_am > "$testdir/tests/Makefile.am"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1628 # Create tests/configure.ac.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1629 (echo "# Process this file with autoconf to produce a configure script."
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1630 echo "AC_INIT([dummy], [0])"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1631 echo "AC_CONFIG_AUX_DIR([../$auxdir])"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1632 echo "AM_INIT_AUTOMAKE"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1633 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1634 echo "AM_CONFIG_HEADER([config.h])"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1635 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1636 echo "AC_PROG_CC"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1637 echo "AC_PROG_INSTALL"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1638 echo "AC_PROG_MAKE_SET"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1639 echo "AC_PROG_RANLIB"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1640 echo
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1641 if grep AC_GNU_SOURCE "$testdir"/m4/*.m4 >/dev/null 2>/dev/null; then
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1642 echo "AC_GNU_SOURCE"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1643 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1644 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1645 if grep gl_USE_SYSTEM_EXTENSIONS "$testdir"/m4/*.m4 >/dev/null 2>/dev/null; then
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1646 echo "gl_USE_SYSTEM_EXTENSIONS"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1647 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1648 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1649 if grep gl_LOCK "$testdir"/m4/*.m4 >/dev/null 2>/dev/null; then
6549
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
1650 echo "gl_LOCK"
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
1651 echo
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
1652 fi
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1653 if test -z "$libtool"; then
6418
e0a8b9b05999 Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents: 6414
diff changeset
1654 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])"
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1655 else
6418
e0a8b9b05999 Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents: 6414
diff changeset
1656 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])"
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1657 fi
6556
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1658 if test "$auxdir" != "build-aux"; then
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1659 sed_replace_build_aux='
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1660 :a
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1661 /AC_CONFIG_FILES(.*:build-aux\/.*)/{
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1662 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:../'"$auxdir"'/\2)|
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1663 ba
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1664 }'
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1665 sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'`
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1666 else
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1667 sed_replace_build_aux=
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1668 fi
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1669 # We don't have explicit ordering constraints between the various
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1670 # autoconf snippets. It's cleanest to put those of the library before
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1671 # those of the tests.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1672 for module in $modules; do
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1673 func_verify_nontests_module
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1674 if test -n "$module"; then
6546
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1675 func_get_autoconf_snippet "$module" \
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1676 | sed -e "$sed_replace_build_aux"
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1677 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1678 done
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1679 for module in $modules; do
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1680 func_verify_tests_module
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1681 if test -n "$module"; then
6546
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1682 func_get_autoconf_snippet "$module" \
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1683 | sed -e "$sed_replace_build_aux"
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1684 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1685 done
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1686 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1687 # Usually tests/config.h will be a superset of config.h. Verify this by
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1688 # "merging" config.h into tests/config.h; look out for gcc warnings.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1689 echo "AH_TOP([#include \"../config.h\"])"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1690 echo
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1691 echo "AC_OUTPUT([Makefile])"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1692 ) > "$testdir/tests/configure.ac"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1693 subdirs="$subdirs tests"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1694 subdirs_with_configure_ac="$subdirs_with_configure_ac tests"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1695 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1696
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1697 # Create Makefile.am.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1698 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1699 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1700 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1701 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1702 echo "SUBDIRS = $subdirs"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1703 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1704 echo "ACLOCAL_AMFLAGS = -I m4"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1705 ) > "$testdir/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1706
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1707 # Create configure.ac.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1708 (echo "# Process this file with autoconf to produce a configure script."
6106
66bd85c8a9cd Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents: 6039
diff changeset
1709 echo "AC_INIT([dummy], [0])"
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1710 if test "$auxdir" != "."; then
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1711 echo "AC_CONFIG_AUX_DIR([$auxdir])"
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1712 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1713 echo "AM_INIT_AUTOMAKE"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1714 echo
6106
66bd85c8a9cd Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents: 6039
diff changeset
1715 echo "AM_CONFIG_HEADER([config.h])"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1716 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1717 echo "AC_PROG_CC"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1718 echo "AC_PROG_INSTALL"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1719 echo "AC_PROG_MAKE_SET"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1720 echo "AC_PROG_RANLIB"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1721 echo
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1722 if grep AC_GNU_SOURCE "$testdir"/m4/*.m4 >/dev/null 2>/dev/null; then
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1723 echo "AC_GNU_SOURCE"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1724 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1725 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1726 if grep gl_USE_SYSTEM_EXTENSIONS "$testdir"/m4/*.m4 >/dev/null 2>/dev/null; then
4586
eb1b4acf2e86 Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents: 4325
diff changeset
1727 echo "gl_USE_SYSTEM_EXTENSIONS"
eb1b4acf2e86 Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents: 4325
diff changeset
1728 echo
eb1b4acf2e86 Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents: 4325
diff changeset
1729 fi
6745
aca74c06bca0 Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents: 6633
diff changeset
1730 if grep gl_LOCK "$testdir"/m4/*.m4 >/dev/null 2>/dev/null; then
6549
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
1731 echo "gl_LOCK"
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
1732 echo
2f04f595e14e Ensure automatic ordering between gl_LOCK and gl_ARGP.
Bruno Haible <bruno@clisp.org>
parents: 6548
diff changeset
1733 fi
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1734 if test -z "$libtool"; then
6418
e0a8b9b05999 Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents: 6414
diff changeset
1735 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])"
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1736 else
6418
e0a8b9b05999 Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents: 6414
diff changeset
1737 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])"
6414
46d47c8fe734 * gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents: 6389
diff changeset
1738 fi
6556
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1739 if test "$auxdir" != "build-aux"; then
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1740 sed_replace_build_aux='
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1741 :a
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1742 /AC_CONFIG_FILES(.*:build-aux\/.*)/{
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1743 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)|
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1744 ba
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1745 }'
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1746 sed_replace_build_aux=`echo "$sed_replace_build_aux" | sed -e 1d -e 's/^ *//'`
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1747 else
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1748 sed_replace_build_aux=
85c3c00fcec1 Fix sed_replace_auxdir.
Bruno Haible <bruno@clisp.org>
parents: 6551
diff changeset
1749 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1750 for module in $modules; do
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1751 func_verify_nontests_module
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1752 if test -n "$module"; then
6546
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1753 func_get_autoconf_snippet "$module" \
b32846b4d88d Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents: 6533
diff changeset
1754 | sed -e "$sed_replace_build_aux"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1755 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1756 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1757 echo
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1758 if test -n "$subdirs_with_configure_ac"; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1759 echo "AC_CONFIG_SUBDIRS(["`echo $subdirs_with_configure_ac`"])"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1760 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1761 makefiles="Makefile"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1762 for d in $subdirs; do
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1763 # For subdirs that have a configure.ac by their own, it's the subdir's
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1764 # configure.ac which creates the subdir's Makefile.am, not this one.
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1765 case " $subdirs_with_configure_ac " in
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1766 *" $d "*) ;;
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1767 *) makefiles="$makefiles $d/Makefile" ;;
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
1768 esac
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1769 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1770 echo "AC_OUTPUT([$makefiles])"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1771 ) > "$testdir/configure.ac"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1772
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1773 # Create autogenerated files.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1774 (cd "$testdir"
5237
bd85db908172 Replace various ad-hoc automake/autoconf/aclocal
Paul Eggert <eggert@cs.ucla.edu>
parents: 5202
diff changeset
1775 echo "executing ${AUTORECONF} --force --install"
bd85db908172 Replace various ad-hoc automake/autoconf/aclocal
Paul Eggert <eggert@cs.ucla.edu>
parents: 5202
diff changeset
1776 ${AUTORECONF} --force --install
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1777 )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1778 if grep '^BUILT_SOURCES *+=' "$testdir/lib/Makefile.am" > /dev/null; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1779 (cd "$testdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1780 ./configure
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1781 cd lib
6389
c1766dccfd4f Simplification, from Stepan Kasal.
Bruno Haible <bruno@clisp.org>
parents: 6380
diff changeset
1782 echo 'built_sources: $(BUILT_SOURCES)' >> Makefile
c1766dccfd4f Simplification, from Stepan Kasal.
Bruno Haible <bruno@clisp.org>
parents: 6380
diff changeset
1783 make built_sources
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1784 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1785 make distclean
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1786 )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1787 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1788 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1789
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1790 # func_create_megatestdir megatestdir allmodules
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1791 # Input:
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1792 # - auxdir directory relative to destdir where to place build aux files
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1793 func_create_megatestdir ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1794 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1795 megatestdir="$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1796 allmodules="$2"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1797 if test -z "$allmodules"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1798 allmodules=`func_all_modules`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1799 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1800
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1801 megasubdirs=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1802 # First, all modules one by one.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1803 for onemodule in $allmodules; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1804 func_create_testdir "$megatestdir/$onemodule" $onemodule
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1805 megasubdirs="${megasubdirs}$onemodule "
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1806 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1807 # Then, all modules all together.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1808 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1809 allmodules=`for m in $allmodules; do if test $m != fnmatch-posix; then echo $m; fi; done`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1810 func_create_testdir "$megatestdir/ALL" "$allmodules"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1811 megasubdirs="${megasubdirs}ALL"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1812
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1813 # Create Makefile.am.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1814 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1815 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1816 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1817 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1818 echo "SUBDIRS = $megasubdirs"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1819 ) > "$megatestdir/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1820
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1821 # Create configure.ac.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1822 (echo "# Process this file with autoconf to produce a configure script."
6106
66bd85c8a9cd Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents: 6039
diff changeset
1823 echo "AC_INIT([dummy], [0])"
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1824 if test "$auxdir" != "."; then
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1825 echo "AC_CONFIG_AUX_DIR([$auxdir])"
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1826 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1827 echo "AM_INIT_AUTOMAKE"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1828 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1829 echo "AC_PROG_MAKE_SET"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1830 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1831 echo "AC_CONFIG_SUBDIRS([$megasubdirs])"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1832 echo "AC_OUTPUT([Makefile])"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1833 ) > "$megatestdir/configure.ac"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1834
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1835 # Create autogenerated files.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1836 (cd "$megatestdir"
6547
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1837 # Do not use "${AUTORECONF} --install", because autoreconf operates
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1838 # recursively, but the subdirectories are already finished, therefore
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1839 # calling autoreconf here would only waste lots of CPU time.
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1840 echo "executing ${ACLOCAL}"
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1841 ${ACLOCAL}
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1842 echo "executing mkdir build-aux"
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1843 mkdir build-aux
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1844 echo "executing ${AUTOCONF}"
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1845 ${AUTOCONF}
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1846 echo "executing ${AUTOMAKE} --add-missing --copy"
1a65fb7ddbbb Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents: 6546
diff changeset
1847 ${AUTOMAKE} --add-missing --copy
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1848 )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1849 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1850
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1851 case $mode in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1852 "" )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1853 func_fatal_error "no mode specified" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1854
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1855 list )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1856 func_all_modules
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1857 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1858
6443
1a35941d29ab Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents: 6425
diff changeset
1859 import | update )
6940
ca8592ba8eba * gnulib-tool (func_get_filelist): Don't echo m4/onceonly_2_57.m4,
Paul Eggert <eggert@cs.ucla.edu>
parents: 6862
diff changeset
1860
5343
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
1861 # Where to import.
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
1862 if test -z "$destdir"; then
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
1863 destdir=.
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
1864 fi
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
1865 test -d "$destdir" \
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
1866 || func_fatal_error "destination directory does not exist: $destdir"
5202
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
1867
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1868 # Prefer configure.ac to configure.in.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1869 if test -f "$destdir"/configure.ac; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1870 configure_ac="$destdir/configure.ac"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1871 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1872 if test -f "$destdir"/configure.in; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1873 configure_ac="$destdir/configure.in"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1874 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1875 func_fatal_error "cannot find $destdir/configure.ac"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1876 fi
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1877 fi
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1878
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1879 test -f "$destdir"/Makefile.am \
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1880 || func_fatal_error "cannot find $destdir/Makefile.am"
5202
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
1881
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1882 # Analyze configure.ac.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1883 guessed_auxdir="."
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1884 guessed_libtool=
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1885 my_sed_traces='
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1886 s,#.*$,,
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1887 s,^dnl .*$,,
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1888 s, dnl .*$,,
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1889 /AC_CONFIG_AUX_DIR/ {
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1890 s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,guessed_auxdir="\1",p
5798
49900d80eaaf 2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents: 5685
diff changeset
1891 }
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1892 /A[CM]_PROG_LIBTOOL/ {
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1893 s,^.*$,guessed_libtool=true,p
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1894 }'
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1895 eval `sed -n -e "$my_sed_traces" < "$configure_ac"`
5202
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
1896
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1897 if test -z "$auxdir"; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1898 auxdir="$guessed_auxdir"
5343
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
1899 fi
5202
64446bf39961 Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents: 5198
diff changeset
1900
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1901 # Determine where to apply func_import.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1902 if test -n "$m4base"; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1903 # Apply func_import to a particular gnulib directory.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1904 # Any number of additional modules can be given.
6204
104bcb14d247 Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents: 6199
diff changeset
1905 if test ! -f "$destdir/$m4base"/gnulib-cache.m4; then
104bcb14d247 Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents: 6199
diff changeset
1906 # First use of gnulib in the given m4base.
104bcb14d247 Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents: 6199
diff changeset
1907 test -n "$supplied_libname" || supplied_libname=true
104bcb14d247 Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents: 6199
diff changeset
1908 test -n "$sourcebase" || sourcebase="lib"
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1909 test -n "$docbase" || docbase="doc"
6262
bef30dac846f Provide a default for --tests-base.
Bruno Haible <bruno@clisp.org>
parents: 6250
diff changeset
1910 test -n "$testsbase" || testsbase="tests"
6204
104bcb14d247 Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents: 6199
diff changeset
1911 test -n "$macro_prefix" || macro_prefix="gl"
104bcb14d247 Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents: 6199
diff changeset
1912 fi
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1913 func_import "$*"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1914 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1915 # Apply func_import to all gnulib directories.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1916 # To get this list of directories, look at Makefile.am. (Not at
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1917 # configure, because it may be omitted from CVS. Also, don't run
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1918 # "find $destdir -name gnulib-cache.m4", as it might be too expensive.)
6952
b1f02ed7eeab * modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents: 6940
diff changeset
1919 aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$destdir"/Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1920 m4dirs=
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1921 m4dirs_count=0
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1922 m4dir_is_next=
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1923 for arg in $aclocal_amflags; do
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1924 if test -n "$m4dir_is_next"; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1925 # Ignore absolute directory pathnames, like /usr/local/share/aclocal.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1926 case "$arg" in
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1927 /*) ;;
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1928 *)
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1929 if test -f "$destdir/$arg"/gnulib-cache.m4; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1930 m4dirs="$m4dirs $arg"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1931 m4dirs_count=`expr $m4dirs_count + 1`
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1932 fi
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1933 ;;
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1934 esac
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1935 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1936 if test "X$arg" = "X-I"; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1937 m4dir_is_next=yes
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1938 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1939 m4dir_is_next=
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1940 fi
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1941 fi
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1942 done
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1943 if test $m4dirs_count = 0; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1944 # First use of gnulib in a package.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1945 # Any number of additional modules can be given.
6190
605b7cac11f2 Don't complain about missing options in the first-use case.
Bruno Haible <bruno@clisp.org>
parents: 6189
diff changeset
1946 test -n "$supplied_libname" || supplied_libname=true
605b7cac11f2 Don't complain about missing options in the first-use case.
Bruno Haible <bruno@clisp.org>
parents: 6189
diff changeset
1947 test -n "$sourcebase" || sourcebase="lib"
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1948 m4base="m4"
6955
7715890c929a * gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents: 6952
diff changeset
1949 test -n "$docbase" || docbase="doc"
6262
bef30dac846f Provide a default for --tests-base.
Bruno Haible <bruno@clisp.org>
parents: 6250
diff changeset
1950 test -n "$testsbase" || testsbase="tests"
6190
605b7cac11f2 Don't complain about missing options in the first-use case.
Bruno Haible <bruno@clisp.org>
parents: 6189
diff changeset
1951 test -n "$macro_prefix" || macro_prefix="gl"
6183
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1952 func_import "$*"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1953 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1954 if test $m4dirs_count = 1; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1955 # There's only one use of gnulib here. Assume the user means it.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1956 # Any number of additional modules can be given.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1957 for m4base in $m4dirs; do
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1958 func_import "$*"
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1959 done
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1960 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1961 # Ambiguous - guess what the user meant.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1962 if test $# = 0; then
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1963 # No further arguments. Guess the user wants to update all of them.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1964 for m4base in $m4dirs; do
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1965 func_import
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1966 done
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1967 else
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1968 # Really ambiguous.
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1969 func_fatal_error "Ambiguity: to which directory should the modules be added? Please specify at least --m4-base=..."
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1970 fi
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1971 fi
d12635ef6eb5 Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents: 6182
diff changeset
1972 fi
6178
3830993b4c7a Rename some variables.
Bruno Haible <bruno@clisp.org>
parents: 6177
diff changeset
1973 fi
5343
eae956a8e0ec Untabify.
Bruno Haible <bruno@clisp.org>
parents: 5312
diff changeset
1974 ;;
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1975
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1976 create-testdir )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1977 if test -z "$destdir"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1978 func_fatal_error "please specify --dir option"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1979 fi
4126
e8caa337b4e1 (create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents: 4124
diff changeset
1980 mkdir "$destdir"
e8caa337b4e1 (create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents: 4124
diff changeset
1981 test -d "$destdir" \
e8caa337b4e1 (create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents: 4124
diff changeset
1982 || func_fatal_error "could not create destination directory"
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1983 test -n "$auxdir" || auxdir="build-aux"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1984 func_create_testdir "$destdir" "$*"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1985 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1986
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1987 create-megatestdir )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1988 if test -z "$destdir"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1989 func_fatal_error "please specify --dir option"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1990 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1991 mkdir "$destdir" || func_fatal_error "could not create destination directory"
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1992 test -n "$auxdir" || auxdir="build-aux"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1993 func_create_megatestdir "$destdir" "$*"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1994 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1995
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1996 test )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1997 test -n "$destdir" || destdir=testdir$$
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1998 mkdir "$destdir" || func_fatal_error "could not create destination directory"
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
1999 test -n "$auxdir" || auxdir="build-aux"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2000 func_create_testdir "$destdir" "$*"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2001 cd "$destdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2002 mkdir build
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2003 cd build
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2004 ../configure
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2005 make
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2006 make check
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2007 make distclean
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2008 remaining=`find . -type f -print`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2009 if test -n "$remaining"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2010 echo "Remaining files:" $remaining 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2011 echo "gnulib-tool: *** Stop." 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2012 exit 1
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2013 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2014 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2015 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2016 rm -rf "$destdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2017 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2018
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2019 megatest )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2020 test -n "$destdir" || destdir=testdir$$
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2021 mkdir "$destdir" || func_fatal_error "could not create destination directory"
6109
a52f596fdf00 Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents: 6108
diff changeset
2022 test -n "$auxdir" || auxdir="build-aux"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2023 func_create_megatestdir "$destdir" "$*"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2024 cd "$destdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2025 mkdir build
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2026 cd build
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2027 ../configure
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2028 make
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2029 make check
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2030 make distclean
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2031 remaining=`find . -type f -print`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2032 if test -n "$remaining"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2033 echo "Remaining files:" $remaining 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2034 echo "gnulib-tool: *** Stop." 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2035 exit 1
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2036 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2037 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2038 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2039 rm -rf "$destdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2040 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2041
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2042 extract-description )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2043 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2044 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2045 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2046 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2047 func_get_description "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2048 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2049 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2050 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2051
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2052 extract-filelist )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2053 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2054 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2055 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2056 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2057 func_get_filelist "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2058 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2059 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2060 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2061
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2062 extract-dependencies )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2063 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2064 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2065 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2066 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2067 func_get_dependencies "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2068 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2069 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2070 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2071
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2072 extract-autoconf-snippet )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2073 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2074 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2075 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2076 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2077 func_get_autoconf_snippet "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2078 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2079 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2080 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2081
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2082 extract-automake-snippet )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2083 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2084 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2085 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2086 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2087 func_get_automake_snippet "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2088 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2089 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2090 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2091
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2092 extract-include-directive )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2093 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2094 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2095 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2096 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2097 func_get_include_directive "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2098 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2099 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2100 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2101
5251
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2102 extract-license )
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2103 for module
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2104 do
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2105 func_verify_module
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2106 if test -n "$module"; then
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2107 func_get_license "$module"
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2108 fi
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2109 done
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2110 ;;
42b53a22aee5 Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents: 5250
diff changeset
2111
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2112 extract-maintainer )
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2113 for module
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2114 do
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2115 func_verify_module
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2116 if test -n "$module"; then
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2117 func_get_maintainer "$module"
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2118 fi
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2119 done
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2120 ;;
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
2121
6113
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2122 extract-tests-module )
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2123 for module
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2124 do
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2125 func_verify_module
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2126 if test -n "$module"; then
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2127 func_get_tests_module "$module"
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2128 fi
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2129 done
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2130 ;;
dac0e048bd40 Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents: 6111
diff changeset
2131
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2132 * )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2133 func_fatal_error "unknown operation mode --$mode" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2134 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2135
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2136 exit 0