Mercurial > gnulib
annotate gnulib-tool @ 10743:ec39330cb04e
Modules now have a 'status' attribute.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 02 Nov 2008 15:41:14 +0100 |
parents | a97c57b9b48e |
children | 7fb7b37150b3 |
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 # |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
3 # Copyright (C) 2002-2008 Free Software Foundation, Inc. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 # |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9284
diff
changeset
|
5 # This program is free software: you can redistribute it and/or modify |
4112
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 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9284
diff
changeset
|
7 # the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9284
diff
changeset
|
8 # (at your option) any later version. |
4112
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 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9284
diff
changeset
|
16 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 # |
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 # 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
|
20 # modules from gnulib into their packages. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 progname=$0 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 package=gnulib |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
24 nl=' |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
25 ' |
9005
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
26 IFS=" "" $nl" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 # 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
|
29 AUTOCONFPATH= |
5250
46a747db97f2
Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents:
5237
diff
changeset
|
30 #case $USER in |
46a747db97f2
Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents:
5237
diff
changeset
|
31 # bruno ) |
46a747db97f2
Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents:
5237
diff
changeset
|
32 # AUTOCONFBINDIR=/packages/gnu-inst-autoconf/2.57/bin |
46a747db97f2
Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents:
5237
diff
changeset
|
33 # AUTOCONFPATH="eval env PATH=${AUTOCONFBINDIR}:\$PATH " |
46a747db97f2
Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents:
5237
diff
changeset
|
34 # ;; |
46a747db97f2
Comment out private settings.
Bruno Haible <bruno@clisp.org>
parents:
5237
diff
changeset
|
35 #esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 |
6547
1a65fb7ddbbb
Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents:
6546
diff
changeset
|
37 # 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
|
38 AUTOMAKEPATH= |
1a65fb7ddbbb
Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents:
6546
diff
changeset
|
39 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
40 # You can set GETTEXTPATH to empty if autopoint 0.15 is already in your PATH. |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
41 GETTEXTPATH= |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
42 |
6551
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
43 # If you didn't set AUTOCONFPATH and AUTOMAKEPATH, you can also set the |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
44 # variables AUTOCONF, AUTOHEADER, ACLOCAL, AUTOMAKE, AUTORECONF individually. |
6551
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
45 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
|
46 AUTOCONF="${AUTOCONFPATH}autoconf" |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
47 fi |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
48 if test -z "${AUTOHEADER}" || test -n "${AUTOCONFPATH}"; then |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
49 AUTOHEADER="${AUTOCONFPATH}autoheader" |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
50 fi |
6551
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
51 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
|
52 ACLOCAL="${AUTOMAKEPATH}aclocal" |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
53 fi |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
54 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
|
55 AUTOMAKE="${AUTOMAKEPATH}automake" |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
56 fi |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
57 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
|
58 AUTORECONF="${AUTOCONFPATH}autoreconf" |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
59 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
60 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
61 # If you didn't set GETTEXTPATH, you can also set the variable AUTOPOINT. |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
62 if test -z "${AUTOPOINT}" || test -n "${GETTEXTPATH}"; then |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
63 AUTOPOINT="${GETTEXTPATH}autopoint" |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
64 fi |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
65 |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
66 # When using GNU sed, turn off as many GNU extensions as possible, |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
67 # to minimize the risk of accidentally using non-portable features. |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
68 # However, do this only for gnulib-tool itself, not for the code that |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
69 # gnulib-tool generates, since we don't want "sed --posix" to leak |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
70 # into makefiles. |
7911
548a756cade0
Fix test whether sed is GNU sed supporting --posix.
Bruno Haible <bruno@clisp.org>
parents:
7896
diff
changeset
|
71 if (alias) > /dev/null 2>&1 && echo | sed --posix -e d >/dev/null 2>&1; then |
9213
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
72 # Define sed as an alias. |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
73 # It is not always possible to use aliases. Aliases are guaranteed to work |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
74 # if the executing shell is bash and either it is invoked as /bin/sh or |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
75 # is a version >= 2.0, supporting shopt. This is the common case. |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
76 # Two other approaches (use of a variable $sed or of a function func_sed |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
77 # instead of an alias) require massive, fragile code changes. |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
78 # An other approach (use of function sed) requires `which sed` - but 'which' |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
79 # is hard to emulate, due to missing "test -x" on some platforms. |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
80 if test -n "$BASH_VERSION"; then |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
81 shopt -s expand_aliases >/dev/null 2>&1 |
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
82 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
83 alias sed='sed --posix' |
7737
19ff03763d73
Use "sed --posix" instead of "sed" when possible.
Bruno Haible <bruno@clisp.org>
parents:
7722
diff
changeset
|
84 fi |
19ff03763d73
Use "sed --posix" instead of "sed" when possible.
Bruno Haible <bruno@clisp.org>
parents:
7722
diff
changeset
|
85 |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
86 # sed_noop is a sed expression that does nothing. |
10401 | 87 # An empty expression does not work with the native 'sed' on AIX 6.1. |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
88 sed_noop='s,x,x,' |
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
89 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
90 # func_usage |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
91 # outputs to stdout the --help usage message. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
92 func_usage () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
93 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
94 echo "\ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
95 Usage: gnulib-tool --list |
5344
c2f5677fc6ed
Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents:
5343
diff
changeset
|
96 gnulib-tool --import [module1 ... moduleN] |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
97 gnulib-tool --update |
7484
57fe575409ae
--create-testdir without module names now means to use nearly all modules.
Bruno Haible <bruno@clisp.org>
parents:
7421
diff
changeset
|
98 gnulib-tool --create-testdir --dir=directory [module1 ... moduleN] |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
99 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN] |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
100 gnulib-tool --test --dir=directory module1 ... moduleN |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
101 gnulib-tool --megatest --dir=directory [module1 ... moduleN] |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
102 gnulib-tool --extract-description module |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
103 gnulib-tool --extract-status module |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
104 gnulib-tool --extract-notice module |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
105 gnulib-tool --extract-filelist module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
106 gnulib-tool --extract-dependencies module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
107 gnulib-tool --extract-autoconf-snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
108 gnulib-tool --extract-automake-snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
109 gnulib-tool --extract-include-directive module |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
110 gnulib-tool --extract-link-directive module |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
111 gnulib-tool --extract-license module |
4197 | 112 gnulib-tool --extract-maintainer module |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
113 gnulib-tool --extract-tests-module module |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
114 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
115 Operation modes: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
116 --list print the available module names |
6633
5118aa463328
* gnulib-tool (Usage): Fix --import, from
Simon Josefsson <simon@josefsson.org>
parents:
6614
diff
changeset
|
117 --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
|
118 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
|
119 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
|
120 --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
|
121 from CVS |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
122 --create-testdir create a scratch package with the given modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
123 --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
|
124 one by one and all together |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
125 --test test the combination of the given modules |
4197 | 126 (recommended to use CC=\"gcc -Wall\" here) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
127 --megatest test the given modules one by one and all together |
4197 | 128 (recommended to use CC=\"gcc -Wall\" here) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
129 --extract-description extract the description |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
130 --extract-status extract the status (obsolete or not) |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
131 --extract-notice extract the notice or banner |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
132 --extract-filelist extract the list of files |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
133 --extract-dependencies extract the dependencies |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
134 --extract-autoconf-snippet extract the snippet for configure.ac |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
135 --extract-automake-snippet extract the snippet for library makefile |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
136 --extract-include-directive extract the #include directive |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
137 --extract-link-directive extract the linker directive |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
138 --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
|
139 under lib/ |
4197 | 140 --extract-maintainer report the maintainer(s) inside gnulib |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
141 --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
|
142 |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
143 General options: |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
144 --dir=DIRECTORY Specify the target directory. |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
145 For --import, this specifies where your |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
146 configure.ac can be found. Defaults to current |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
147 directory. |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
148 --local-dir=DIRECTORY Specify a local override directory where to look |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
149 up files before looking in gnulib's directory. |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
150 --verbose Increase verbosity. May be repeated. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
151 --quiet Decrease verbosity. May be repeated. |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
152 |
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
153 Options for --import: |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
154 --lib=LIBRARY Specify the library name. Defaults to 'libgnu'. |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
155 --source-base=DIRECTORY |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
156 Directory relative to --dir where source code is |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
157 placed (default \"lib\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
158 --m4-base=DIRECTORY Directory relative to --dir where *.m4 macros are |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
159 placed (default \"m4\"). |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
160 --po-base=DIRECTORY Directory relative to --dir where *.po files are |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
161 placed (default \"po\"). |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
162 --doc-base=DIRECTORY Directory relative to --dir where doc files are |
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
163 placed (default \"doc\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
164 --tests-base=DIRECTORY |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
165 Directory relative to --dir where unit tests are |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
166 placed (default \"tests\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
167 --aux-dir=DIRECTORY Directory relative to --dir where auxiliary build |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
168 tools are placed (default \"build-aux\"). |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
169 --with-tests Include unit tests for the included modules. |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
170 --avoid=MODULE Avoid including the given MODULE. Useful if you |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
171 have code that provides equivalent functionality. |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
172 This option can be repeated. |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
173 --lgpl[=2|=3] Abort if modules aren't available under the LGPL. |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
174 Also modify license template from GPL to LGPL. |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
175 The version number of the LGPL can be specified; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
176 the default is currently LGPLv3. |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
177 --makefile-name=NAME Name of makefile in automake syntax in the |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
178 source-base and tests-base directories |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
179 (default \"Makefile.am\"). |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
180 --libtool Use libtool rules. |
7077 | 181 --no-libtool Don't use libtool rules. |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
182 --macro-prefix=PREFIX Specify the prefix of the macros 'gl_EARLY' and |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
183 'gl_INIT'. Default is 'gl'. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
184 --po-domain=NAME Specify the prefix of the i18n domain. Usually use |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
185 the package name. A suffix '-gnulib' is appended. |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
186 --vc-files Update version control related files. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
187 --no-vc-files Don't update version control related files |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
188 (.gitignore and/or .cvsignore). |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
189 --no-changelog Don't update or create ChangeLog files. |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
190 |
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
191 Options for --import and --update: |
6966 | 192 --dry-run For --import, only print what would have been done. |
193 -s, --symbolic, --symlink Make symbolic links instead of copying files. | |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
194 --local-symlink Make symbolic links instead of copying files, only |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
195 for files from the local override directory. |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
196 -S, --more-symlinks Make symbolic links instead of copying files, and |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
197 don't replace copyright notices. |
4112
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 Report bugs to <bug-gnulib@gnu.org>." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
200 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
201 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
202 # func_version |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
203 # outputs to stdout the --version message. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
204 func_version () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
205 { |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
206 func_gnulib_dir |
9805
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
207 if test -d "$gnulib_dir"/.git \ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
208 && (git --version) >/dev/null 2>/dev/null \ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
209 && (date --version) >/dev/null 2>/dev/null; then |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
210 # gnulib checked out from git. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
211 sed_extract_first_date='/^Date/{ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
212 s/^Date:[ ]*//p |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
213 q |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
214 }' |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
215 date=`cd "$gnulib_dir" && git log ChangeLog | sed -n -e "$sed_extract_first_date"` |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
216 # Turn "Fri Mar 21 07:16:51 2008 -0600" into "Mar 21 2008 07:16:51 -0600". |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
217 sed_year_before_time='s/^[^ ]* \([^ ]*\) \([0-9]*\) \([0-9:]*\) \([0-9]*\) /\1 \2 \4 \3 /' |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
218 date=`echo "$date" | sed -e "$sed_year_before_time"` |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
219 # Use GNU date to compute the time in GMT. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
220 date=`date -d "$date" -u +"%Y-%m-%d %H:%M:%S"` |
10495
78d1bdfaa67e
Make "gnulib-tool --version" work from any directory.
Bruno Haible <bruno@clisp.org>
parents:
10479
diff
changeset
|
221 version=' '`cd "$gnulib_dir" && ./build-aux/git-version-gen /dev/null | sed -e 's/-dirty/-modified/'` |
9805
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
222 else |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
223 if test -d "$gnulib_dir"/CVS \ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
224 && (cvs --version) >/dev/null 2>/dev/null; then |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
225 # gnulib checked out from CVS. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
226 sed_extract_first_date='/^date: /{ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
227 s/^date: \([0-9][0-9][0-9][0-9]\).\([0-9][0-9]\).\([0-9][0-9]\) \([0-9][0-9]:[0-9][0-9]:[0-9][0-9]\).*/\1-\2-\3 \4/p |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
228 q |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
229 }' |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
230 date=`cd "$gnulib_dir" && cvs log -N ChangeLog 2>/dev/null | sed -n -e "$sed_extract_first_date"` |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
231 else |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
232 # gnulib copy without versioning information. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
233 date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog` |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
234 fi |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
235 version= |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
236 fi |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
237 year=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed 's,^.* ,,'` |
7347
d86464f614f7
* gnulib-tool (func_version): Create output all at once. This
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7335
diff
changeset
|
238 echo "\ |
9805
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
239 gnulib-tool (GNU $package $date)$version |
7347
d86464f614f7
* gnulib-tool (func_version): Create output all at once. This
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7335
diff
changeset
|
240 Copyright (C) $year Free Software Foundation, Inc. |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
241 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
242 This is free software: you are free to change and redistribute it. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
243 There is NO WARRANTY, to the extent permitted by law. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
244 |
7347
d86464f614f7
* gnulib-tool (func_version): Create output all at once. This
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7335
diff
changeset
|
245 Written by" "Bruno Haible" "and" "Simon Josefsson" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
246 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
247 |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
248 # func_emit_copyright_notice |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
249 # 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
|
250 func_emit_copyright_notice () |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
251 { |
9794
0675687268a7
Bump copyright year in files generated by gnulib-tool.
Eric Blake <ebb9@byu.net>
parents:
9793
diff
changeset
|
252 sed -n '/Copyright/ { |
0675687268a7
Bump copyright year in files generated by gnulib-tool.
Eric Blake <ebb9@byu.net>
parents:
9793
diff
changeset
|
253 p |
0675687268a7
Bump copyright year in files generated by gnulib-tool.
Eric Blake <ebb9@byu.net>
parents:
9793
diff
changeset
|
254 q |
0675687268a7
Bump copyright year in files generated by gnulib-tool.
Eric Blake <ebb9@byu.net>
parents:
9793
diff
changeset
|
255 }' < "$self_abspathname" |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
256 echo "#" |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
257 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
|
258 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
|
259 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
|
260 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
|
261 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
|
262 echo "#" |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
263 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
|
264 } |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
265 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
266 # func_exit STATUS |
10453 | 267 # exits with a given status. |
268 # This function needs to be used, rather than 'exit', when a 'trap' handler is | |
269 # in effect that refers to $?. | |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
270 func_exit () |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
271 { |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
272 (exit $1); exit $1 |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
273 } |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
274 |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
275 # func_gnulib_dir |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
276 # locates the directory where the gnulib repository lives |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
277 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
278 # - progname name of this program |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
279 # Sets variables |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
280 # - self_abspathname absolute pathname of gnulib-tool |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
281 # - gnulib_dir absolute pathname of gnulib repository |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
282 func_gnulib_dir () |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
283 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
284 case "$progname" in |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
285 /*) self_abspathname="$progname" ;; |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
286 */*) self_abspathname=`pwd`/"$progname" ;; |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
287 *) |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
288 # Look in $PATH. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
289 # Iterate through the elements of $PATH. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
290 # We use IFS=: instead of |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
291 # for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'` |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
292 # because the latter does not work when some PATH element contains spaces. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
293 # We use a canonicalized $pathx instead of $PATH, because empty PATH |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
294 # elements are by definition equivalent to '.', however field splitting |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
295 # according to IFS=: loses empty fields in many shells: |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
296 # - /bin/sh on OSF/1 and Solaris loses all empty fields (at the |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
297 # beginning, at the end, and in the middle), |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
298 # - /bin/sh on IRIX and /bin/ksh on IRIX and OSF/1 lose empty fields |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
299 # at the beginning and at the end, |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
300 # - GNU bash, /bin/sh on AIX and HP-UX, and /bin/ksh on AIX, HP-UX, |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
301 # Solaris lose empty fields at the end. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
302 # The 'case' statement is an optimization, to avoid evaluating the |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
303 # explicit canonicalization command when $PATH contains no empty fields. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
304 self_abspathname= |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
305 if test "${PATH_SEPARATOR+set}" != set; then |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
306 func_tmpdir |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
307 { echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
308 chmod +x "$tmp"/conf.sh |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
309 if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
310 PATH_SEPARATOR=';' |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
311 else |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
312 PATH_SEPARATOR=: |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
313 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
314 rm -rf "$tmp" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
315 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
316 if test "$PATH_SEPARATOR" = ";"; then |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
317 # On Windows, programs are searched in "." before $PATH. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
318 pathx=".;$PATH" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
319 else |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
320 # On Unix, we have to convert empty PATH elements to ".". |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
321 pathx="$PATH" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
322 case :$PATH: in |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
323 *::*) |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
324 pathx=`echo ":$PATH:" | sed -e 's/:::*/:.:/g' -e 's/^://' -e 's/:\$//'` |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
325 ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
326 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
327 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
328 save_IFS="$IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
329 IFS="$PATH_SEPARATOR" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
330 for d in $pathx; do |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
331 IFS="$save_IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
332 test -z "$d" && d=. |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
333 if test -x "$d/$progname" && test ! -d "$d/$progname"; then |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
334 self_abspathname="$d/$progname" |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
335 break |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
336 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
337 done |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
338 IFS="$save_IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
339 if test -z "$self_abspathname"; then |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
340 func_fatal_error "could not locate the gnulib-tool program - how did you invoke it?" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
341 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
342 ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
343 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
344 while test -h "$self_abspathname"; do |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
345 # Resolve symbolic link. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
346 linkval=`func_readlink "$self_abspathname"` |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
347 test -n "$linkval" || break |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
348 case "$linkval" in |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
349 /* ) self_abspathname="$linkval" ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
350 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
351 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
352 done |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
353 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
354 } |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
355 |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
356 # func_tmpdir |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
357 # creates a temporary directory. |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
358 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
359 # - progname name of this program |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
360 # Sets variable |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
361 # - 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
|
362 func_tmpdir () |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
363 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
364 # 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
|
365 # 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
|
366 # /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
|
367 : ${TMPDIR=/tmp} |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
368 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
369 # 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
|
370 # 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
|
371 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
|
372 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
|
373 } || |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
374 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
375 # 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
|
376 # 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
|
377 # 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
|
378 # 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
|
379 # directory. |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
380 tmp=$TMPDIR/gl$$-$RANDOM |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
381 (umask 077 && mkdir "$tmp") |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
382 } || |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
383 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
384 echo "$progname: cannot create a temporary directory in $TMPDIR" >&2 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
385 func_exit 1 |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
386 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
387 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
388 |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
389 # func_append var value |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
390 # appends the given value to the shell variable var. |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
391 if ( foo=bar; foo+=baz && test "$foo" = barbaz ) >/dev/null 2>&1; then |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
392 # Use bash's += operator. It reduces complexity of appending repeatedly to |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
393 # a single variable from O(n^2) to O(n). |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
394 func_append () |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
395 { |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
396 eval "$1+=\"\$2\"" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
397 } |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
398 else |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
399 func_append () |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
400 { |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
401 eval "$1=\"\$$1\$2\"" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
402 } |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
403 fi |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
404 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
405 # func_fatal_error message |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
406 # outputs to stderr a fatal error message, and terminates the program. |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
407 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
408 # - progname name of this program |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
409 func_fatal_error () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
410 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
411 echo "$progname: *** $1" 1>&2 |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
412 echo "$progname: *** Stop." 1>&2 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
413 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
414 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
415 |
6248
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
416 # func_readlink SYMLINK |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
417 # outputs the target of the given symlink. |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
418 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
|
419 func_readlink () |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
420 { |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
421 # Use the readlink program from GNU coreutils. |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
422 readlink "$1" |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
423 } |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
424 else |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
425 func_readlink () |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
426 { |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
427 # 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
|
428 # would do the wrong thing if the link target contains " -> ". |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
429 LC_ALL=C ls -l "$1" | sed -e 's, -> ,#%%#,' | sed -n -e 's,^.*#%%#\(.*\)$,\1,p' |
6248
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
430 } |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
431 fi |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
432 |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
433 # func_relativize DIR1 DIR2 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
434 # computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2. |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
435 # Input: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
436 # - DIR1 relative pathname, relative to the current directory |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
437 # - DIR2 relative pathname, relative to the current directory |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
438 # Output: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
439 # - reldir relative pathname of DIR2, relative to DIR1 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
440 func_relativize () |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
441 { |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
442 dir0=`pwd` |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
443 dir1="$1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
444 dir2="$2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
445 sed_first='s,^\([^/]*\)/.*$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
446 sed_rest='s,^[^/]*/*,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
447 sed_last='s,^.*/\([^/]*\)$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
448 sed_butlast='s,/*[^/]*$,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
449 while test -n "$dir1"; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
450 first=`echo "$dir1" | sed -e "$sed_first"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
451 if test "$first" != "."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
452 if test "$first" = ".."; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
453 dir2=`echo "$dir0" | sed -e "$sed_last"`/"$dir2" |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
454 dir0=`echo "$dir0" | sed -e "$sed_butlast"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
455 else |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
456 first2=`echo "$dir2" | sed -e "$sed_first"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
457 if test "$first2" = "$first"; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
458 dir2=`echo "$dir2" | sed -e "$sed_rest"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
459 else |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
460 dir2="../$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
461 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
462 dir0="$dir0"/"$first" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
463 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
464 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
465 dir1=`echo "$dir1" | sed -e "$sed_rest"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
466 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
467 reldir="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
468 } |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
469 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
470 # func_relconcat DIR1 DIR2 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
471 # computes a relative pathname DIR1/DIR2, with obvious simplifications. |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
472 # Input: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
473 # - DIR1 relative pathname, relative to the current directory |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
474 # - DIR2 relative pathname, relative to DIR1 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
475 # Output: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
476 # - relconcat DIR1/DIR2, relative to the current directory |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
477 func_relconcat () |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
478 { |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
479 dir1="$1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
480 dir2="$2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
481 sed_first='s,^\([^/]*\)/.*$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
482 sed_rest='s,^[^/]*/*,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
483 sed_last='s,^.*/\([^/]*\)$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
484 sed_butlast='s,/*[^/]*$,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
485 while true; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
486 first=`echo "$dir2" | sed -e "$sed_first"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
487 if test "$first" = "."; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
488 dir2=`echo "$dir2" | sed -e "$sed_rest"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
489 if test -z "$dir2"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
490 relconcat="$dir1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
491 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
492 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
493 else |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
494 last=`echo "$dir1" | sed -e "$sed_last"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
495 while test "$last" = "."; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
496 dir1=`echo "$dir1" | sed -e "$sed_butlast"` |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
497 last=`echo "$dir1" | sed -e "$sed_last"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
498 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
499 if test -z "$dir1"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
500 relconcat="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
501 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
502 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
503 if test "$first" = ".."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
504 if test "$last" = ".."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
505 relconcat="$dir1/$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
506 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
507 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
508 dir1=`echo "$dir1" | sed -e "$sed_butlast"` |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
509 dir2=`echo "$dir2" | sed -e "$sed_rest"` |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
510 if test -z "$dir1"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
511 relconcat="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
512 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
513 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
514 if test -z "$dir2"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
515 relconcat="$dir1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
516 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
517 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
518 else |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
519 relconcat="$dir1/$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
520 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
521 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
522 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
523 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
524 } |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
525 |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
526 # func_ln SRC DEST |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
527 # Like ln -s, except that SRC is given relative to the current directory (or |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
528 # absolute), not given relative to the directory of DEST. |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
529 func_ln () |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
530 { |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
531 case "$1" in |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
532 /*) |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
533 ln -s "$1" "$2" ;; |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
534 *) # SRC is relative. |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
535 case "$2" in |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
536 /*) |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
537 ln -s "`pwd`/$1" "$2" ;; |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
538 *) # DEST is relative too. |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
539 ln_destdir=`echo "$2" | sed -e 's,[^/]*$,,'` |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
540 test -n "$ln_destdir" || ln_destdir="." |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
541 func_relativize "$ln_destdir" "$1" |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
542 ln -s "$reldir" "$2" |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
543 ;; |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
544 esac |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
545 ;; |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
546 esac |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
547 } |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
548 |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
549 # func_ln_if_changed SRC DEST |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
550 # Like func_ln, but avoids munging timestamps if the link is correct. |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
551 func_ln_if_changed () |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
552 { |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
553 if test $# -ne 2; then |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
554 echo "usage: func_ln_if_changed SRC DEST" >&2 |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
555 fi |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
556 ln_target=`func_readlink "$2"` |
9167 | 557 if test -h "$2" && test "$1" = "$ln_target"; then |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
558 : |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
559 else |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
560 rm -f "$2" |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
561 func_ln "$1" "$2" |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
562 fi |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
563 } |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
564 |
10379
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
565 # func_reset_sigpipe |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
566 # Resets SIGPIPE to its default behaviour. SIGPIPE is signalled when a process |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
567 # writes into a pipe with no readers, i.e. a pipe where all readers have |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
568 # already closed their file descriptor that read from it or exited entirely. |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
569 # The default behaviour is to terminate the current process without an error |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
570 # message. |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
571 # When "trap '' SIGPIPE" is in effect, the behaviour (at least with bash) is to |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
572 # terminate the current process with an error message. |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
573 # This function should be called at the beginning of a command that only |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
574 # produces output to stdout (i.e. no side effects!), when the command that |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
575 # will read from this pipe might prematurely exit or close its standard input |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
576 # descriptor. |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
577 if test -n "$BASH_VERSION"; then |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
578 # The problem has only been reported with bash. |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
579 # Note that Solaris sh does not understand "trap - SIGPIPE". |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
580 func_reset_sigpipe () |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
581 { |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
582 trap - SIGPIPE |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
583 } |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
584 else |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
585 func_reset_sigpipe () |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
586 { |
10380
85d962720a4e
Oops, fix syntax error in last commit.
Bruno Haible <bruno@clisp.org>
parents:
10379
diff
changeset
|
587 : |
10379
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
588 } |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
589 fi |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
590 |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
591 # Ensure an 'echo' command that does not interpret backslashes. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
592 # Test cases: |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
593 # echo '\n' | wc -l prints 1 when OK, 2 when KO |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
594 # echo '\t' | grep t > /dev/null has return code 0 when OK, 1 when KO |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
595 # This problem is a weird heritage from SVR4. BSD got it right (except that |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
596 # BSD echo interprets '-n' as an option, which is also not desirable). |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
597 # Nowadays the problem occurs in 4 situations: |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
598 # - in bash, when the shell option xpg_echo is set (bash >= 2.04) |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
599 # or when it was built with --enable-usg-echo-default (bash >= 2.0) |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
600 # or when it was built with DEFAULT_ECHO_TO_USG (bash < 2.0), |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
601 # - in zsh, when sh-emulation is not set, |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
602 # - in ksh (e.g. AIX /bin/sh and Solaris /usr/xpg4/bin/sh are ksh instances, |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
603 # and HP-UX /bin/sh and IRIX /bin/sh behave similarly), |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
604 # - in Solaris /bin/sh and OSF/1 /bin/sh. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
605 # We try the following workarounds: |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
606 # - for all: respawn using $CONFIG_SHELL if that is set and works. |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
607 # - for bash >= 2.04: unset the shell option xpg_echo. |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
608 # - for bash >= 2.0: define echo to a function that uses the printf built-in. |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
609 # - for bash < 2.0: define echo to a function that uses cat of a here document. |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
610 # - for zsh: turn sh-emulation on. |
9008
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
611 # - for ksh: alias echo to 'print -r'. |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
612 # - for ksh: alias echo to a function that uses cat of a here document. |
9008
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
613 # - for Solaris /bin/sh and OSF/1 /bin/sh: respawn using /bin/ksh and rely on |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
614 # the ksh workaround. |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
615 # - otherwise: respawn using /bin/sh and rely on the workarounds. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
616 # When respawning, we pass --no-reexec as first argument, so as to avoid |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
617 # turning this script into a fork bomb in unlucky situations. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
618 have_echo= |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
619 if echo '\t' | grep t > /dev/null; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
620 have_echo=yes # Lucky! |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
621 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
622 # Try the workarounds. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
623 # Respawn using $CONFIG_SHELL if that is set and works. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
624 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
625 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
626 && test -n "$CONFIG_SHELL" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
627 && test -f "$CONFIG_SHELL" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
628 && $CONFIG_SHELL -c 'echo '\t' | grep t > /dev/null'; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
629 exec $CONFIG_SHELL "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
630 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
631 fi |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
632 # For bash >= 2.04: unset the shell option xpg_echo. |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
633 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
634 && test -n "$BASH_VERSION" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
635 && (shopt -o xpg_echo; echo '\t' | grep t > /dev/null) 2>/dev/null; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
636 shopt -o xpg_echo |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
637 have_echo=yes |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
638 fi |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
639 # For bash >= 2.0: define echo to a function that uses the printf built-in. |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
640 # For bash < 2.0: define echo to a function that uses cat of a here document. |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
641 # (There is no win in using 'printf' over 'cat' if it is not a shell built-in.) |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
642 if test -z "$have_echo" \ |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
643 && test -n "$BASH_VERSION"; then \ |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
644 if type printf 2>/dev/null | grep / > /dev/null; then |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
645 # 'printf' is not a shell built-in. |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
646 echo () |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
647 { |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
648 cat <<EOF |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
649 $* |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
650 EOF |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
651 } |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
652 else |
9007 | 653 # 'printf' is a shell built-in. |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
654 echo () |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
655 { |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
656 printf '%s\n' "$*" |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
657 } |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
658 fi |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
659 if echo '\t' | grep t > /dev/null; then |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
660 have_echo=yes |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
661 fi |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
662 fi |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
663 # For zsh: turn sh-emulation on. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
664 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
665 && test -n "$ZSH_VERSION" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
666 && (emulate sh) >/dev/null 2>&1; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
667 emulate sh |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
668 fi |
9008
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
669 # For ksh: alias echo to 'print -r'. |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
670 if test -z "$have_echo" \ |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
671 && (type print) >/dev/null 2>&1; then |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
672 # A 'print' command exists. |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
673 if type print 2>/dev/null | grep / > /dev/null; then |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
674 : |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
675 else |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
676 # 'print' is a shell built-in. |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
677 if (print -r '\told' | grep told > /dev/null) 2>/dev/null; then |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
678 # 'print' is the ksh shell built-in. |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
679 alias echo='print -r' |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
680 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
681 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
682 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
683 if test -z "$have_echo" \ |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
684 && echo '\t' | grep t > /dev/null; then |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
685 have_echo=yes |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
686 fi |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
687 # For ksh: alias echo to a function that uses cat of a here document. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
688 # The ksh manual page says: |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
689 # "Aliasing is performed when scripts are read, not while they are executed. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
690 # Therefore, for an alias to take effect, the alias definition command has |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
691 # to be executed before the command which references the alias is read." |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
692 # Because of this, we have to play strange tricks with have_echo, to ensure |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
693 # that the top-level statement containing the test starts after the 'alias' |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
694 # command. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
695 if test -z "$have_echo"; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
696 bsd_echo () |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
697 { |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
698 cat <<EOF |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
699 $* |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
700 EOF |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
701 } |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
702 alias echo=bsd_echo 2>/dev/null |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
703 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
704 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
705 && echo '\t' | grep t > /dev/null; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
706 have_echo=yes |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
707 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
708 if test -z "$have_echo"; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
709 unalias echo 2>/dev/null |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
710 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
711 # For Solaris /bin/sh and OSF/1 /bin/sh: respawn using /bin/ksh. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
712 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
713 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
714 && test -f /bin/ksh; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
715 exec /bin/ksh "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
716 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
717 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
718 # Otherwise: respawn using /bin/sh. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
719 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
720 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
721 && test -f /bin/sh; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
722 exec /bin/sh "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
723 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
724 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
725 if test -z "$have_echo"; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
726 func_fatal_error "Shell does not support 'echo' correctly. Please install GNU bash and set the environment variable CONFIG_SHELL to point to it." |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
727 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
728 if echo '\t' | grep t > /dev/null; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
729 : # Works fine now. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
730 else |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
731 func_fatal_error "Shell does not support 'echo' correctly. Workaround does not work. Please report this as a bug to bug-gnulib@gnu.org." |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
732 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
733 if test "X$1" = "X--no-reexec"; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
734 shift |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
735 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
736 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
737 # Command-line option processing. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
738 # Removes the OPTIONS from the arguments. Sets the variables: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
739 # - mode list or import or create-testdir or create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
740 # - destdir from --dir |
7215 | 741 # - local_gnulib_dir from --local-dir |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
742 # - verbose integer, default 0, inc/decremented by --verbose/--quiet |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
743 # - libname, supplied_libname from --lib |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
744 # - sourcebase from --source-base |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
745 # - m4base from --m4-base |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
746 # - pobase from --po-base |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
747 # - docbase from --doc-base |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
748 # - testsbase from --tests-base |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
749 # - auxdir from --aux-dir |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
750 # - inctests true if --with-tests was given, blank otherwise |
5981 | 751 # - avoidlist list of modules to avoid, from --avoid |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
752 # - lgpl yes or a number if --lgpl was given, blank otherwise |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
753 # - makefile_name from --makefile-name |
7077 | 754 # - libtool true if --libtool was given, false if --no-libtool was |
755 # given, blank otherwise | |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
756 # - macro_prefix from --macro-prefix |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
757 # - po_domain from --po-domain |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
758 # - vc_files true if --vc-files was given, false if --no-vc-files was |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
759 # given, blank otherwise |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
760 # - autoconf_minversion minimum supported autoconf version |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
761 # - 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
|
762 # - doit : if actions shall be executed, false if only to be printed |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
763 # - symbolic true if --symlink or --more-symlinks was given, blank |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
764 # otherwise |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
765 # - lsymbolic true if --local-symlink was given, blank otherwise |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
766 # - do_copyrights blank if --more-symlinks was given, true otherwise |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
767 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
768 mode= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
769 destdir= |
7215 | 770 local_gnulib_dir= |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
771 verbose=0 |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
772 libname=libgnu |
5344
c2f5677fc6ed
Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents:
5343
diff
changeset
|
773 supplied_libname= |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
774 sourcebase= |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
775 m4base= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
776 pobase= |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
777 docbase= |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
778 testsbase= |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
779 auxdir= |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
780 inctests= |
5981 | 781 avoidlist= |
782 lgpl= | |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
783 makefile_name= |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
784 libtool= |
6176 | 785 macro_prefix= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
786 po_domain= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
787 vc_files= |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
788 do_changelog=: |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
789 doit=: |
5799
ad9eff556694
2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
5798
diff
changeset
|
790 symbolic= |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
791 lsymbolic= |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
792 do_copyrights=true |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
793 |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
794 supplied_opts="$@" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
795 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
796 while test $# -gt 0; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
797 case "$1" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
798 --list | --lis ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
799 mode=list |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
800 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
801 --import | --impor | --impo | --imp | --im | --i ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
802 mode=import |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
803 shift ;; |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
804 --update | --updat | --upda | --upd | --up | --u ) |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
805 mode=update |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
806 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
807 --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
|
808 mode=create-testdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
809 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
810 --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
|
811 mode=create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
812 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
813 --test | --tes | --te | --t ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
814 mode=test |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
815 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
816 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
817 mode=megatest |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
818 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
819 --extract-* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
820 mode=`echo "X$1" | sed -e 's/^X--//'` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
821 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
822 --dir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
823 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
824 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
825 func_fatal_error "missing argument for --dir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
826 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
827 destdir=$1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
828 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
829 --dir=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
830 destdir=`echo "X$1" | sed -e 's/^X--dir=//'` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
831 shift ;; |
7215 | 832 --local-dir ) |
833 shift | |
834 if test $# = 0; then | |
835 func_fatal_error "missing argument for --local-dir" | |
836 fi | |
837 local_gnulib_dir=$1 | |
838 shift ;; | |
839 --local-dir=* ) | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
840 local_gnulib_dir=`echo "X$1" | sed -e 's/^X--local-dir=//'` |
7215 | 841 shift ;; |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
842 --verbose | --verbos | --verbo | --verb ) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
843 verbose=`expr $verbose + 1` |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
844 shift ;; |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
845 --quiet | --quie | --qui | --qu | --q ) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
846 verbose=`expr $verbose - 1` |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
847 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
848 --lib ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
849 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
850 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
851 func_fatal_error "missing argument for --lib" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
852 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
853 libname=$1 |
5343 | 854 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
855 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
856 --lib=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
857 libname=`echo "X$1" | sed -e 's/^X--lib=//'` |
5343 | 858 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
859 shift ;; |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
860 --source-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
861 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
862 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
863 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
|
864 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
865 sourcebase=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
866 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
867 --source-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
868 sourcebase=`echo "X$1" | sed -e 's/^X--source-base=//'` |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
869 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
870 --m4-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
871 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
872 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
873 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
|
874 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
875 m4base=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
876 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
877 --m4-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
878 m4base=`echo "X$1" | sed -e 's/^X--m4-base=//'` |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
879 shift ;; |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
880 --po-base ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
881 shift |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
882 if test $# = 0; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
883 func_fatal_error "missing argument for --po-base" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
884 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
885 pobase=$1 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
886 shift ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
887 --po-base=* ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
888 pobase=`echo "X$1" | sed -e 's/^X--po-base=//'` |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
889 shift ;; |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
890 --doc-base ) |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
891 shift |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
892 if test $# = 0; then |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
893 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
|
894 fi |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
895 docbase=$1 |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
896 shift ;; |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
897 --doc-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
898 docbase=`echo "X$1" | sed -e 's/^X--doc-base=//'` |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
899 shift ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
900 --tests-base ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
901 shift |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
902 if test $# = 0; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
903 func_fatal_error "missing argument for --tests-base" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
904 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
905 testsbase=$1 |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
906 shift ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
907 --tests-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
908 testsbase=`echo "X$1" | sed -e 's/^X--tests-base=//'` |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
909 shift ;; |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
910 --aux-dir ) |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
911 shift |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
912 if test $# = 0; then |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
913 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
|
914 fi |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
915 auxdir=$1 |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
916 shift ;; |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
917 --aux-dir=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
918 auxdir=`echo "X$1" | sed -e 's/^X--aux-dir=//'` |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
919 shift ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
920 --with-tests ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
921 inctests=true |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
922 shift ;; |
5981 | 923 --avoid ) |
924 shift | |
925 if test $# = 0; then | |
926 func_fatal_error "missing argument for --avoid" | |
927 fi | |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
928 func_append avoidlist " $1" |
5981 | 929 shift ;; |
930 --avoid=* ) | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
931 arg=`echo "X$1" | sed -e 's/^X--avoid=//'` |
7327
6db875979695
* gnulib-tool (avoidlist): Fix typo that broke options like
Paul Eggert <eggert@cs.ucla.edu>
parents:
7326
diff
changeset
|
932 func_append avoidlist " $arg" |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
933 shift ;; |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
934 --lgpl ) |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
935 lgpl=yes |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
936 shift ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
937 --lgpl=* ) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
938 arg=`echo "X$1" | sed -e 's/^X--lgpl=//'` |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
939 case "$arg" in |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
940 2 | 3) ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
941 *) func_fatal_error "invalid LGPL version number for --lgpl" ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
942 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
943 lgpl=$arg |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
944 shift ;; |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
945 --makefile-name ) |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
946 shift |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
947 if test $# = 0; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
948 func_fatal_error "missing argument for --makefile-name" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
949 fi |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
950 makefile_name="$1" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
951 shift ;; |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
952 --makefile-name=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
953 makefile_name=`echo "X$1" | sed -e 's/^X--makefile-name=//'` |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
954 shift ;; |
5981 | 955 --libtool ) |
956 libtool=true | |
957 shift ;; | |
7077 | 958 --no-libtool ) |
959 libtool=false | |
960 shift ;; | |
6176 | 961 --macro-prefix ) |
962 shift | |
963 if test $# = 0; then | |
964 func_fatal_error "missing argument for --macro-prefix" | |
965 fi | |
966 macro_prefix="$1" | |
967 shift ;; | |
968 --macro-prefix=* ) | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
969 macro_prefix=`echo "X$1" | sed -e 's/^X--macro-prefix=//'` |
6176 | 970 shift ;; |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
971 --po-domain ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
972 shift |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
973 if test $# = 0; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
974 func_fatal_error "missing argument for --po-domain" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
975 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
976 po_domain="$1" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
977 shift ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
978 --po-domain=* ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
979 po_domain=`echo "X$1" | sed -e 's/^X--po-domain=//'` |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
980 shift ;; |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
981 --vc-files ) |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
982 vc_files=true |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
983 shift ;; |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
984 --no-vc-files ) |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
985 vc_files=false |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
986 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
987 --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
|
988 do_changelog=false |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
989 shift ;; |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
990 --dry-run ) |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
991 doit=false |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
992 shift ;; |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
993 -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
|
994 symbolic=true |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
995 shift ;; |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
996 --local-symlink | --local-symlin | --local-symli | --local-syml | --local-sym | --local-sy | --local-s ) |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
997 lsymbolic=true |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
998 shift ;; |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
999 -S | --more-symlinks | --more-symlink | --more-symlin | --more-symli | --more-syml | --more-sym | --more-sy | --more-s | --more- | --more | --mor | --mo ) |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1000 symbolic=true |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1001 do_copyrights= |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1002 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1003 --help | --hel | --he | --h ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1004 func_usage |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1005 func_exit $? ;; |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1006 --version | --versio | --versi | --vers ) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1007 func_version |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1008 func_exit $? ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1009 -- ) |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1010 # Stop option processing |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1011 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1012 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1013 -* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1014 echo "gnulib-tool: unknown option $1" 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1015 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1016 func_exit 1 ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1017 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1018 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1019 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1020 done |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1021 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1022 if test "$mode" = update; then |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1023 if test $# != 0; then |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1024 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
|
1025 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1026 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
|
1027 echo "you need to use 'gnulib --import' - at your own risk!" 1>&2 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1028 func_exit 1 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1029 fi |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
1030 if test -n "$local_gnulib_dir" || test -n "$supplied_libname" \ |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1031 || test -n "$sourcebase" || test -n "$m4base" || test -n "$pobase" \ |
6993
dc8f2a1ff75f
Reorder tests in doc-base patch.
Bruno Haible <bruno@clisp.org>
parents:
6966
diff
changeset
|
1032 || test -n "$docbase" || test -n "$testsbase" || test -n "$auxdir" \ |
dc8f2a1ff75f
Reorder tests in doc-base patch.
Bruno Haible <bruno@clisp.org>
parents:
6966
diff
changeset
|
1033 || test -n "$inctests" || test -n "$avoidlist" || test -n "$lgpl" \ |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1034 || test -n "$makefile_name" || test -n "$macro_prefix" \ |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1035 || test -n "$po_domain" || test -n "$vc_files"; then |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1036 echo "gnulib-tool: invalid options for 'update' mode" 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1037 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1038 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
|
1039 echo "you need to use 'gnulib --import' - at your own risk!" 1>&2 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1040 func_exit 1 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1041 fi |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1042 do_changelog=false |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1043 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1044 if test -n "$pobase" && test -z "$po_domain"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1045 echo "gnulib-tool: together with --po-base, you need to specify --po-domain" 1>&2 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1046 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1047 func_exit 1 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1048 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1049 if test -z "$pobase" && test -n "$po_domain"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1050 echo "gnulib-tool: warning: --po-domain has no effect without a --po-base option" 1>&2 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1051 fi |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1052 |
7071
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1053 # Determine the minimum supported autoconf version from the project's |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1054 # configure.ac. |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1055 DEFAULT_AUTOCONF_MINVERSION="2.59" |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1056 autoconf_minversion= |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1057 configure_ac= |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1058 if { test "$mode" = import || test "$mode" = update; } && test -n "$destdir"; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1059 if test -f "$destdir"/configure.ac; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1060 configure_ac="$destdir/configure.ac" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1061 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1062 if test -f "$destdir"/configure.in; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1063 configure_ac="$destdir/configure.in" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1064 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1065 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1066 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1067 if test -f configure.ac; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1068 configure_ac="configure.ac" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1069 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1070 if test -f configure.in; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1071 configure_ac="configure.in" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1072 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1073 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1074 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1075 if test -n "$configure_ac"; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1076 # Use sed, not autoconf --trace, to look for the AC_PREREQ invocation, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1077 # because when some m4 files are omitted from a CVS repository, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1078 # "autoconf --trace=AC_PREREQ" fails with an error message like this: |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1079 # m4: aclocal.m4:851: Cannot open m4/absolute-header.m4: No such file or directory |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1080 # autom4te: m4 failed with exit status: 1 |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1081 prereqs= |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1082 my_sed_traces=' |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1083 s,#.*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1084 s,^dnl .*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1085 s, dnl .*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1086 /AC_PREREQ/ { |
7767
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1087 s,^.*AC_PREREQ([[ ]*\([^])]*\).*$,\1,p |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1088 }' |
7767
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1089 prereqs=`sed -n -e "$my_sed_traces" < "$configure_ac"` |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1090 if test -n "$prereqs"; then |
7767
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1091 autoconf_minversion=` |
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1092 for version in $prereqs; do echo $version; done | |
7781
b13928e41580
* gnulib-tool (autoconf_minversion): Take the maximum version number
Paul Eggert <eggert@cs.ucla.edu>
parents:
7777
diff
changeset
|
1093 LC_ALL=C sort -nru | sed 1q |
7767
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1094 ` |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1095 fi |
7071
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1096 fi |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1097 if test -z "$autoconf_minversion"; then |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1098 autoconf_minversion=$DEFAULT_AUTOCONF_MINVERSION |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1099 fi |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1100 case "$autoconf_minversion" in |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1101 1.* | 2.[0-4]* | 2.5[0-8]*) |
7071
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1102 func_fatal_error "minimum supported autoconf version is 2.59. Try adding AC_PREREQ([$DEFAULT_AUTOCONF_MINVERSION]) to your configure.ac." ;; |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1103 esac |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1104 |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1105 # 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
|
1106 # 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
|
1107 sed_trimtrailingslashes='s,\([^/]\)//*$,\1,' |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
1108 case "$local_gnulib_dir" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1109 */ ) local_gnulib_dir=`echo "$local_gnulib_dir" | sed -e "$sed_trimtrailingslashes"` ;; |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
1110 esac |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1111 case "$sourcebase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1112 */ ) sourcebase=`echo "$sourcebase" | sed -e "$sed_trimtrailingslashes"` ;; |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1113 esac |
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1114 case "$m4base" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1115 */ ) m4base=`echo "$m4base" | sed -e "$sed_trimtrailingslashes"` ;; |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1116 esac |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1117 case "$pobase" in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1118 */ ) pobase=`echo "$pobase" | sed -e "$sed_trimtrailingslashes"` ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1119 esac |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1120 case "$docbase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1121 */ ) docbase=`echo "$docbase" | sed -e "$sed_trimtrailingslashes"` ;; |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1122 esac |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1123 case "$testsbase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1124 */ ) testsbase=`echo "$testsbase" | sed -e "$sed_trimtrailingslashes"` ;; |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1125 esac |
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1126 case "$auxdir" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1127 */ ) auxdir=`echo "$auxdir" | sed -e "$sed_trimtrailingslashes"` ;; |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1128 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1129 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1130 |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
1131 func_gnulib_dir |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1132 func_tmpdir |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1133 trap 'exit_status=$? |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1134 if test "$signal" != 0; then |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1135 echo "caught signal $signal" >&2 |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1136 fi |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1137 rm -rf "$tmp" |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1138 exit $exit_status' 0 |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1139 for signal in 1 2 3 13 15; do |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1140 trap '{ signal='$signal'; func_exit 1; }' $signal |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1141 done |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1142 signal=0 |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1143 |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1144 # func_lookup_file file |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1145 # looks up a file in $local_gnulib_dir or $gnulib_dir, or combines it through |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1146 # 'patch'. |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1147 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1148 # - local_gnulib_dir from --local-dir |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1149 # Output: |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1150 # - lookedup_file name of the merged (combined) file |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1151 # - lookedup_tmp true if it is located in the tmp directory, blank otherwise |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1152 func_lookup_file () |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1153 { |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1154 lkfile="$1" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1155 if test -n "$local_gnulib_dir" && test -f "$local_gnulib_dir/$lkfile"; then |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1156 lookedup_file="$local_gnulib_dir/$lkfile" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1157 lookedup_tmp= |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1158 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1159 if test -f "$gnulib_dir/$lkfile"; then |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1160 if test -n "$local_gnulib_dir" && test -f "$local_gnulib_dir/$lkfile.diff"; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1161 lkbase=`echo "$lkfile" | sed -e 's,^.*/,,'` |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1162 rm -f "$tmp/$lkbase" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1163 cp "$gnulib_dir/$lkfile" "$tmp/$lkbase" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1164 patch -s "$tmp/$lkbase" < "$local_gnulib_dir/$lkfile.diff" \ |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1165 || func_fatal_error "patch file $local_gnulib_dir/$lkfile.diff didn't apply cleanly" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1166 lookedup_file="$tmp/$lkbase" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1167 lookedup_tmp=true |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1168 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1169 lookedup_file="$gnulib_dir/$lkfile" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1170 lookedup_tmp= |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1171 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1172 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1173 func_fatal_error "file $gnulib_dir/$lkfile not found" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1174 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1175 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1176 } |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1177 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1178 # func_all_modules |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1179 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1180 # - local_gnulib_dir from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1181 func_all_modules () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1182 { |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1183 # 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
|
1184 # 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
|
1185 # --extract-tests-module if desired. |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1186 { |
7805
2ee7433618fe
Add support for subdirectories of the 'modules/' directory.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
1187 (cd "$gnulib_dir" && find modules -type f -print | sed -e 's,^modules/,,') |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1188 if test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules"; then |
7805
2ee7433618fe
Add support for subdirectories of the 'modules/' directory.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
1189 (cd "$local_gnulib_dir" && find modules -type f -print | sed -e 's,^modules/,,' -e 's,\.diff$,,') |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1190 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1191 } \ |
7857
978cf3123a32
Exclude all files inside the CVS directory.
Bruno Haible <bruno@clisp.org>
parents:
7850
diff
changeset
|
1192 | sed -e '/^CVS\//d' -e '/\/CVS\//d' \ |
7850
4c8e2f42f969
* gnulib-tool (func_all_modules): Use POSIX conforming escaping
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7805
diff
changeset
|
1193 -e '/^ChangeLog$/d' -e '/\/ChangeLog$/d' \ |
4c8e2f42f969
* gnulib-tool (func_all_modules): Use POSIX conforming escaping
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7805
diff
changeset
|
1194 -e '/^COPYING$/d' -e '/\/COPYING$/d' \ |
4c8e2f42f969
* gnulib-tool (func_all_modules): Use POSIX conforming escaping
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7805
diff
changeset
|
1195 -e '/^README$/d' -e '/\/README$/d' \ |
7805
2ee7433618fe
Add support for subdirectories of the 'modules/' directory.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
1196 -e '/^TEMPLATE$/d' \ |
8626
eb080a5d05de
TEMPLATE-EXTENDED is not a module.
Bruno Haible <bruno@clisp.org>
parents:
8503
diff
changeset
|
1197 -e '/^TEMPLATE-EXTENDED$/d' \ |
7805
2ee7433618fe
Add support for subdirectories of the 'modules/' directory.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
1198 -e '/^TEMPLATE-TESTS$/d' \ |
7858
08609b22ffd5
(func_all_modules): Exclude all .* files (e.g., Emacs .#* auto-save files).
Simon Josefsson <simon@josefsson.org>
parents:
7857
diff
changeset
|
1199 -e '/^\..*/d' \ |
7805
2ee7433618fe
Add support for subdirectories of the 'modules/' directory.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
1200 -e '/~$/d' \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1201 | sed -e '/-tests$/d' \ |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
1202 | LC_ALL=C sort -u |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1203 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1204 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1205 # func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1206 # verifies a module name |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1207 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1208 # - local_gnulib_dir from --local-dir |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1209 # - module module name argument |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1210 func_verify_module () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1211 { |
7168
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1212 if { test -f "$gnulib_dir/modules/$module" \ |
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1213 || { test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules" \ |
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1214 && test -f "$local_gnulib_dir/modules/$module"; }; } \ |
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1215 && test "CVS" != "$module" \ |
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1216 && test "ChangeLog" != "$module" \ |
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1217 && test "COPYING" != "$module" \ |
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1218 && test "README" != "$module" \ |
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1219 && test "TEMPLATE" != "$module" \ |
8626
eb080a5d05de
TEMPLATE-EXTENDED is not a module.
Bruno Haible <bruno@clisp.org>
parents:
8503
diff
changeset
|
1220 && test "TEMPLATE-EXTENDED" != "$module" \ |
7168
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1221 && test "TEMPLATE-TESTS" != "$module"; then |
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1222 # OK, $module is a correct module name. |
7212 | 1223 # Verify that building the module description with 'patch' succeeds. |
1224 func_lookup_file "modules/$module" | |
7168
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1225 else |
4128
1346b5405a74
(func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents:
4126
diff
changeset
|
1226 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
|
1227 module= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1228 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1229 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1230 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1231 # func_verify_nontests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1232 # verifies a module name, excluding tests modules |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1233 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1234 # - local_gnulib_dir from --local-dir |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1235 # - module module name argument |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1236 func_verify_nontests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1237 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1238 case "$module" in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1239 *-tests ) module= ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1240 * ) func_verify_module ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1241 esac |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1242 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1243 |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1244 # func_verify_tests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1245 # verifies a module name, considering only tests modules |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1246 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1247 # - local_gnulib_dir from --local-dir |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1248 # - module module name argument |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1249 func_verify_tests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1250 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1251 case "$module" in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1252 *-tests ) func_verify_module ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1253 * ) module= ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1254 esac |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1255 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1256 |
6952
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1257 sed_extract_prog=':[ ]*$/ { |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1258 :a |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1259 n |
6952
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1260 s/^Description:[ ]*$// |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1261 s/^Status:[ ]*$// |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1262 s/^Notice:[ ]*$// |
6952
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1263 s/^Files:[ ]*$// |
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1264 s/^Depends-on:[ ]*$// |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1265 s/^configure\.ac-early:[ ]*$// |
6952
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1266 s/^configure\.ac:[ ]*$// |
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1267 s/^Makefile\.am:[ ]*$// |
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1268 s/^Include:[ ]*$// |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1269 s/^Link:[ ]*$// |
6952
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1270 s/^License:[ ]*$// |
b1f02ed7eeab
* modules/fdl: New module, to install doc/fdl.texi.
Eric Blake <ebb9@byu.net>
parents:
6940
diff
changeset
|
1271 s/^Maintainer:[ ]*$// |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1272 tb |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1273 p |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1274 ba |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1275 :b |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1276 }' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1277 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1278 # func_get_description module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1279 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1280 # - local_gnulib_dir from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1281 func_get_description () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1282 { |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1283 func_lookup_file "modules/$1" |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1284 sed -n -e "/^Description$sed_extract_prog" < "$lookedup_file" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1285 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1286 |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1287 # func_get_status module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1288 # Input: |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1289 # - local_gnulib_dir from --local-dir |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1290 func_get_status () |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1291 { |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1292 func_lookup_file "modules/$1" |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1293 sed -n -e "/^Status$sed_extract_prog" < "$lookedup_file" |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1294 } |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1295 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1296 # func_get_notice module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1297 # Input: |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1298 # - local_gnulib_dir from --local-dir |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1299 func_get_notice () |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1300 { |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1301 func_lookup_file "modules/$1" |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1302 sed -n -e "/^Notice$sed_extract_prog" < "$lookedup_file" |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1303 } |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1304 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1305 # func_get_filelist module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1306 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1307 # - local_gnulib_dir from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1308 func_get_filelist () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1309 { |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1310 func_lookup_file "modules/$1" |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1311 sed -n -e "/^Files$sed_extract_prog" < "$lookedup_file" |
7788
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
7781
diff
changeset
|
1312 echo m4/gnulib-common.m4 |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1313 case "$autoconf_minversion" in |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1314 2.59) |
9879
e0ce0891df69
Avoid some more autoconf warnings.
Eric Blake <ebb9@byu.net>
parents:
9875
diff
changeset
|
1315 echo m4/onceonly.m4 |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1316 ;; |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1317 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1318 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1319 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1320 # func_get_dependencies module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1321 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1322 # - local_gnulib_dir from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1323 func_get_dependencies () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1324 { |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1325 # ${module}-tests always implicitly depends on ${module}. |
9355
0697c925151a
* gnulib-tool (func_get_dependencies): Fix sed script to match only tests.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9309
diff
changeset
|
1326 echo "$1" | sed -n -e 's/-tests$//p' |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1327 # Then the explicit dependencies listed in the module description. |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1328 func_lookup_file "modules/$1" |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1329 sed -n -e "/^Depends-on$sed_extract_prog" < "$lookedup_file" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1330 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1331 |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1332 # func_get_autoconf_early_snippet module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1333 # Input: |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1334 # - local_gnulib_dir from --local-dir |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1335 func_get_autoconf_early_snippet () |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1336 { |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1337 func_lookup_file "modules/$1" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1338 sed -n -e "/^configure\.ac-early$sed_extract_prog" < "$lookedup_file" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1339 } |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
1340 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1341 # func_get_autoconf_snippet module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1342 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1343 # - local_gnulib_dir from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1344 func_get_autoconf_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1345 { |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1346 func_lookup_file "modules/$1" |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1347 sed -n -e "/^configure\.ac$sed_extract_prog" < "$lookedup_file" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1348 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1349 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1350 # func_get_automake_snippet module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1351 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1352 # - local_gnulib_dir from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1353 func_get_automake_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1354 { |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1355 func_lookup_file "modules/$1" |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1356 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1357 case "$1" in |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1358 *-tests) |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1359 # *-tests module live in tests/, not lib/. |
9284
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1360 # Synthesize an EXTRA_DIST augmentation. |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1361 all_files=`func_get_filelist $1` |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1362 tests_files=`for f in $all_files; do \ |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1363 case $f in \ |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1364 tests/*) echo $f ;; \ |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1365 esac; \ |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1366 done | sed -e 's,^tests/,,'` |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1367 extra_files="$tests_files" |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1368 if test -n "$extra_files"; then |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1369 echo "EXTRA_DIST +=" $extra_files |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1370 echo |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
1371 fi |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1372 ;; |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1373 *) |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1374 # Synthesize an EXTRA_DIST augmentation. |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1375 sed_combine_lines='/\\$/{ |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1376 :a |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1377 N |
7599
352da45c182e
Interpret a backslash-newline sequence in the Makefile.am snippet as a space.
Bruno Haible <bruno@clisp.org>
parents:
7591
diff
changeset
|
1378 s/\\\n/ / |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1379 s/\\$/\\/ |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1380 ta |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1381 }' |
7754
ed8105720327
* modules/absolute-header: New module.
Eric Blake <ebb9@byu.net>
parents:
7752
diff
changeset
|
1382 sed_extract_mentioned_files='s/^lib_SOURCES[ ]*+=[ ]*//p' |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1383 already_mentioned_files=` \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1384 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1385 | sed -e "$sed_combine_lines" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1386 | sed -n -e "$sed_extract_mentioned_files" | sed -e 's/#.*//'` |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1387 all_files=`func_get_filelist $1` |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1388 lib_files=`for f in $all_files; do \ |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1389 case $f in \ |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1390 lib/*) echo $f ;; \ |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1391 esac; \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1392 done | sed -e 's,^lib/,,'` |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1393 # Remove $already_mentioned_files from $lib_files. |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1394 echo "$lib_files" | LC_ALL=C sort -u > "$tmp"/lib-files |
10379
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
1395 extra_files=`func_reset_sigpipe; \ |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
1396 for f in $already_mentioned_files; do echo $f; done \ |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1397 | LC_ALL=C sort -u | LC_ALL=C join -v 2 - "$tmp"/lib-files` |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1398 if test -n "$extra_files"; then |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1399 echo "EXTRA_DIST +=" $extra_files |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1400 echo |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1401 fi |
7640
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1402 # Synthesize also an EXTRA_lib_SOURCES augmentation. |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1403 # This is necessary so that automake can generate the right list of |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1404 # dependency rules. |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1405 # A possible approach would be to use autom4te --trace of the redefined |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1406 # AC_LIBOBJ and AC_REPLACE_FUNCS macros when creating the Makefile.am |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1407 # (use autom4te --trace, not just grep, so that AC_LIBOBJ invocations |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1408 # inside autoconf's built-in macros are not missed). |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1409 # But it's simpler and more robust to do it here, based on the file list. |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1410 # If some .c file exists and is not used with AC_LIBOBJ - for example, |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1411 # a .c file is preprocessed into another .c file for BUILT_SOURCES -, |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
1412 # automake will generate a useless dependency; this is harmless. |
8356
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1413 case "$1" in |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1414 relocatable-prog-wrapper) ;; |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1415 *) |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1416 sed_extract_c_files='/\.c$/p' |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1417 extra_files=`echo "$extra_files" | sed -n -e "$sed_extract_c_files"` |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1418 if test -n "$extra_files"; then |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1419 echo "EXTRA_lib_SOURCES +=" $extra_files |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1420 echo |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1421 fi |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1422 ;; |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
1423 esac |
9107
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1424 # Synthesize an EXTRA_DIST augmentation also for the files in build-aux/. |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1425 buildaux_files=`for f in $all_files; do \ |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1426 case $f in \ |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1427 build-aux/*) echo $f ;; \ |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1428 esac; \ |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1429 done | sed -e 's,^build-aux/,,'` |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1430 if test -n "$buildaux_files"; then |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1431 sed_prepend_auxdir='s,^,$(top_srcdir)/'"$auxdir"'/,' |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1432 echo "EXTRA_DIST += "`echo "$buildaux_files" | sed -e "$sed_prepend_auxdir"` |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1433 echo |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
1434 fi |
9807
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1435 # Synthesize an EXTRA_DIST augmentation also for the files from top/. |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1436 top_files=`for f in $all_files; do \ |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1437 case $f in \ |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1438 top/*) echo $f ;; \ |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1439 esac; \ |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1440 done | sed -e 's,^top/,,'` |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1441 if test -n "$top_files"; then |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1442 sed_prepend_topdir='s,^,$(top_srcdir)/,' |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1443 echo "EXTRA_DIST += "`echo "$top_files" | sed -e "$sed_prepend_topdir"` |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1444 echo |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
1445 fi |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1446 ;; |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
1447 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1448 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1449 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1450 # func_get_include_directive module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1451 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1452 # - local_gnulib_dir from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1453 func_get_include_directive () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1454 { |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1455 func_lookup_file "modules/$1" |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1456 sed -n -e "/^Include$sed_extract_prog" < "$lookedup_file" | \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1457 sed -e 's/^\(["<]\)/#include \1/' |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1458 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1459 |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1460 # func_get_link_directive module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1461 # Input: |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1462 # - local_gnulib_dir from --local-dir |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1463 func_get_link_directive () |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1464 { |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1465 func_lookup_file "modules/$1" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1466 sed -n -e "/^Link$sed_extract_prog" < "$lookedup_file" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1467 } |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
1468 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1469 # func_get_license module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1470 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1471 # - local_gnulib_dir from --local-dir |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1472 func_get_license () |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1473 { |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
1474 func_lookup_file "modules/$1" |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
1475 { sed -n -e "/^License$sed_extract_prog" < "$lookedup_file" |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
1476 # The default is GPL. |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
1477 echo "GPL" |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
1478 } | sed -e 's,^ *$,,' | sed -e 1q |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1479 } |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1480 |
4197 | 1481 # func_get_maintainer module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1482 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1483 # - local_gnulib_dir from --local-dir |
4197 | 1484 func_get_maintainer () |
1485 { | |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1486 func_lookup_file "modules/$1" |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1487 sed -n -e "/^Maintainer$sed_extract_prog" < "$lookedup_file" |
4197 | 1488 } |
1489 | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1490 # func_get_tests_module module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1491 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1492 # - local_gnulib_dir from --local-dir |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1493 func_get_tests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1494 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1495 # The naming convention for tests modules is hardwired: ${module}-tests. |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1496 if test -f "$gnulib_dir/modules/$1"-tests \ |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1497 || { test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules" \ |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1498 && test -f "$local_gnulib_dir/modules/$1"-tests; }; then |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1499 echo "$1"-tests |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1500 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1501 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1502 |
5981 | 1503 # func_acceptable module |
1504 # tests whether a module is acceptable. | |
1505 # Input: | |
1506 # - avoidlist list of modules to avoid | |
1507 func_acceptable () | |
1508 { | |
1509 for avoid in $avoidlist; do | |
1510 if test "$avoid" = "$1"; then | |
1511 return 1 | |
1512 fi | |
1513 done | |
1514 return 0 | |
1515 } | |
1516 | |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
1517 # func_modules_transitive_closure |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
1518 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1519 # - local_gnulib_dir from --local-dir |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
1520 # - modules list of specified modules |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1521 # - inctests true if tests should be included, blank otherwise |
5981 | 1522 # - avoidlist list of modules to avoid |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1523 # - tmp pathname of a temporary directory |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
1524 # Output: |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
1525 # - 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
|
1526 func_modules_transitive_closure () |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1527 { |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1528 # In order to process every module only once (for speed), process an "input |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1529 # list" of modules, producing an "output list" of modules. During each round, |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1530 # more modules can be queued in the input list. Once a module on the input |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1531 # list has been processed, it is added to the "handled list", so we can avoid |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1532 # to process it again. |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1533 handledmodules= |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1534 inmodules="$modules" |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1535 outmodules= |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1536 while test -n "$inmodules"; do |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1537 inmodules_this_round="$inmodules" |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1538 inmodules= # Accumulator, queue for next round |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1539 for module in $inmodules_this_round; do |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1540 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1541 if test -n "$module"; then |
5981 | 1542 if func_acceptable $module; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
1543 func_append outmodules " $module" |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1544 deps=`func_get_dependencies $module` |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1545 # Duplicate dependencies are harmless, but Jim wants a warning. |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1546 duplicated_deps=`echo "$deps" | LC_ALL=C sort | LC_ALL=C uniq -d` |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1547 if test -n "$duplicated_deps"; then |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1548 echo "warning: module $module has duplicated dependencies: "`echo $duplicated_deps` 1>&2 |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1549 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
1550 func_append inmodules " $deps" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1551 if test -n "$inctests"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1552 testsmodule=`func_get_tests_module $module` |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1553 if test -n "$testsmodule"; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
1554 func_append inmodules " $testsmodule" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1555 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1556 fi |
5981 | 1557 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1558 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1559 done |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1560 handledmodules=`for m in $handledmodules $inmodules_this_round; do echo $m; done | LC_ALL=C sort -u` |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1561 # Remove $handledmodules from $inmodules. |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1562 for m in $inmodules; do echo $m; done | LC_ALL=C sort -u > "$tmp"/queued-modules |
10379
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
1563 inmodules=`func_reset_sigpipe; echo "$handledmodules" | LC_ALL=C join -v 2 - "$tmp"/queued-modules` |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1564 done |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1565 modules=`for m in $outmodules; do echo $m; done | LC_ALL=C sort -u` |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
1566 rm -f "$tmp"/queued-modules |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
1567 } |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
1568 |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1569 # func_modules_add_dummy |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1570 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1571 # - local_gnulib_dir from --local-dir |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1572 # - 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
|
1573 # Output: |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1574 # - 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
|
1575 func_modules_add_dummy () |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1576 { |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1577 have_lib_SOURCES= |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1578 sed_remove_backslash_newline=':a |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1579 /\\$/{ |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1580 s/\\$// |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1581 N |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1582 s/\n// |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1583 ba |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1584 }' |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1585 for module in $modules; do |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1586 func_verify_nontests_module |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1587 if test -n "$module"; then |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1588 # Extract the value of "lib_SOURCES += ...". |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1589 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
|
1590 # 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
|
1591 case "$file" in |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1592 *.h) ;; |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1593 *) have_lib_SOURCES=yes ;; |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1594 esac |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1595 done |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1596 fi |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1597 done |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1598 # 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
|
1599 if test -z "$have_lib_SOURCES"; then |
8668
9c0fa5819ce3
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8626
diff
changeset
|
1600 if func_acceptable "dummy"; then |
9c0fa5819ce3
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8626
diff
changeset
|
1601 func_append modules " dummy" |
9c0fa5819ce3
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8626
diff
changeset
|
1602 fi |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1603 fi |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1604 } |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
1605 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1606 # func_modules_notice |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1607 # Input: |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1608 # - local_gnulib_dir from --local-dir |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1609 # - verbose integer, default 0, inc/decremented by --verbose/--quiet |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1610 # - modules list of modules, including dependencies |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1611 func_modules_notice () |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1612 { |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1613 if test $verbose -ge -1; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1614 for module in $modules; do |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1615 func_verify_module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1616 if test -n "$module"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1617 msg=`func_get_notice $module` |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1618 if test -n "$msg"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1619 echo "Notice from module $module:" |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1620 echo "$msg" | sed -e 's/^/ /' |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1621 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1622 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1623 done |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1624 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1625 } |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1626 |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1627 # func_modules_to_filelist |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1628 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1629 # - local_gnulib_dir from --local-dir |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1630 # - 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
|
1631 # Output: |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1632 # - files list of files |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1633 func_modules_to_filelist () |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1634 { |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1635 files= |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1636 for module in $modules; do |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1637 func_verify_module |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1638 if test -n "$module"; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
1639 fs=`func_get_filelist $module` |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
1640 func_append files " $fs" |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1641 fi |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1642 done |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
1643 files=`for f in $files; do echo $f; done | LC_ALL=C sort -u` |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1644 } |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
1645 |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1646 # func_execute_command command [args...] |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1647 # Executes a command. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1648 # Uses also the variables |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1649 # - verbose integer, default 0, inc/decremented by --verbose/--quiet |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1650 func_execute_command () |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1651 { |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1652 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1653 echo "executing $*" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1654 "$@" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1655 else |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
1656 # Commands like automake produce output to stderr even when they succeed. |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1657 # Turn this output off if the command succeeds. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1658 "$@" > "$tmp"/cmdout 2>&1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1659 cmdret=$? |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1660 if test $cmdret = 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1661 rm -f "$tmp"/cmdout |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1662 else |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1663 echo "executing $*" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1664 cat "$tmp"/cmdout 1>&2 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1665 rm -f "$tmp"/cmdout |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1666 (exit $cmdret) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1667 fi |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1668 fi |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1669 } |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1670 |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1671 # func_emit_lib_Makefile_am |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
1672 # emits the contents of library makefile to standard output. |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1673 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1674 # - local_gnulib_dir from --local-dir |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1675 # - 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
|
1676 # - libname library name |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1677 # - pobase directory relative to destdir where to place *.po files |
7644
3c0ece164bab
Replace build-aux/ also in the Makefile snippet.
Bruno Haible <bruno@clisp.org>
parents:
7643
diff
changeset
|
1678 # - auxdir directory relative to destdir where to place build aux files |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1679 # - makefile_name from --makefile-name |
7077 | 1680 # - libtool true if libtool will be used, false or blank otherwise |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
1681 # - macro_prefix prefix of gl_LIBOBJS macros to use |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1682 # - po_domain prefix of i18n domain to use (without -gnulib suffix) |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1683 # - actioncmd (optional) command that will reproduce this invocation |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1684 # - for_test true if creating a package for testing, false otherwise |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1685 # - destfile filename relative to destdir of makefile being generated |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1686 # Input/Output: |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1687 # - makefile_am_edits and makefile_am_edit${edit}_{dir,var,val} |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1688 # list of edits to be done to Makefile.am variables |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1689 # Output: |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1690 # - uses_subdirs nonempty if object files in subdirs exist |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1691 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
|
1692 { |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1693 # When creating an includable Makefile.am snippet, augment variables with |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1694 # += instead of assigning them. |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1695 if test -n "$makefile_name"; then |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1696 assign='+=' |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1697 else |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1698 assign='=' |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1699 fi |
7077 | 1700 if test "$libtool" = true; then |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1701 libext=la |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1702 perhapsLT=LT |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
1703 sed_eliminate_LDFLAGS="$sed_noop" |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1704 else |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1705 libext=a |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1706 perhapsLT= |
7335 | 1707 sed_eliminate_LDFLAGS='/^lib_LDFLAGS[ ]*+=/d' |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1708 fi |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1709 if $for_test; then |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1710 # When creating a package for testing: Attempt to provoke failures, |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1711 # especially link errors, already during "make" rather than during |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1712 # "make check", because "make check" is not possible in a cross-compiling |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1713 # situation. Turn check_PROGRAMS into noinst_PROGRAMS. |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1714 sed_transform_check_PROGRAMS='s,check_PROGRAMS,noinst_PROGRAMS,g' |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1715 else |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
1716 sed_transform_check_PROGRAMS="$sed_noop" |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1717 fi |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
7391
diff
changeset
|
1718 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1719 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
|
1720 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
|
1721 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
|
1722 echo "# Reproduce by: $actioncmd" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1723 fi |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1724 echo |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1725 uses_subdirs= |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1726 { |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1727 for module in $modules; do |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1728 func_verify_nontests_module |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1729 if test -n "$module"; then |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1730 { |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1731 func_get_automake_snippet "$module" | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1732 sed -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \ |
9005
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1733 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \ |
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1734 -e "$sed_eliminate_LDFLAGS" \ |
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1735 -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \ |
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1736 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \ |
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1737 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \ |
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1738 -e "$sed_transform_check_PROGRAMS" |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1739 if test "$module" = 'alloca'; then |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1740 echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
1741 echo "${libname}_${libext}_DEPENDENCIES += @${perhapsLT}ALLOCA@" |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1742 fi |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1743 } > amsnippet.tmp |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
1744 # Skip the contents if it's entirely empty. |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1745 if grep '[^ ]' amsnippet.tmp > /dev/null ; then |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1746 echo "## begin gnulib module $module" |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1747 echo |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1748 cat amsnippet.tmp |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1749 echo "## end gnulib module $module" |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1750 echo |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1751 fi |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1752 rm -f amsnippet.tmp |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1753 # Test whether there are some source files in subdirectories. |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1754 for f in `func_get_filelist "$module"`; do |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1755 case $f in |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1756 lib/*/*.c) uses_subdirs=yes ;; |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1757 esac |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1758 done |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1759 fi |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1760 done |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1761 } > allsnippets.tmp |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1762 if test -z "$makefile_name"; then |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1763 # If there are source files in subdirectories, prevent collision of the |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1764 # object files (example: hash.c and libxml/hash.c). |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1765 subdir_options= |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1766 if test -n "$uses_subdirs"; then |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1767 subdir_options=' subdir-objects' |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1768 fi |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1769 echo "AUTOMAKE_OPTIONS = 1.5 gnits${subdir_options}" |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1770 fi |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
1771 echo |
7246
4a748ab30907
* gnulib-tool (func_emit_lib_Makefile_am): Fix typos in
Paul Eggert <eggert@cs.ucla.edu>
parents:
7245
diff
changeset
|
1772 if test -z "$makefile_name"; then |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1773 echo "SUBDIRS =" |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1774 echo "noinst_HEADERS =" |
7701
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1775 echo "noinst_LIBRARIES =" |
7691
33b654c2cba8
Initialize also noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7660
diff
changeset
|
1776 echo "noinst_LTLIBRARIES =" |
7270
3d4ebfd658b2
A comment about automake-1.9b.
Bruno Haible <bruno@clisp.org>
parents:
7264
diff
changeset
|
1777 # Automake versions < 1.9b create an empty pkgdatadir at installation time |
3d4ebfd658b2
A comment about automake-1.9b.
Bruno Haible <bruno@clisp.org>
parents:
7264
diff
changeset
|
1778 # if you specify pkgdata_DATA to empty. This is a workaround. |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1779 if grep '^pkgdata_DATA *+=' allsnippets.tmp > /dev/null; then |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1780 echo "pkgdata_DATA =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1781 fi |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1782 echo "EXTRA_DIST =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1783 echo "BUILT_SOURCES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1784 echo "SUFFIXES =" |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1785 fi |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1786 echo "MOSTLYCLEANFILES $assign core *.stackdump" |
7246
4a748ab30907
* gnulib-tool (func_emit_lib_Makefile_am): Fix typos in
Paul Eggert <eggert@cs.ucla.edu>
parents:
7245
diff
changeset
|
1787 if test -z "$makefile_name"; then |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1788 echo "MOSTLYCLEANDIRS =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1789 echo "CLEANFILES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1790 echo "DISTCLEANFILES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1791 echo "MAINTAINERCLEANFILES =" |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1792 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1793 # Execute edits that apply to the Makefile.am being generated. |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1794 edit=0 |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1795 while test $edit != $makefile_am_edits; do |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1796 edit=`expr $edit + 1` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1797 eval dir=\"\$makefile_am_edit${edit}_dir\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1798 eval var=\"\$makefile_am_edit${edit}_var\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1799 eval val=\"\$makefile_am_edit${edit}_val\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1800 if test -n "$var"; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1801 if test "${dir}Makefile.am" = "$destfile" || test "./${dir}Makefile.am" = "$destfile"; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1802 echo "${var} += ${val}" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1803 eval "makefile_am_edit${edit}_var=" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1804 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1805 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1806 done |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1807 if test -z "$makefile_name"; then |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1808 echo |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1809 echo "AM_CPPFLAGS =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
1810 fi |
6750
608add4e5b80
Support for packages that use "gettextize --intl". From Claudio Fontana.
Bruno Haible <bruno@clisp.org>
parents:
6745
diff
changeset
|
1811 echo |
10255
a945eb5a83fe
Recognize 'foo_LIBRARIES += libgnu.a'.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10252
diff
changeset
|
1812 if LC_ALL=C grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *+\{0,1\}= *$libname\\.$libext\$" allsnippets.tmp > /dev/null; then |
7701
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1813 # One of the snippets already specifies an installation location for the |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1814 # library. Don't confuse automake by saying it should not be installed. |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1815 : |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1816 else |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1817 # By default, the generated library should not be installed. |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1818 echo "noinst_${perhapsLT}LIBRARIES += $libname.$libext" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1819 fi |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1820 echo |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1821 echo "${libname}_${libext}_SOURCES =" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1822 # Here we use $(LIBOBJS), not @LIBOBJS@. The value is the same. However, |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
1823 # automake during its analysis looks for $(LIBOBJS), not for @LIBOBJS@. |
7701
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1824 echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1825 echo "${libname}_${libext}_DEPENDENCIES = \$(${macro_prefix}_${perhapsLT}LIBOBJS)" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1826 echo "EXTRA_${libname}_${libext}_SOURCES =" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1827 if test "$libtool" = true; then |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1828 echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1829 fi |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
1830 echo |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1831 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1832 echo "AM_CPPFLAGS += -DDEFAULT_TEXT_DOMAIN=\\\"${po_domain}-gnulib\\\"" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1833 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1834 fi |
7644
3c0ece164bab
Replace build-aux/ also in the Makefile snippet.
Bruno Haible <bruno@clisp.org>
parents:
7643
diff
changeset
|
1835 cat allsnippets.tmp \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1836 | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g' |
5357
8bce169f70cc
Fix comments. Fix parse problem.
Simon Josefsson <simon@josefsson.org>
parents:
5356
diff
changeset
|
1837 echo |
7086 | 1838 echo "mostlyclean-local: mostlyclean-generic" |
7545
fade8d6feee3
Avoid syntax error from bash 2.00 ... 2.05.
Bruno Haible <bruno@clisp.org>
parents:
7533
diff
changeset
|
1839 echo " @for dir in '' \$(MOSTLYCLEANDIRS); do \\" |
fade8d6feee3
Avoid syntax error from bash 2.00 ... 2.05.
Bruno Haible <bruno@clisp.org>
parents:
7533
diff
changeset
|
1840 echo " if test -n \"\$\$dir\" && test -d \$\$dir; then \\" |
fade8d6feee3
Avoid syntax error from bash 2.00 ... 2.05.
Bruno Haible <bruno@clisp.org>
parents:
7533
diff
changeset
|
1841 echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\" |
fade8d6feee3
Avoid syntax error from bash 2.00 ... 2.05.
Bruno Haible <bruno@clisp.org>
parents:
7533
diff
changeset
|
1842 echo " fi; \\" |
9010
03602a916a9a
Don't let the 'mostlyclean' target fail because of a nonempty directory.
Bruno Haible <bruno@clisp.org>
parents:
9009
diff
changeset
|
1843 echo " done; \\" |
03602a916a9a
Don't let the 'mostlyclean' target fail because of a nonempty directory.
Bruno Haible <bruno@clisp.org>
parents:
9009
diff
changeset
|
1844 echo " :" |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1845 rm -f allsnippets.tmp |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1846 } |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
1847 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1848 # func_emit_po_Makevars |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
1849 # emits the contents of po/ makefile parameterization to standard output. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1850 # Input: |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1851 # - local_gnulib_dir from --local-dir |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1852 # - sourcebase directory relative to destdir where to place source code |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1853 # - pobase directory relative to destdir where to place *.po files |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1854 # - po_domain prefix of i18n domain to use (without -gnulib suffix) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1855 func_emit_po_Makevars () |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1856 { |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1857 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1858 func_emit_copyright_notice |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1859 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1860 echo "# Usually the message domain is the same as the package name." |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1861 echo "# But here it has a '-gnulib' suffix." |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1862 echo "DOMAIN = ${po_domain}-gnulib" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1863 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1864 echo "# These two variables depend on the location of this directory." |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1865 echo "subdir = ${pobase}" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1866 echo "top_builddir = "`echo "$pobase" | sed -e 's,//*,/,g' -e 's,[^/][^/]*,..,g'` |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1867 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1868 cat <<\EOF |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1869 # These options get passed to xgettext. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1870 XGETTEXT_OPTIONS = \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1871 --keyword=_ --flag=_:1:pass-c-format \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1872 --keyword=N_ --flag=N_:1:pass-c-format \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1873 --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."' \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1874 --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."' \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1875 --flag=error:3:c-format --flag=error_at_line:5:c-format |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1876 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1877 # This is the copyright holder that gets inserted into the header of the |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1878 # $(DOMAIN).pot file. gnulib is copyrighted by the FSF. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1879 COPYRIGHT_HOLDER = Free Software Foundation, Inc. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1880 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1881 # This is the email address or URL to which the translators shall report |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1882 # bugs in the untranslated strings: |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1883 # - Strings which are not entire sentences, see the maintainer guidelines |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1884 # in the GNU gettext documentation, section 'Preparing Strings'. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1885 # - Strings which use unclear terms or require additional context to be |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1886 # understood. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1887 # - Strings which make invalid assumptions about notation of date, time or |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1888 # money. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1889 # - Pluralisation problems. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1890 # - Incorrect English spelling. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1891 # - Incorrect formatting. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1892 # It can be your email address, or a mailing list address where translators |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1893 # can write to without being subscribed, or the URL of a web page through |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1894 # which the translators can contact you. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1895 MSGID_BUGS_ADDRESS = bug-gnulib@gnu.org |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1896 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1897 # This is the list of locale categories, beyond LC_MESSAGES, for which the |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1898 # message catalogs shall be used. It is usually empty. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1899 EXTRA_LOCALE_CATEGORIES = |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1900 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1901 # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1902 # context. Possible values are "yes" and "no". Set this to yes if the |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1903 # package uses functions taking also a message context, like pgettext(), or |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1904 # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1905 USE_MSGCTXT = no |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1906 EOF |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1907 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1908 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1909 # func_emit_po_POTFILES_in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1910 # emits the file list to be passed to xgettext to standard output. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1911 # Input: |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1912 # - local_gnulib_dir from --local-dir |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1913 # - sourcebase directory relative to destdir where to place source code |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1914 # - files list of new files |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1915 func_emit_po_POTFILES_in () |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1916 { |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1917 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1918 func_emit_copyright_notice |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1919 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1920 echo "# List of files which contain translatable strings." |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1921 echo "$files" | sed -n -e "s,^lib/,$sourcebase/,p" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1922 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1923 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1924 # func_emit_tests_Makefile_am |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
1925 # emits the contents of tests makefile to standard output. |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1926 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1927 # - local_gnulib_dir from --local-dir |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1928 # - modules list of modules, including dependencies |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1929 # - libname library name |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1930 # - auxdir directory relative to destdir where to place build aux files |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1931 # - makefile_name from --makefile-name |
7077 | 1932 # - libtool true if libtool will be used, false or blank otherwise |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1933 # - sourcebase relative directory containing lib source code |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
1934 # - m4base relative directory containing autoconf macros |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
1935 # - testsbase relative directory containing unit test code |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1936 # - macro_prefix prefix of gl_LIBOBJS macros to use |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1937 # - for_test true if creating a package for testing, false otherwise |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1938 # - use_libtests true if a libtests.a should be built, false otherwise |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1939 # - destfile filename relative to destdir of makefile being generated |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1940 # Input/Output: |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1941 # - makefile_am_edits and makefile_am_edit${edit}_{dir,var,val} |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
1942 # list of edits to be done to Makefile.am variables |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1943 # Output: |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1944 # - uses_subdirs nonempty if object files in subdirs exist |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1945 func_emit_tests_Makefile_am () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1946 { |
7077 | 1947 if test "$libtool" = true; then |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1948 libext=la |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
1949 sed_eliminate_LDFLAGS="$sed_noop" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
1950 else |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
1951 libext=a |
7335 | 1952 sed_eliminate_LDFLAGS='/^lib_LDFLAGS[ ]*+=/d' |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
1953 fi |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1954 if $for_test; then |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1955 # When creating a package for testing: Attempt to provoke failures, |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1956 # especially link errors, already during "make" rather than during |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1957 # "make check", because "make check" is not possible in a cross-compiling |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1958 # situation. Turn check_PROGRAMS into noinst_PROGRAMS. |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1959 sed_transform_check_PROGRAMS='s,check_PROGRAMS,noinst_PROGRAMS,g' |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1960 else |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
1961 sed_transform_check_PROGRAMS="$sed_noop" |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
1962 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1963 testsbase_inverse=`echo "$testsbase" | sed -e 's,/$,,' | sed -e 's,[^/][^/]*,..,g'` |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
7391
diff
changeset
|
1964 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1965 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
|
1966 func_emit_copyright_notice |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1967 echo |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1968 uses_subdirs= |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1969 ( |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1970 for module in $modules; do |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1971 if $for_test; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1972 func_verify_tests_module |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1973 else |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1974 func_verify_module |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1975 fi |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1976 if test -n "$module"; then |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
1977 { |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
1978 func_get_automake_snippet "$module" | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1979 sed -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \ |
9005
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1980 -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \ |
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1981 -e "$sed_eliminate_LDFLAGS" \ |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1982 -e 's,lib_\([A-Z][A-Z]*\),libtests_a_\1,g' \ |
9005
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1983 -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \ |
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1984 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \ |
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
1985 -e "$sed_transform_check_PROGRAMS" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1986 if $use_libtests && test "$module" = 'alloca'; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1987 echo "libtests_a_LIBADD += @${perhapsLT}ALLOCA@" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1988 echo "libtests_a_DEPENDENCIES += @${perhapsLT}ALLOCA@" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
1989 fi |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
1990 } > amsnippet.tmp |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
1991 # Skip the contents if it's entirely empty. |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1992 if grep '[^ ]' amsnippet.tmp > /dev/null ; then |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1993 echo "## begin gnulib module $module" |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1994 echo |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1995 cat amsnippet.tmp |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1996 echo "## end gnulib module $module" |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1997 echo |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1998 fi |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
1999 rm -f amsnippet.tmp |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2000 # Test whether there are some source files in subdirectories. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2001 for f in `func_get_filelist "$module"`; do |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2002 case $f in |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2003 lib/*/*.c | tests/*/*.c) uses_subdirs=yes ;; |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2004 esac |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2005 done |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
2006 fi |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
2007 done |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
2008 ) > allsnippets.tmp |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2009 # Generate dependencies here, since it eases the debugging of test failures. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2010 # If there are source files in subdirectories, prevent collision of the |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2011 # object files (example: hash.c and libxml/hash.c). |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2012 subdir_options= |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2013 if test -n "$uses_subdirs"; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2014 subdir_options=' subdir-objects' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2015 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2016 echo "AUTOMAKE_OPTIONS = 1.5 foreign${subdir_options}" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2017 echo |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2018 if $for_test; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2019 echo "ACLOCAL_AMFLAGS = -I ${testsbase_inverse}/${m4base}" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2020 echo |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2021 fi |
6533
6bc4290ca85f
Avoid an automake error regarding the 'gettext' module.
Bruno Haible <bruno@clisp.org>
parents:
6512
diff
changeset
|
2022 # 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
|
2023 # 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
|
2024 # "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
|
2025 echo "SUBDIRS =" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2026 echo "TESTS =" |
10732
a97c57b9b48e
argp: Use standard gnulib idiom for EXEEXT.
Simon Josefsson <simon@josefsson.org>
parents:
10729
diff
changeset
|
2027 echo "TESTS_ENVIRONMENT =" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2028 echo "noinst_PROGRAMS =" |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
2029 if ! $for_test; then |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
2030 echo "check_PROGRAMS =" |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
2031 fi |
6548
060487c0b13c
Initialize also noinst_HEADERS to empty.
Bruno Haible <bruno@clisp.org>
parents:
6547
diff
changeset
|
2032 echo "noinst_HEADERS =" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2033 echo "noinst_LIBRARIES =" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2034 if $use_libtests; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2035 if $for_test; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2036 echo "noinst_LIBRARIES += libtests.a" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2037 else |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2038 echo "check_LIBRARIES = libtests.a" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2039 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2040 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2041 # Automake versions < 1.9b create an empty pkgdatadir at installation time |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2042 # if you specify pkgdata_DATA to empty. This is a workaround. |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
2043 if grep '^pkgdata_DATA *+=' allsnippets.tmp > /dev/null; then |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
2044 echo "pkgdata_DATA =" |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
2045 fi |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2046 echo "EXTRA_DIST =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2047 echo "BUILT_SOURCES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2048 echo "SUFFIXES =" |
7079 | 2049 echo "MOSTLYCLEANFILES = core *.stackdump" |
6862 | 2050 echo "MOSTLYCLEANDIRS =" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2051 echo "CLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2052 echo "DISTCLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2053 echo "MAINTAINERCLEANFILES =" |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2054 # Execute edits that apply to the Makefile.am being generated. |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2055 edit=0 |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2056 while test $edit != $makefile_am_edits; do |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2057 edit=`expr $edit + 1` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2058 eval dir=\"\$makefile_am_edit${edit}_dir\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2059 eval var=\"\$makefile_am_edit${edit}_var\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2060 eval val=\"\$makefile_am_edit${edit}_val\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2061 if test -n "$var"; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2062 if test "${dir}Makefile.am" = "$destfile" || test "./${dir}Makefile.am" = "$destfile"; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2063 echo "${var} += ${val}" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2064 eval "makefile_am_edit${edit}_var=" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2065 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2066 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2067 done |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2068 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2069 echo "AM_CPPFLAGS = \\" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2070 echo " -I. -I\$(srcdir) \\" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2071 echo " -I${testsbase_inverse} -I\$(srcdir)/${testsbase_inverse} \\" |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2072 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
|
2073 echo |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2074 local_ldadd_before='' |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2075 local_ldadd_after='' |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2076 if $use_libtests; then |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2077 # All test programs need to be linked with libtests.a. |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2078 # It needs to be passed to the linker before ${libname}.${libext}, since |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2079 # the tests-related modules depend on the main modules. |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2080 # It also needs to be passed to the linker after ${libname}.${libext} |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2081 # because the latter might contain incomplete modules (such as the 'error' |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2082 # module whose dependency to 'progname' is voluntarily omitted). |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2083 # The LIBTESTS_LIBDEPS can be passed to the linker once or twice, it does |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2084 # not matter. |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2085 local_ldadd_before=' libtests.a' |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2086 local_ldadd_after=' libtests.a $(LIBTESTS_LIBDEPS)' |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2087 fi |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
2088 echo "LDADD =${local_ldadd_before} ${testsbase_inverse}/${sourcebase-lib}/${libname}.${libext}${local_ldadd_after}" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2089 echo |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2090 if $use_libtests; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2091 echo "libtests_a_SOURCES =" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2092 # Here we use $(LIBOBJS), not @LIBOBJS@. The value is the same. However, |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
2093 # automake during its analysis looks for $(LIBOBJS), not for @LIBOBJS@. |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2094 echo "libtests_a_LIBADD = \$(${macro_prefix}tests_LIBOBJS)" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2095 echo "libtests_a_DEPENDENCIES = \$(${macro_prefix}tests_LIBOBJS)" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2096 echo "EXTRA_libtests_a_SOURCES =" |
9523
49f7561fc2d3
Allow circular dependency of separate libtests.a
Eric Blake <ebb9@byu.net>
parents:
9520
diff
changeset
|
2097 # The circular dependency in LDADD requires this. |
49f7561fc2d3
Allow circular dependency of separate libtests.a
Eric Blake <ebb9@byu.net>
parents:
9520
diff
changeset
|
2098 echo "AM_LIBTOOLFLAGS = --preserve-dup-deps" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2099 echo |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2100 fi |
9515
b0f1495adfd8
Fix references to the build-aux directory in the generated tests/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
9514
diff
changeset
|
2101 cat allsnippets.tmp \ |
b0f1495adfd8
Fix references to the build-aux directory in the generated tests/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
9514
diff
changeset
|
2102 | sed -e 's|\$(top_srcdir)/build-aux/|$(top_srcdir)/'"$auxdir"'/|g' |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2103 echo "# Clean up after Solaris cc." |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2104 echo "clean-local:" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2105 echo " rm -rf SunWS_cache" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2106 echo |
7086 | 2107 echo "mostlyclean-local: mostlyclean-generic" |
7545
fade8d6feee3
Avoid syntax error from bash 2.00 ... 2.05.
Bruno Haible <bruno@clisp.org>
parents:
7533
diff
changeset
|
2108 echo " @for dir in '' \$(MOSTLYCLEANDIRS); do \\" |
fade8d6feee3
Avoid syntax error from bash 2.00 ... 2.05.
Bruno Haible <bruno@clisp.org>
parents:
7533
diff
changeset
|
2109 echo " if test -n \"\$\$dir\" && test -d \$\$dir; then \\" |
fade8d6feee3
Avoid syntax error from bash 2.00 ... 2.05.
Bruno Haible <bruno@clisp.org>
parents:
7533
diff
changeset
|
2110 echo " echo \"rmdir \$\$dir\"; rmdir \$\$dir; \\" |
fade8d6feee3
Avoid syntax error from bash 2.00 ... 2.05.
Bruno Haible <bruno@clisp.org>
parents:
7533
diff
changeset
|
2111 echo " fi; \\" |
9010
03602a916a9a
Don't let the 'mostlyclean' target fail because of a nonempty directory.
Bruno Haible <bruno@clisp.org>
parents:
9009
diff
changeset
|
2112 echo " done; \\" |
03602a916a9a
Don't let the 'mostlyclean' target fail because of a nonempty directory.
Bruno Haible <bruno@clisp.org>
parents:
9009
diff
changeset
|
2113 echo " :" |
7169
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
2114 rm -f allsnippets.tmp |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2115 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2116 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2117 # func_emit_initmacro_start macro_prefix |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2118 # emits the first few statements of the gl_INIT macro to standard output. |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2119 # - macro_prefix prefix of gl_EARLY, gl_INIT macros to use |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2120 func_emit_initmacro_start () |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2121 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2122 macro_prefix_arg="$1" |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2123 # Overriding AC_LIBOBJ and AC_REPLACE_FUNCS has the effect of storing |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2124 # platform-dependent object files in ${macro_prefix_arg}_LIBOBJS instead of |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2125 # LIBOBJS. The purpose is to allow several gnulib instantiations under |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2126 # a single configure.ac file. (AC_CONFIG_LIBOBJ_DIR does not allow this |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2127 # flexibility.) |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2128 # Furthermore it avoids an automake error like this when a Makefile.am |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2129 # that uses pieces of gnulib also uses $(LIBOBJ): |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2130 # automatically discovered file `error.c' should not be explicitly mentioned |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2131 echo " m4_pushdef([AC_LIBOBJ], m4_defn([${macro_prefix_arg}_LIBOBJ]))" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2132 echo " m4_pushdef([AC_REPLACE_FUNCS], m4_defn([${macro_prefix_arg}_REPLACE_FUNCS]))" |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2133 # Overriding AC_LIBSOURCES has the same purpose of avoiding the automake |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2134 # error when a Makefile.am that uses pieces of gnulib also uses $(LIBOBJ): |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2135 # automatically discovered file `error.c' should not be explicitly mentioned |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2136 # We let automake know about the files to be distributed through the |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2137 # EXTRA_lib_SOURCES variable. |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2138 echo " m4_pushdef([AC_LIBSOURCES], m4_defn([${macro_prefix_arg}_LIBSOURCES]))" |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2139 # Create data variables for checking the presence of files that are mentioned |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2140 # as AC_LIBSOURCES arguments. These are m4 variables, not shell variables, |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2141 # because we want the check to happen when the configure file is created, |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2142 # not when it is run. ${macro_prefix_arg}_LIBSOURCES_LIST is the list of |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2143 # files to check for. ${macro_prefix_arg}_LIBSOURCES_DIR is the subdirectory |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2144 # in which to expect them. |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2145 echo " m4_pushdef([${macro_prefix_arg}_LIBSOURCES_LIST], [])" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2146 echo " m4_pushdef([${macro_prefix_arg}_LIBSOURCES_DIR], [])" |
9887
f2408973947f
Fix __GNUC_STDC_INLINE__ predefine with Apple GCC on MacOS X 10.5.
Bruno Haible <bruno@clisp.org>
parents:
9879
diff
changeset
|
2147 echo " gl_COMMON" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2148 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2149 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2150 # func_emit_initmacro_end macro_prefix |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2151 # emits the last few statements of the gl_INIT macro to standard output. |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2152 # - macro_prefix prefix of gl_EARLY, gl_INIT macros to use |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2153 func_emit_initmacro_end () |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2154 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2155 macro_prefix_arg="$1" |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2156 # Check the presence of files that are mentioned as AC_LIBSOURCES arguments. |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2157 # The check is performed only when autoconf is run from the directory where |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2158 # the configure.ac resides; if it is run from a different directory, the |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2159 # check is skipped. |
10067
40a8c0b4f5e0
Oops, fix small mistake in last commit.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
2160 echo " m4_ifval(${macro_prefix_arg}_LIBSOURCES_LIST, [" |
10261 | 2161 echo " m4_syscmd([test ! -d ]m4_defn([${macro_prefix_arg}_LIBSOURCES_DIR])[ ||" |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2162 echo " for gl_file in ]${macro_prefix_arg}_LIBSOURCES_LIST[ ; do" |
10261 | 2163 echo " if test ! -r ]m4_defn([${macro_prefix_arg}_LIBSOURCES_DIR])[/\$gl_file ; then" |
2164 echo " echo \"missing file ]m4_defn([${macro_prefix_arg}_LIBSOURCES_DIR])[/\$gl_file\" >&2" | |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2165 echo " exit 1" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2166 echo " fi" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2167 echo " done])dnl" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2168 echo " m4_if(m4_sysval, [0], []," |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2169 echo " [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2170 echo " ])" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2171 echo " m4_popdef([${macro_prefix_arg}_LIBSOURCES_DIR])" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2172 echo " m4_popdef([${macro_prefix_arg}_LIBSOURCES_LIST])" |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2173 echo " m4_popdef([AC_LIBSOURCES])" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2174 echo " m4_popdef([AC_REPLACE_FUNCS])" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2175 echo " m4_popdef([AC_LIBOBJ])" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2176 echo " AC_CONFIG_COMMANDS_PRE([" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2177 echo " ${macro_prefix_arg}_libobjs=" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2178 echo " ${macro_prefix_arg}_ltlibobjs=" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2179 echo " if test -n \"\$${macro_prefix_arg}_LIBOBJS\"; then" |
7528
472795eea368
Remove duplicates from the gl_LIBOBJS list.
Bruno Haible <bruno@clisp.org>
parents:
7497
diff
changeset
|
2180 echo " # Remove the extension." |
472795eea368
Remove duplicates from the gl_LIBOBJS list.
Bruno Haible <bruno@clisp.org>
parents:
7497
diff
changeset
|
2181 echo " sed_drop_objext='s/\\.o\$//;s/\\.obj\$//'" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2182 echo " for i in \`for i in \$${macro_prefix_arg}_LIBOBJS; do echo \"\$i\"; done | sed \"\$sed_drop_objext\" | sort | uniq\`; do" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2183 echo " ${macro_prefix_arg}_libobjs=\"\$${macro_prefix_arg}_libobjs \$i.\$ac_objext\"" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2184 echo " ${macro_prefix_arg}_ltlibobjs=\"\$${macro_prefix_arg}_ltlibobjs \$i.lo\"" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2185 echo " done" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2186 echo " fi" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2187 echo " AC_SUBST([${macro_prefix_arg}_LIBOBJS], [\$${macro_prefix_arg}_libobjs])" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2188 echo " AC_SUBST([${macro_prefix_arg}_LTLIBOBJS], [\$${macro_prefix_arg}_ltlibobjs])" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2189 echo " ])" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2190 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2191 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2192 # func_emit_initmacro_done macro_prefix sourcebase |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2193 # emits a few statements after the gl_INIT macro to standard output. |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2194 # - macro_prefix prefix of gl_EARLY, gl_INIT macros to use |
9232
01d4e199e19f
Enforce that AC_REPLACE_FUNCS files exist.
Eric Blake <ebb9@byu.net>
parents:
9215
diff
changeset
|
2195 # - sourcebase directory relative to destdir where to place source code |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2196 func_emit_initmacro_done () |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2197 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2198 macro_prefix_arg="$1" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2199 sourcebase_arg="$2" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2200 echo |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2201 echo "# Like AC_LIBOBJ, except that the module name goes" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2202 echo "# into ${macro_prefix_arg}_LIBOBJS instead of into LIBOBJS." |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2203 echo "AC_DEFUN([${macro_prefix_arg}_LIBOBJ], [" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2204 echo " AS_LITERAL_IF([\$1], [${macro_prefix_arg}_LIBSOURCES([\$1.c])])dnl" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2205 echo " ${macro_prefix_arg}_LIBOBJS=\"\$${macro_prefix_arg}_LIBOBJS \$1.\$ac_objext\"" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
2206 echo "])" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2207 echo |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2208 echo "# Like AC_REPLACE_FUNCS, except that the module name goes" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2209 echo "# into ${macro_prefix_arg}_LIBOBJS instead of into LIBOBJS." |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2210 echo "AC_DEFUN([${macro_prefix_arg}_REPLACE_FUNCS], [" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
2211 echo " m4_foreach_w([gl_NAME], [\$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2212 echo " AC_CHECK_FUNCS([\$1], , [${macro_prefix_arg}_LIBOBJ(\$ac_func)])" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
2213 echo "])" |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
2214 echo |
9275
1c749136a76e
AC_LIBSOURCES([alloca.c]) must be a no-op, otherwise it breaks the 'alloca-opt'
Bruno Haible <bruno@clisp.org>
parents:
9237
diff
changeset
|
2215 echo "# Like AC_LIBSOURCES, except the directory where the source file is" |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
2216 echo "# expected is derived from the gnulib-tool parameterization," |
9275
1c749136a76e
AC_LIBSOURCES([alloca.c]) must be a no-op, otherwise it breaks the 'alloca-opt'
Bruno Haible <bruno@clisp.org>
parents:
9237
diff
changeset
|
2217 echo "# and alloca is special cased (for the alloca-opt module)." |
1c749136a76e
AC_LIBSOURCES([alloca.c]) must be a no-op, otherwise it breaks the 'alloca-opt'
Bruno Haible <bruno@clisp.org>
parents:
9237
diff
changeset
|
2218 echo "# We could also entirely rely on EXTRA_lib..._SOURCES." |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2219 echo "AC_DEFUN([${macro_prefix_arg}_LIBSOURCES], [" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
2220 echo " m4_foreach([_gl_NAME], [\$1], [" |
9275
1c749136a76e
AC_LIBSOURCES([alloca.c]) must be a no-op, otherwise it breaks the 'alloca-opt'
Bruno Haible <bruno@clisp.org>
parents:
9237
diff
changeset
|
2221 echo " m4_if(_gl_NAME, [alloca.c], [], [" |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
2222 echo " m4_define([${macro_prefix_arg}_LIBSOURCES_DIR], [$sourcebase_arg])" |
10070
61be13abdf14
Avoid quadratic growth in gl_LIBSOURCES.
Eric Blake <ebb9@byu.net>
parents:
10067
diff
changeset
|
2223 echo " m4_append([${macro_prefix_arg}_LIBSOURCES_LIST], _gl_NAME, [ ])" |
9275
1c749136a76e
AC_LIBSOURCES([alloca.c]) must be a no-op, otherwise it breaks the 'alloca-opt'
Bruno Haible <bruno@clisp.org>
parents:
9237
diff
changeset
|
2224 echo " ])" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
2225 echo " ])" |
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
2226 echo "])" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2227 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
2228 |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2229 # func_import modules |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2230 # Uses also the variables |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2231 # - destdir target directory |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2232 # - local_gnulib_dir from --local-dir |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2233 # - verbose integer, default 0, inc/decremented by --verbose/--quiet |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2234 # - libname library name |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2235 # - 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
|
2236 # - m4base directory relative to destdir where to place *.m4 macros |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2237 # - pobase directory relative to destdir where to place *.po files |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2238 # - 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
|
2239 # - 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
|
2240 # - 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
|
2241 # - inctests true if --with-tests was given, blank otherwise |
5981 | 2242 # - avoidlist list of modules to avoid, from --avoid |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2243 # - lgpl yes or a number if library's license shall be LGPL, |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2244 # blank otherwise |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2245 # - makefile_name from --makefile-name |
7077 | 2246 # - libtool true if --libtool was given, false if --no-libtool was |
2247 # given, blank otherwise | |
2248 # - guessed_libtool true if the configure.ac file uses libtool, false otherwise | |
6176 | 2249 # - macro_prefix prefix of gl_EARLY, gl_INIT macros to use |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2250 # - po_domain prefix of i18n domain to use (without -gnulib suffix) |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2251 # - vc_files true if --vc-files was given, false if --no-vc-files was |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2252 # given, blank otherwise |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
2253 # - autoconf_minversion minimum supported autoconf version |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2254 # - 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
|
2255 # - symbolic true if files should be symlinked, copied otherwise |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2256 # - lsymbolic true if files from local_gnulib_dir should be symlinked, |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2257 # copied otherwise |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
2258 # - do_copyrights true if copyright notices in files should be replaced, |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
2259 # blank otherwise |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2260 func_import () |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2261 { |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2262 # Get the cached settings. |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2263 cached_local_gnulib_dir= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2264 cached_specified_modules= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2265 cached_avoidlist= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2266 cached_sourcebase= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2267 cached_m4base= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2268 cached_pobase= |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2269 cached_docbase= |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2270 cached_testsbase= |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2271 cached_inctests= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2272 cached_libname= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2273 cached_lgpl= |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2274 cached_makefile_name= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2275 cached_libtool= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2276 cached_macro_prefix= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2277 cached_po_domain= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2278 cached_vc_files= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2279 cached_files= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2280 if test -f "$destdir"/$m4base/gnulib-cache.m4; then |
7077 | 2281 cached_libtool=false |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2282 my_sed_traces=' |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2283 s,#.*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2284 s,^dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2285 s, dnl .*$,, |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2286 /gl_LOCAL_DIR(/ { |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2287 s,^.*gl_LOCAL_DIR([[ ]*\([^])]*\).*$,cached_local_gnulib_dir="\1",p |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2288 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2289 /gl_MODULES(/ { |
10293
3c624b3d1039
Make a sed program more robust.
Bruno Haible <bruno@clisp.org>
parents:
10261
diff
changeset
|
2290 ta |
10246
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
2291 :a |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
2292 s/)/)/ |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
2293 tb |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
2294 N |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
2295 ba |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
2296 :b |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2297 s,^.*gl_MODULES([[ ]*\([^])]*\).*$,cached_specified_modules="\1",p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2298 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2299 /gl_AVOID(/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2300 s,^.*gl_AVOID([[ ]*\([^])]*\).*$,cached_avoidlist="\1",p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2301 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2302 /gl_SOURCE_BASE(/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2303 s,^.*gl_SOURCE_BASE([[ ]*\([^])]*\).*$,cached_sourcebase="\1",p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2304 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2305 /gl_M4_BASE(/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2306 s,^.*gl_M4_BASE([[ ]*\([^])]*\).*$,cached_m4base="\1",p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2307 } |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2308 /gl_PO_BASE(/ { |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2309 s,^.*gl_PO_BASE([[ ]*\([^])]*\).*$,cached_pobase="\1",p |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2310 } |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2311 /gl_DOC_BASE(/ { |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2312 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
|
2313 } |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2314 /gl_TESTS_BASE(/ { |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2315 s,^.*gl_TESTS_BASE([[ ]*\([^])]*\).*$,cached_testsbase="\1",p |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2316 } |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2317 /gl_WITH_TESTS/ { |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2318 s,^.*$,cached_inctests=true,p |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2319 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2320 /gl_LIB(/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2321 s,^.*gl_LIB([[ ]*\([^])]*\).*$,cached_libname="\1",p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2322 } |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2323 /gl_LGPL(/ { |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2324 s,^.*gl_LGPL([[ ]*\([^])]*\).*$,cached_lgpl="\1",p |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2325 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2326 /gl_LGPL/ { |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2327 s,^.*$,cached_lgpl=yes,p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2328 } |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2329 /gl_MAKEFILE_NAME(/ { |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2330 s,^.*gl_MAKEFILE_NAME([[ ]*\([^])]*\).*$,cached_makefile_name="\1",p |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2331 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2332 /gl_LIBTOOL/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2333 s,^.*$,cached_libtool=true,p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2334 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2335 /gl_MACRO_PREFIX(/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2336 s,^.*gl_MACRO_PREFIX([[ ]*\([^])]*\).*$,cached_macro_prefix="\1",p |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2337 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2338 /gl_PO_DOMAIN(/ { |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2339 s,^.*gl_PO_DOMAIN([[ ]*\([^])]*\).*$,cached_po_domain="\1",p |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2340 } |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2341 /gl_VC_FILES(/ { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2342 s,^.*gl_VC_FILES([[ ]*\([^])]*\).*$,cached_vc_files="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2343 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2344 eval `sed -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-cache.m4` |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2345 if test -f "$destdir"/$m4base/gnulib-comp.m4; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2346 my_sed_traces=' |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2347 s,#.*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2348 s,^dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2349 s, dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2350 /AC_DEFUN(\['"${cached_macro_prefix}"'_FILE_LIST\], \[/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2351 s,^.*$,cached_files=",p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2352 n |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2353 ta |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2354 :a |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2355 s,^\]).*$,", |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2356 tb |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2357 p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2358 n |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2359 ba |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2360 :b |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2361 p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2362 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2363 eval `sed -n -e "$my_sed_traces" < "$destdir"/$m4base/gnulib-comp.m4` |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2364 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2365 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2366 |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2367 # Merge the cached settings with the specified ones. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2368 # 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
|
2369 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
|
2370 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
|
2371 fi |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2372 # The local_gnulib_dir defaults to the cached one. Recall that the cached one |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2373 # is relative to $destdir, whereas the one we use is relative to . or absolute. |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2374 if test -z "$local_gnulib_dir"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2375 if test -n "$cached_local_gnulib_dir"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2376 case "$destdir" in |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2377 /*) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2378 local_gnulib_dir="$destdir/$cached_local_gnulib_dir" ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2379 *) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2380 case "$cached_local_gnulib_dir" in |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2381 /*) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2382 local_gnulib_dir="$destdir/$cached_local_gnulib_dir" ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2383 *) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2384 func_relconcat "$destdir" "$cached_local_gnulib_dir" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2385 local_gnulib_dir="$relconcat" ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2386 esac ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2387 esac |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2388 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2389 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2390 # 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
|
2391 # "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
|
2392 specified_modules="$cached_specified_modules $1" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2393 # 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
|
2394 # than dropping the cached one when --avoid is specified at least once. |
9086
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
2395 avoidlist=`for m in $cached_avoidlist $avoidlist; do echo $m; done | LC_ALL=C sort -u` |
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
2396 avoidlist=`echo $avoidlist` |
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
2397 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2398 # The sourcebase defaults to the cached one. |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2399 if test -z "$sourcebase"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2400 sourcebase="$cached_sourcebase" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2401 if test -z "$sourcebase"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2402 func_fatal_error "missing --source-base option" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2403 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2404 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2405 # The pobase defaults to the cached one. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2406 if test -z "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2407 pobase="$cached_pobase" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2408 fi |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2409 # 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
|
2410 if test -z "$docbase"; then |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2411 docbase="$cached_docbase" |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2412 if test -z "$docbase"; then |
7076
0e471c8eb020
Tweak error message about missing --doc-base.
Bruno Haible <bruno@clisp.org>
parents:
7073
diff
changeset
|
2413 func_fatal_error "missing --doc-base option. --doc-base has been introduced on 2006-07-11; if your last invocation of 'gnulib-tool --import' is before that date, you need to run 'gnulib-tool --import' once, with a --doc-base option." |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2414 fi |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2415 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2416 # The testsbase defaults to the cached one. |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2417 if test -z "$testsbase"; then |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2418 testsbase="$cached_testsbase" |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2419 if test -z "$testsbase"; then |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2420 func_fatal_error "missing --tests-base option" |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2421 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2422 fi |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2423 # Require the tests if specified either way. |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2424 if test -z "$inctests"; then |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2425 inctests="$cached_inctests" |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2426 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2427 # 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
|
2428 if test -z "$supplied_libname"; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2429 libname="$cached_libname" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2430 if test -z "$libname"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2431 func_fatal_error "missing --lib option" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2432 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2433 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2434 # Require LGPL if specified either way. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2435 if test -z "$lgpl"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2436 lgpl="$cached_lgpl" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2437 fi |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2438 # The makefile_name defaults to the cached one. |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2439 if test -z "$makefile_name"; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2440 makefile_name="$cached_makefile_name" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2441 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
2442 # 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
|
2443 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
|
2444 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
|
2445 libtool="$cached_libtool" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
2446 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
2447 libtool="$guessed_libtool" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
2448 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2449 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2450 # The macro_prefix defaults to the cached one. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2451 if test -z "$macro_prefix"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2452 macro_prefix="$cached_macro_prefix" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2453 if test -z "$macro_prefix"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2454 func_fatal_error "missing --macro-prefix option" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2455 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2456 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2457 # The po_domain defaults to the cached one. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2458 if test -z "$po_domain"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2459 po_domain="$cached_po_domain" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2460 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2461 # The vc_files defaults to the cached one. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2462 if test -z "$vc_files"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2463 vc_files="$cached_vc_files" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2464 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2465 |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2466 # Canonicalize the list of specified modules. |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
2467 specified_modules=`for m in $specified_modules; do echo $m; done | LC_ALL=C sort -u` |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2468 |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2469 # Determine final module list. |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2470 modules="$specified_modules" |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2471 func_modules_transitive_closure |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2472 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2473 echo "Module list with included dependencies:" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2474 echo "$modules" | sed -e 's/^/ /' |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2475 fi |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2476 final_modules="$modules" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2477 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2478 # Determine main module list and tests-related module list separately. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2479 # The main module list is the transitive closure of the specified modules, |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2480 # ignoring tests modules. Its lib/* sources go into $sourcebase/. If --lgpl |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2481 # is specified, it will consist only of LGPLed source. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2482 # The tests-related module list is the transitive closure of the specified |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2483 # modules, including tests modules, minus the main module list. Its lib/* |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2484 # sources (brought in through dependencies of *-tests modules) go into |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2485 # $testsbase/. It may contain GPLed source, even if --lgpl is specified. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2486 # Determine main module list. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2487 saved_inctests="$inctests" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2488 inctests="" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2489 modules="$specified_modules" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2490 func_modules_transitive_closure |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2491 main_modules="$modules" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2492 inctests="$saved_inctests" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2493 if test $verbose -ge 1; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2494 echo "Main module list:" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2495 echo "$main_modules" | sed -e 's/^/ /' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2496 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2497 # Determine tests-related module list. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2498 echo "$final_modules" | LC_ALL=C sort -u > "$tmp"/final-modules |
10379
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
2499 testsrelated_modules=`func_reset_sigpipe; echo "$main_modules" | LC_ALL=C sort -u | LC_ALL=C join -v 2 - "$tmp"/final-modules` |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2500 if test $verbose -ge 1; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2501 echo "Tests-related module list:" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2502 echo "$testsrelated_modules" | sed -e 's/^/ /' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2503 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2504 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2505 # Add the dummy module to the main module list if needed. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2506 modules="$main_modules" |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2507 func_modules_add_dummy |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2508 main_modules="$modules" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2509 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2510 # Determine whether a $testsbase/libtests.a is needed. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2511 use_libtests=false |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2512 for module in $testsrelated_modules; do |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2513 func_verify_nontests_module |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2514 if test -n "$module"; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2515 all_files=`func_get_filelist $module` |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2516 lib_files=`for f in $all_files; do \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2517 case $f in \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2518 lib/*) echo $f ;; \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2519 esac; \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2520 done | sed -e 's,^lib/,,'` |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2521 if test -n "$lib_files"; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2522 use_libtests=true |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2523 break |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2524 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2525 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2526 done |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2527 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2528 # Add the dummy module to the tests-related module list if needed. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2529 if $use_libtests; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2530 modules="$testsrelated_modules" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2531 func_modules_add_dummy |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2532 testsrelated_modules="$modules" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2533 fi |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2534 |
7235
3dbbe645b976
* MODULES.html.sh (Support for building documentation): Add gpl, lgpl.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7222
diff
changeset
|
2535 # If --lgpl, verify that the licenses of modules are compatible. |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2536 if test -n "$lgpl"; then |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2537 license_incompatibilities= |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2538 for module in $main_modules; do |
5346 | 2539 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
|
2540 case $license in |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2541 'GPLed build tool') ;; |
7245 | 2542 'public domain' | 'unlimited' | 'unmodifiable license text') ;; |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2543 *) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2544 case "$lgpl" in |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2545 yes | 3) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2546 case $license in |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2547 LGPL | LGPLv2+) ;; |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2548 *) func_append license_incompatibilities "$module $license$nl" ;; |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2549 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2550 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2551 2) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2552 case $license in |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2553 LGPLv2+) ;; |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2554 *) func_append license_incompatibilities "$module $license$nl" ;; |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2555 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2556 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2557 *) func_fatal_error "invalid value lgpl=$lgpl" ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2558 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2559 ;; |
5963
6fb8c48c4dcd
* gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
2560 esac |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2561 done |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2562 if test -n "$license_incompatibilities"; then |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2563 # Format the license incompatibilities as a table. |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2564 sed_expand_column1_width50_indent17='s,^\([^ ]*\) ,\1 , |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2565 s,^\(.................................................[^ ]*\) *, \1 ,' |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2566 license_incompatibilities=`echo "$license_incompatibilities" | sed -e "$sed_expand_column1_width50_indent17"` |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2567 func_fatal_error "incompatible license on modules:$nl$license_incompatibilities" |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
2568 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2569 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2570 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2571 # Show banner notice of every module. |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2572 modules="$main_modules" |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2573 func_modules_notice |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2574 |
7199
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
2575 # Determine script to apply to imported library files. |
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
2576 sed_transform_lib_file= |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2577 for module in $main_modules; do |
7245 | 2578 if test $module = config-h; then |
7199
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
2579 # Assume config.h exists, and that -DHAVE_CONFIG_H is omitted. |
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
2580 sed_transform_lib_file=$sed_transform_lib_file' |
7245 | 2581 s/^#ifdef[ ]*HAVE_CONFIG_H[ ]*$/#if 1/ |
2582 ' | |
2583 break | |
2584 fi | |
2585 done | |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2586 sed_transform_main_lib_file="$sed_transform_lib_file" |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
2587 if test -n "$do_copyrights"; then |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
2588 if test -n "$lgpl"; then |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
2589 # Update license. |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2590 case "$lgpl" in |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2591 yes | 3) |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2592 sed_transform_main_lib_file=$sed_transform_main_lib_file' |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2593 s/GNU General/GNU Lesser General/g |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2594 ' |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2595 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2596 2) |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2597 sed_transform_main_lib_file=$sed_transform_main_lib_file' |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2598 s/GNU General/GNU Lesser General/g |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2599 s/version [23]\([ ,]\)/version 2.1\1/g |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2600 ' |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2601 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2602 *) func_fatal_error "invalid value lgpl=$lgpl" ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2603 esac |
9424
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
2604 else |
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
2605 # Update license. |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2606 sed_transform_main_lib_file=$sed_transform_main_lib_file' |
9424
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
2607 s/GNU Lesser General/GNU General/g |
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
2608 s/GNU Library General/GNU General/g |
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
2609 s/version \(2\|2\.1\)\([ ,]\)/version 3\2/g |
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
2610 ' |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
2611 fi |
7199
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
2612 fi |
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
2613 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2614 # Determine script to apply to library files that go into $testsbase/. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2615 sed_transform_testsrelated_lib_file="$sed_transform_lib_file" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2616 if test -n "$do_copyrights"; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2617 # Update license. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2618 sed_transform_testsrelated_lib_file=$sed_transform_testsrelated_lib_file' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2619 s/GNU Lesser General/GNU General/g |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2620 s/GNU Library General/GNU General/g |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2621 s/version \(2\|2\.1\)\([ ,]\)/version 3\2/g |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2622 ' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2623 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2624 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2625 # Determine the final file lists. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2626 # They must be computed separately, because files in lib/* go into |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2627 # $sourcebase/ if they are in the main file list but into $testsbase/ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2628 # if they are in the tests-related file list. Furthermore lib/dummy.c |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2629 # can be in both. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2630 # Determine final main file list. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2631 modules="$main_modules" |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2632 func_modules_to_filelist |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2633 main_files="$files" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2634 # Determine final tests-related file list. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2635 modules="$testsrelated_modules" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2636 func_modules_to_filelist |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2637 testsrelated_files=`echo "$files" | sed -e 's,^lib/,tests=lib/,'` |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2638 # Merge both file lists. |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2639 sed_remove_empty_lines='/^$/d' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2640 files=`{ echo "$main_files"; echo "$testsrelated_files"; } | sed -e "$sed_remove_empty_lines" | LC_ALL=C sort -u` |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2641 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2642 echo "File list:" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2643 sed_prettyprint_files='s,^tests=lib/\(.*\)$,lib/\1 -> tests/\1,' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2644 echo "$files" | sed -e "$sed_prettyprint_files" -e 's/^/ /' |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2645 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2646 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2647 test -n "$files" \ |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2648 || 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
|
2649 |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2650 # 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
|
2651 new_files="$files m4/gnulib-tool.m4" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2652 old_files="$cached_files" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2653 if test -f "$destdir"/$m4base/gnulib-tool.m4; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2654 func_append old_files " m4/gnulib-tool.m4" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2655 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2656 |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2657 sed_rewrite_old_files="\ |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2658 s,^build-aux/,$auxdir/, |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2659 s,^doc/,$cached_docbase/, |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2660 s,^lib/,$cached_sourcebase/, |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2661 s,^m4/,$cached_m4base/, |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2662 s,^tests/,$cached_testsbase/, |
9807
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2663 s,^tests=lib/,$cached_testsbase/, |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2664 s,^top/,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2665 sed_rewrite_new_files="\ |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2666 s,^build-aux/,$auxdir/, |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2667 s,^doc/,$docbase/, |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2668 s,^lib/,$sourcebase/, |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2669 s,^m4/,$m4base/, |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2670 s,^tests/,$testsbase/, |
9807
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2671 s,^tests=lib/,$testsbase/, |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2672 s,^top/,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2673 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
2674 # Create directories. |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2675 { echo "$sourcebase" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2676 echo "$m4base" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2677 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2678 echo "$pobase" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2679 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2680 docfiles=`echo "$files" | sed -n -e 's,^doc/,,p'` |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2681 if test -n "$docfiles"; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2682 echo "$docbase" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2683 fi |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2684 if test -n "$inctests"; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2685 echo "$testsbase" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
2686 fi |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2687 echo "$auxdir" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2688 for f in $files; do echo $f; done \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2689 | sed -e "$sed_rewrite_new_files" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2690 | sed -n -e 's,^\(.*\)/[^/]*,\1,p' \ |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2691 | LC_ALL=C sort -u |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2692 } > "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2693 { # Rearrange file descriptors. Needed because "while ... done < ..." |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2694 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2695 exec 5<&0 < "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2696 while read d; do |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2697 if test ! -d "$destdir/$d"; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2698 if $doit; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2699 echo "Creating directory $destdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2700 mkdir -p "$destdir/$d" || func_fatal_error "failed" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2701 else |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2702 echo "Create directory $destdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2703 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2704 fi |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2705 done |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2706 exec 0<&5 5<&- |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
2707 } |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
2708 |
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
|
2709 # 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
|
2710 # 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
|
2711 # 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
|
2712 # - 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
|
2713 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
|
2714 { |
aca74c06bca0
Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents:
6633
diff
changeset
|
2715 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
|
2716 # 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
|
2717 # 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
|
2718 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
|
2719 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
|
2720 # 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
|
2721 # (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
|
2722 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
|
2723 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
|
2724 } |
aca74c06bca0
Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents:
6633
diff
changeset
|
2725 |
aca74c06bca0
Fix "gnulib-tool --dry-run --import" in a package that has no lib/ and
Bruno Haible <bruno@clisp.org>
parents:
6633
diff
changeset
|
2726 # Copy files or make symbolic links. Remove obsolete files. |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
2727 added_files='' |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
2728 removed_files='' |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2729 delimiter=' ' |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2730 # Construct a table with 2 columns: rewritten-file-name original-file-name, |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2731 # representing the files according to the last gnulib-tool invocation. |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2732 for f in $old_files; do echo $f; done \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2733 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_old_files" \ |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2734 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2735 > "$tmp"/old-files |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2736 # Construct a table with 2 columns: rewritten-file-name original-file-name, |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2737 # representing the files after this gnulib-tool invocation. |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2738 for f in $new_files; do echo $f; done \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2739 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" \ |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2740 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2741 > "$tmp"/new-files |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2742 # 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
|
2743 sed_take_first_column='s,'"$delimiter"'.*,,' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2744 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
|
2745 # Remove the file. Do nothing if the user already removed it. |
9168
9b8032e2af0c
Care about dangling symbolic links.
Bruno Haible <bruno@clisp.org>
parents:
9167
diff
changeset
|
2746 if test -f "$destdir/$g" || test -h "$destdir/$g"; then |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2747 if $doit; then |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2748 echo "Removing file $g (backup in ${g}~)" |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2749 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
|
2750 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2751 echo "Remove file $g (backup in ${g}~)" |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2752 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
2753 func_append removed_files "$g$nl" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2754 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2755 done |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2756 # func_add_or_update handles a file that ought to be present afterwards. |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2757 # Uses parameters |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2758 # - f the original file name |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2759 # - g the rewritten file name |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2760 # - already_present nonempty if the file already exists, empty otherwise |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2761 func_add_or_update () |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2762 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2763 of="$f" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2764 case "$f" in |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2765 tests=lib/*) f=`echo "$f" | sed -e 's,^tests=lib/,lib/,'` ;; |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2766 esac |
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
|
2767 func_dest_tmpfilename "$g" |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
2768 func_lookup_file "$f" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
2769 cp "$lookedup_file" "$tmpfile" || func_fatal_error "failed" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2770 if test -n "$sed_transform_main_lib_file"; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2771 case "$of" in |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2772 lib/*) |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2773 sed -e "$sed_transform_main_lib_file" \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2774 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2775 ;; |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2776 esac |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2777 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2778 if test -n "$sed_transform_testsrelated_lib_file"; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2779 case "$of" in |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2780 tests=lib/*) |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2781 sed -e "$sed_transform_testsrelated_lib_file" \ |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
2782 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2783 ;; |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2784 esac |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
2785 fi |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2786 if test -f "$destdir/$g"; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2787 # 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
|
2788 if cmp "$destdir/$g" "$tmpfile" > /dev/null; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2789 : # The file has not changed. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2790 else |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2791 # Replace the file. |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2792 if $doit; then |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2793 if test -n "$already_present"; then |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2794 echo "Updating file $g (backup in ${g}~)" |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2795 else |
9875
44146d346042
gnulib-tool (func_add_or_update): s/backuped/backed up/ in diagnostic
Jim Meyering <meyering@redhat.com>
parents:
9810
diff
changeset
|
2796 echo "Replacing file $g (non-gnulib code backed up in ${g}~) !!" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2797 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2798 mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed" |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2799 if { test -n "$symbolic" \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2800 || { test -n "$lsymbolic" \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2801 && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; } \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2802 && test -z "$lookedup_tmp" \ |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
2803 && cmp "$lookedup_file" "$tmpfile" > /dev/null; then |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
2804 func_ln_if_changed "$lookedup_file" "$destdir/$g" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2805 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
|
2806 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
|
2807 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2808 else |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2809 if test -n "$already_present"; then |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2810 echo "Update file $g (backup in ${g}~)" |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2811 else |
9875
44146d346042
gnulib-tool (func_add_or_update): s/backuped/backed up/ in diagnostic
Jim Meyering <meyering@redhat.com>
parents:
9810
diff
changeset
|
2812 echo "Replace file $g (non-gnulib code backed up in ${g}~) !!" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2813 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2814 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2815 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2816 else |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2817 # Install the file. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2818 # 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
|
2819 # 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
|
2820 if $doit; then |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2821 echo "Copying file $g" |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2822 if { test -n "$symbolic" \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2823 || { test -n "$lsymbolic" \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2824 && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; } \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
2825 && test -z "$lookedup_tmp" \ |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
2826 && cmp "$lookedup_file" "$tmpfile" > /dev/null; then |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
2827 func_ln_if_changed "$lookedup_file" "$destdir/$g" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2828 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
|
2829 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
|
2830 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2831 else |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2832 echo "Copy file $g" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2833 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
2834 func_append added_files "$g$nl" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2835 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
|
2836 rm -f "$tmpfile" |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2837 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2838 # 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
|
2839 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
|
2840 already_present= |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2841 LC_ALL=C join -t"$delimiter" -v2 "$tmp"/old-files "$tmp"/new-files \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2842 | sed -e "$sed_take_last_column" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2843 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" > "$tmp"/added-files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2844 { # Rearrange file descriptors. Needed because "while ... done < ..." |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2845 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. |
7368
a7abebdb07f4
* gnulib-tool (func_import, func_create_testdir): Fix typos in
Eric Blake <ebb9@byu.net>
parents:
7350
diff
changeset
|
2846 exec 5<&0 < "$tmp"/added-files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2847 while read g f; do |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2848 func_add_or_update |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2849 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
2850 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2851 } |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
2852 # 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
|
2853 already_present=true |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
2854 LC_ALL=C join -t"$delimiter" "$tmp"/old-files "$tmp"/new-files \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2855 | sed -e "$sed_take_last_column" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2856 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_new_files" > "$tmp"/kept-files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2857 { # Rearrange file descriptors. Needed because "while ... done < ..." |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2858 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. |
7368
a7abebdb07f4
* gnulib-tool (func_import, func_create_testdir): Fix typos in
Eric Blake <ebb9@byu.net>
parents:
7350
diff
changeset
|
2859 exec 5<&0 < "$tmp"/kept-files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2860 while read g f; do |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2861 func_add_or_update |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2862 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
2863 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
2864 } |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2865 |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2866 # 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
|
2867 actioncmd="gnulib-tool --import" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2868 func_append actioncmd " --dir=$destdir" |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2869 if test -n "$local_gnulib_dir"; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2870 func_append actioncmd " --local-dir=$local_gnulib_dir" |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
2871 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2872 func_append actioncmd " --lib=$libname" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2873 func_append actioncmd " --source-base=$sourcebase" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2874 func_append actioncmd " --m4-base=$m4base" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2875 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2876 func_append actioncmd " --po-base=$pobase" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2877 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2878 func_append actioncmd " --doc-base=$docbase" |
10475
b80084824a77
Store the --tests-base option in the comment in gnulib-cache.m4.
Yoann Vandoorselaere <yoann.v@prelude-ids.com>
parents:
10453
diff
changeset
|
2879 func_append actioncmd " --tests-base=$testsbase" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2880 func_append actioncmd " --aux-dir=$auxdir" |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2881 if test -n "$inctests"; then |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2882 func_append actioncmd " --with-tests" |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
2883 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2884 for module in $avoidlist; do |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2885 func_append actioncmd " --avoid=$module" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2886 done |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2887 if test -n "$lgpl"; then |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2888 if test "$lgpl" = yes; then |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2889 func_append actioncmd " --lgpl" |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2890 else |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2891 func_append actioncmd " --lgpl=$lgpl" |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
2892 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2893 fi |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2894 if test -n "$makefile_name"; then |
7600
42c51a6fef88
Fix typo in actioncmd. From Charles WIlson.
Bruno Haible <bruno@clisp.org>
parents:
7599
diff
changeset
|
2895 func_append actioncmd " --makefile-name=$makefile_name" |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2896 fi |
7077 | 2897 if test "$libtool" = true; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2898 func_append actioncmd " --libtool" |
7077 | 2899 else |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2900 func_append actioncmd " --no-libtool" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2901 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2902 func_append actioncmd " --macro-prefix=$macro_prefix" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2903 if test -n "$po_domain"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2904 func_append actioncmd " --po-domain=$po_domain" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2905 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2906 if test -n "$vc_files"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2907 if test "$vc_files" = true; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2908 func_append actioncmd " --vc-files" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2909 else |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2910 func_append actioncmd " --no-vc-files" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2911 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
2912 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2913 func_append actioncmd " `echo $specified_modules`" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2914 |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2915 # Default the makefile name to Makefile.am. |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2916 if test -n "$makefile_name"; then |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2917 makefile_am=$makefile_name |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2918 else |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2919 makefile_am=Makefile.am |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2920 fi |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2921 |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
2922 # Create normal Makefile.ams. |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
2923 for_test=false |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
2924 |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2925 # Setup list of Makefile.am edits that are to be performed afterwards. |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2926 # Some of these edits apply to files that we will generate; others are |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2927 # under the responsibility of the developer. |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2928 makefile_am_edits=0 |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2929 # func_note_Makefile_am_edit dir var value |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2930 # remembers that ${dir}Makefile.am needs to be edited to that ${var} mentions |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2931 # ${value}. |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2932 func_note_Makefile_am_edit () |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2933 { |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2934 makefile_am_edits=`expr $makefile_am_edits + 1` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2935 eval makefile_am_edit${makefile_am_edits}_dir=\"\$1\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2936 eval makefile_am_edit${makefile_am_edits}_var=\"\$2\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2937 eval makefile_am_edit${makefile_am_edits}_val=\"\$3\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2938 } |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2939 if test "$makefile_am" = Makefile.am; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2940 sourcebase_dir=`echo "$sourcebase" | sed -n -e 's,/[^/]*$,/,p'` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2941 sourcebase_base=`basename "$sourcebase"` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2942 func_note_Makefile_am_edit "$sourcebase_dir" SUBDIRS "$sourcebase_base" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2943 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2944 if test -n "$pobase"; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2945 pobase_dir=`echo "$pobase" | sed -n -e 's,/[^/]*$,/,p'` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2946 pobase_base=`basename "$pobase"` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2947 func_note_Makefile_am_edit "$pobase_dir" SUBDIRS "$pobase_base" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2948 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2949 if test -n "$inctests"; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2950 if test "$makefile_am" = Makefile.am; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2951 testsbase_dir=`echo "$testsbase" | sed -n -e 's,/[^/]*$,/,p'` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2952 testsbase_base=`basename "$testsbase"` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2953 func_note_Makefile_am_edit "$testsbase_dir" SUBDIRS "$testsbase_base" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2954 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2955 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2956 func_note_Makefile_am_edit "" ACLOCAL_AMFLAGS "-I ${m4base}" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2957 { |
10478
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2958 # Find the first parent directory of $m4base that contains or will contain |
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2959 # a Makefile.am. |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2960 sed_last='s,^.*/\([^/][^/]*\)//*$,\1/, |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2961 s,//*$,/,' |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2962 sed_butlast='s,[^/][^/]*//*$,,' |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2963 dir1="${m4base}/"; dir2="" |
10478
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2964 while test -n "$dir1" \ |
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2965 && ! { test -f "${destdir}/${dir1}Makefile.am" \ |
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2966 || test "${dir1}Makefile.am" = "$sourcebase/$makefile_am" \ |
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2967 || test "./${dir1}Makefile.am" = "$sourcebase/$makefile_am" \ |
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2968 || { test -n "$inctests" \ |
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2969 && { test "${dir1}Makefile.am" = "$testsbase/$makefile_am" \ |
569d6cd01c90
Oops, tweak last commit so that it also works in the first gnulib-tool run.
Bruno Haible <bruno@clisp.org>
parents:
10476
diff
changeset
|
2970 || test "./${dir1}Makefile.am" = "$testsbase/$makefile_am"; }; }; }; do |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2971 dir2=`echo "$dir1" | sed -e "$sed_last"`"$dir2" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2972 dir1=`echo "$dir1" | sed -e "$sed_butlast"` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2973 done |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2974 func_note_Makefile_am_edit "$dir1" EXTRA_DIST "${dir2}gnulib-cache.m4" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2975 } |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2976 |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2977 # Create library makefile. |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2978 func_dest_tmpfilename $sourcebase/$makefile_am |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2979 destfile="$sourcebase/$makefile_am" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2980 modules="$main_modules" |
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
|
2981 func_emit_lib_Makefile_am > "$tmpfile" |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2982 if test -f "$destdir"/$sourcebase/$makefile_am; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2983 if cmp "$destdir"/$sourcebase/$makefile_am "$tmpfile" > /dev/null; 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
|
2984 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2985 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2986 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2987 echo "Updating $sourcebase/$makefile_am (backup in $sourcebase/$makefile_am~)" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2988 mv -f "$destdir"/$sourcebase/$makefile_am "$destdir"/$sourcebase/$makefile_am~ |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2989 mv -f "$tmpfile" "$destdir"/$sourcebase/$makefile_am |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2990 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2991 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
|
2992 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
2993 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2994 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2995 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2996 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2997 echo "Creating $sourcebase/$makefile_am" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
2998 mv -f "$tmpfile" "$destdir"/$sourcebase/$makefile_am |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
2999 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3000 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
|
3001 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3002 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3003 func_append added_files "$sourcebase/$makefile_am$nl" |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3004 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3005 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3006 # Create po/ directory. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3007 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3008 # Create po makefile and auxiliary files. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3009 for file in Makefile.in.in remove-potcdate.sin; do |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3010 func_dest_tmpfilename $pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3011 func_lookup_file build-aux/po/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3012 cat "$lookedup_file" > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3013 if test -f "$destdir"/$pobase/$file; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3014 if cmp "$destdir"/$pobase/$file "$tmpfile" > /dev/null; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3015 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3016 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3017 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3018 echo "Updating $pobase/$file (backup in $pobase/$file~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3019 mv -f "$destdir"/$pobase/$file "$destdir"/$pobase/$file~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3020 mv -f "$tmpfile" "$destdir"/$pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3021 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3022 echo "Update $pobase/$file (backup in $pobase/$file~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3023 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3024 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3025 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3026 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3027 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3028 echo "Creating $pobase/$file" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3029 mv -f "$tmpfile" "$destdir"/$pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3030 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3031 echo "Create $pobase/$file" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3032 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3033 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3034 func_append added_files "$pobase/$file$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3035 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3036 done |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
3037 # Create po makefile parameterization, part 1. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3038 func_dest_tmpfilename $pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3039 func_emit_po_Makevars > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3040 if test -f "$destdir"/$pobase/Makevars; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3041 if cmp "$destdir"/$pobase/Makevars "$tmpfile" > /dev/null; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3042 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3043 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3044 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3045 echo "Updating $pobase/Makevars (backup in $pobase/Makevars~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3046 mv -f "$destdir"/$pobase/Makevars "$destdir"/$pobase/Makevars~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3047 mv -f "$tmpfile" "$destdir"/$pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3048 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3049 echo "Update $pobase/Makevars (backup in $pobase/Makevars~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3050 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3051 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3052 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3053 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3054 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3055 echo "Creating $pobase/Makevars" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3056 mv -f "$tmpfile" "$destdir"/$pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3057 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3058 echo "Create $pobase/Makevars" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3059 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3060 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3061 func_append added_files "$pobase/Makevars$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3062 fi |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
3063 # Create po makefile parameterization, part 2. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3064 func_dest_tmpfilename $pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3065 func_emit_po_POTFILES_in > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3066 if test -f "$destdir"/$pobase/POTFILES.in; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3067 if cmp "$destdir"/$pobase/POTFILES.in "$tmpfile" > /dev/null; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3068 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3069 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3070 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3071 echo "Updating $pobase/POTFILES.in (backup in $pobase/POTFILES.in~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3072 mv -f "$destdir"/$pobase/POTFILES.in "$destdir"/$pobase/POTFILES.in~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3073 mv -f "$tmpfile" "$destdir"/$pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3074 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3075 echo "Update $pobase/POTFILES.in (backup in $pobase/POTFILES.in~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3076 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3077 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3078 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3079 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3080 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3081 echo "Creating $pobase/POTFILES.in" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3082 mv -f "$tmpfile" "$destdir"/$pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3083 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3084 echo "Create $pobase/POTFILES.in" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3085 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3086 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3087 func_append added_files "$pobase/POTFILES.in$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3088 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3089 # Fetch PO files. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3090 TP_URL="http://translationproject.org/latest/" |
9187
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3091 TP_RSYNC_URI="translationproject.org::tp/latest/" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3092 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3093 echo "Fetching gnulib PO files from $TP_URL" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3094 (cd "$destdir"/$pobase \ |
9187
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3095 && { # Prefer rsync over wget if it is available, since it consumes |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3096 # less network bandwidth, due to compression. |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3097 if type rsync 2>/dev/null | grep / > /dev/null; then |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3098 rsync -Lrtz "${TP_RSYNC_URI}gnulib/" . |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3099 else |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3100 wget --quiet -r -l1 -nd -np -A.po "${TP_URL}gnulib" |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3101 fi |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
3102 } |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3103 ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3104 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3105 echo "Fetch gnulib PO files from $TP_URL" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3106 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3107 # Create po/LINGUAS. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3108 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3109 func_dest_tmpfilename $pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3110 (cd "$destdir"/$pobase \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3111 && { echo '# Set of available languages.' |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3112 LC_ALL=C ls -1 *.po | sed -e 's,\.po$,,' |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3113 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3114 ) > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3115 if test -f "$destdir"/$pobase/LINGUAS; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3116 if cmp "$destdir"/$pobase/LINGUAS "$tmpfile" > /dev/null; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3117 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3118 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3119 echo "Updating $pobase/LINGUAS (backup in $pobase/LINGUAS~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3120 mv -f "$destdir"/$pobase/LINGUAS "$destdir"/$pobase/LINGUAS~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3121 mv -f "$tmpfile" "$destdir"/$pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3122 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3123 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3124 echo "Creating $pobase/LINGUAS" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3125 mv -f "$tmpfile" "$destdir"/$pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3126 func_append added_files "$pobase/LINGUAS$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3127 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3128 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3129 if test -f "$destdir"/$pobase/LINGUAS; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3130 echo "Update $pobase/LINGUAS (backup in $pobase/LINGUAS~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3131 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3132 echo "Create $pobase/LINGUAS" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3133 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3134 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3135 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3136 |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3137 # 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
|
3138 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
|
3139 ( |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
3140 func_emit_copyright_notice |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3141 echo "#" |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3142 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
|
3143 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
|
3144 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
|
3145 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
|
3146 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3147 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3148 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
|
3149 echo "# $actioncmd" |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3150 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3151 echo "# Specification in the form of a few gnulib-tool.m4 macro invocations:" |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3152 # Store the local_gnulib_dir relative to destdir. |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3153 case "$local_gnulib_dir" in |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3154 "" | /*) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3155 relative_local_gnulib_dir="$local_gnulib_dir" ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3156 * ) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3157 case "$destdir" in |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3158 /*) relative_local_gnulib_dir="$local_gnulib_dir" ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3159 *) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3160 # destdir, local_gnulib_dir are both relative. |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3161 func_relativize "$destdir" "$local_gnulib_dir" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3162 relative_local_gnulib_dir="$reldir" ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3163 esac ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3164 esac |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3165 echo "gl_LOCAL_DIR([$relative_local_gnulib_dir])" |
10246
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3166 echo "gl_MODULES([" |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3167 echo "$specified_modules" | sed 's/^/ /g' |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3168 echo "])" |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3169 echo "gl_AVOID([$avoidlist])" |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3170 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
|
3171 echo "gl_M4_BASE([$m4base])" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3172 echo "gl_PO_BASE([$pobase])" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3173 echo "gl_DOC_BASE([$docbase])" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3174 echo "gl_TESTS_BASE([$testsbase])" |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
3175 test -z "$inctests" || echo "gl_WITH_TESTS" |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3176 echo "gl_LIB([$libname])" |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3177 if test -n "$lgpl"; then |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3178 if test "$lgpl" = yes; then |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3179 echo "gl_LGPL" |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3180 else |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3181 echo "gl_LGPL([$lgpl])" |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3182 fi |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3183 fi |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3184 echo "gl_MAKEFILE_NAME([$makefile_name])" |
7077 | 3185 if test "$libtool" = true; then |
3186 echo "gl_LIBTOOL" | |
3187 fi | |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3188 echo "gl_MACRO_PREFIX([$macro_prefix])" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3189 echo "gl_PO_DOMAIN([$po_domain])" |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3190 if test -n "$vc_files"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3191 echo "gl_VC_FILES([$vc_files])" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3192 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
|
3193 ) > "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3194 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
|
3195 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
|
3196 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3197 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3198 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3199 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
|
3200 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
|
3201 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
|
3202 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3203 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
|
3204 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
|
3205 cat "$tmpfile" |
6249
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
3206 echo |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
3207 echo "# gnulib-cache.m4 ends here" |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
3208 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
|
3209 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3210 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3211 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3212 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3213 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3214 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
|
3215 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
|
3216 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3217 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
|
3218 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
|
3219 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3220 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3221 fi |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3222 |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3223 # 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
|
3224 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
|
3225 ( |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
7391
diff
changeset
|
3226 echo "# DO NOT EDIT! GENERATED AUTOMATICALLY!" |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
3227 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
|
3228 echo "#" |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3229 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
|
3230 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
|
3231 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
|
3232 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
|
3233 echo |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3234 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
3235 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
|
3236 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
|
3237 echo "# any checks for libraries, header files, types and library functions." |
6176 | 3238 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
|
3239 echo "[" |
7105
641bac73140c
* gnulib-tool (func_import): Detect unexpanded macros in gnulib
Eric Blake <ebb9@byu.net>
parents:
7090
diff
changeset
|
3240 echo " m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3241 echo " m4_pattern_allow([^gl_ES\$])dnl a valid locale name" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3242 echo " m4_pattern_allow([^gl_LIBOBJS\$])dnl a variable" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3243 echo " m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable" |
6512 | 3244 echo " AC_REQUIRE([AC_PROG_RANLIB])" |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3245 if test -n "$uses_subdirs"; then |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3246 echo " AC_REQUIRE([AM_PROG_CC_C_O])" |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3247 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
|
3248 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
|
3249 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
|
3250 fi |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3251 for module in $final_modules; do |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3252 func_verify_module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3253 if test -n "$module"; then |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3254 func_get_autoconf_early_snippet "$module" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3255 fi |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3256 done \ |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3257 | sed -e '/^$/d;' -e 's/^/ /' |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3258 echo "])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3259 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
3260 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
|
3261 echo "# \"Check for header files, types and library functions\"." |
6176 | 3262 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
|
3263 echo "[" |
7077 | 3264 if test "$libtool" = true; then |
3265 echo " AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" | |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3266 echo " gl_cond_libtool=true" |
7077 | 3267 else |
6512 | 3268 echo " AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3269 echo " gl_cond_libtool=false" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3270 echo " gl_libdeps=" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3271 echo " gl_ltlibdeps=" |
6414
46d47c8fe734
* gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents:
6389
diff
changeset
|
3272 fi |
6556 | 3273 if test "$auxdir" != "build-aux"; then |
3274 sed_replace_build_aux=' | |
3275 :a | |
3276 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ | |
3277 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| | |
3278 ba | |
3279 }' | |
3280 else | |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
3281 sed_replace_build_aux="$sed_noop" |
6556 | 3282 fi |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3283 func_emit_initmacro_start $macro_prefix |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3284 echo " gl_source_base='$sourcebase'" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3285 for module in $main_modules; do |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3286 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3287 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
|
3288 func_get_autoconf_snippet "$module" \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3289 | sed -e '/^$/d;' -e 's/^/ /' \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3290 -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3291 -e "$sed_replace_build_aux" |
7077 | 3292 if test "$module" = 'alloca' && test "$libtool" = true; then |
5356
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
3293 echo 'changequote(,)dnl' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3294 echo 'LTALLOCA=`echo "$ALLOCA" | sed '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' |
5356
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
3295 echo 'changequote([, ])dnl' |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
3296 echo 'AC_SUBST([LTALLOCA])' |
5356
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
3297 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3298 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3299 done |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3300 func_emit_initmacro_end $macro_prefix |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3301 echo " gltests_libdeps=" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3302 echo " gltests_ltlibdeps=" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3303 func_emit_initmacro_start ${macro_prefix}tests |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3304 echo " gl_source_base='$testsbase'" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3305 for module in $testsrelated_modules; do |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3306 func_verify_module |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3307 if test -n "$module"; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3308 func_get_autoconf_snippet "$module" \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3309 | sed -e '/^$/d;' -e 's/^/ /' \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3310 -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3311 -e "$sed_replace_build_aux" \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3312 -e 's/\$gl_cond_libtool/false/g' \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3313 -e 's/gl_libdeps/gltests_libdeps/g' \ |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3314 -e 's/gl_ltlibdeps/gltests_ltlibdeps/g' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3315 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3316 done |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3317 func_emit_initmacro_end ${macro_prefix}tests |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3318 # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3319 # created using libtool, because libtool already handles the dependencies. |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3320 if test "$libtool" != true; then |
9086
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
3321 libname_upper=`echo "$libname" | LC_ALL=C tr 'a-z-' 'A-Z_'` |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3322 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3323 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3324 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3325 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3326 fi |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3327 if $use_libtests; then |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3328 echo " LIBTESTS_LIBDEPS=\"\$gltests_libdeps\"" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3329 echo " AC_SUBST([LIBTESTS_LIBDEPS])" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3330 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3331 echo "])" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3332 func_emit_initmacro_done $macro_prefix $sourcebase |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3333 func_emit_initmacro_done ${macro_prefix}tests $testsbase |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3334 echo |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3335 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
|
3336 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
|
3337 echo "AC_DEFUN([${macro_prefix}_FILE_LIST], [" |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3338 echo "$files" | sed -e 's,^, ,' |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
3339 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
|
3340 ) > "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3341 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
|
3342 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
|
3343 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3344 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3345 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3346 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
|
3347 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
|
3348 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
|
3349 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3350 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
|
3351 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
|
3352 cat "$tmpfile" |
6249
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
3353 echo |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
3354 echo "# gnulib-comp.m4 ends here" |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
3355 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
|
3356 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3357 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3358 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3359 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3360 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3361 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
|
3362 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
|
3363 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3364 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
|
3365 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
|
3366 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3367 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3368 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3369 |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3370 if test -n "$inctests"; then |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
3371 # Create tests makefile. |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3372 func_dest_tmpfilename $testsbase/$makefile_am |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3373 destfile="$testsbase/$makefile_am" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3374 modules="$testsrelated_modules" |
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
|
3375 func_emit_tests_Makefile_am > "$tmpfile" |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3376 if test -f "$destdir"/$testsbase/$makefile_am; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3377 if cmp "$destdir"/$testsbase/$makefile_am "$tmpfile" > /dev/null; 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
|
3378 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3379 else |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3380 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3381 echo "Updating $testsbase/$makefile_am (backup in $testsbase/$makefile_am~)" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3382 mv -f "$destdir"/$testsbase/$makefile_am "$destdir"/$testsbase/$makefile_am~ |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3383 mv -f "$tmpfile" "$destdir"/$testsbase/$makefile_am |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3384 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3385 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
|
3386 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3387 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3388 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3389 else |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3390 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3391 echo "Creating $testsbase/$makefile_am" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3392 mv -f "$tmpfile" "$destdir"/$testsbase/$makefile_am |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3393 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3394 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
|
3395 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3396 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3397 func_append added_files "$testsbase/$makefile_am$nl" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3398 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3399 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3400 |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3401 if test "$vc_files" != false; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3402 # Update the .cvsignore and .gitignore files. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3403 { echo "$added_files" | sed -e '/^$/d' -e 's,\([^/]*\)$,|A|\1,' |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3404 echo "$removed_files" | sed -e '/^$/d' -e 's,\([^/]*\)$,|R|\1,' |
10252
66f4295bd26d
Put gnulib-comp.m4 into .cvsignore or .gitignore.
Bruno Haible <bruno@clisp.org>
parents:
10250
diff
changeset
|
3405 # Treat gnulib-comp.m4 like an added file, even if it already existed. |
66f4295bd26d
Put gnulib-comp.m4 into .cvsignore or .gitignore.
Bruno Haible <bruno@clisp.org>
parents:
10250
diff
changeset
|
3406 echo "$m4base/|A|gnulib-comp.m4" |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3407 } | LC_ALL=C sort -t'|' -k1,1 > "$tmp"/fileset-changes |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3408 { # Rearrange file descriptors. Needed because "while ... done < ..." |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3409 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3410 exec 5<&0 < "$tmp"/fileset-changes |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3411 func_update_ignorelist () |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3412 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3413 ignore="$1" |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3414 if test "$ignore" = .gitignore; then |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3415 # In a .gitignore file, "foo" applies to the current directory and all |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3416 # subdirectories, whereas "/foo" applies to the current directory only. |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3417 anchor='/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3418 escaped_anchor='\/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3419 doubly_escaped_anchor='\\/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3420 else |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3421 anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3422 escaped_anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3423 doubly_escaped_anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3424 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3425 if test -f "$destdir/$dir$ignore"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3426 if test -n "$dir_added" || test -n "$dir_removed"; then |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3427 sed -e "s|^$anchor||" < "$destdir/$dir$ignore" | LC_ALL=C sort > "$tmp"/ignore |
10379
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
3428 (func_reset_sigpipe |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
3429 echo "$dir_added" | sed -e '/^$/d' | LC_ALL=C sort -u \ |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
3430 | LC_ALL=C join -v 2 "$tmp"/ignore - > "$tmp"/ignore-added |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
3431 echo "$dir_removed" | sed -e '/^$/d' | LC_ALL=C sort -u \ |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
3432 | LC_ALL=C join -v 2 "$tmp"/ignore - > "$tmp"/ignore-removed |
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
3433 ) |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3434 if test -s "$tmp"/ignore-added || test -s "$tmp"/ignore-removed; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3435 if $doit; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3436 echo "Updating $destdir/$dir$ignore (backup in $destdir/$dir${ignore}~)" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3437 mv -f "$destdir/$dir$ignore" "$destdir/$dir$ignore"~ |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3438 { sed -e 's,^,/^,' -e 's,$,\$/d,' < "$tmp"/ignore-removed |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3439 if test -n "$anchor"; then sed -e "s,^,/^${doubly_escaped_anchor}," -e 's,$,\$/d,' < "$tmp"/ignore-removed; fi |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3440 } > "$tmp"/sed-ignore-removed |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3441 { cat "$destdir/$dir$ignore"~ |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3442 sed -e "s|^|$anchor|" < "$tmp"/ignore-added |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3443 } | sed -f "$tmp"/sed-ignore-removed \ |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3444 > "$destdir/$dir$ignore" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3445 else |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3446 echo "Update $destdir/$dir$ignore (backup in $destdir/$dir${ignore}~)" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3447 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3448 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3449 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3450 else |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3451 if test -n "$dir_added"; then |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3452 if $doit; then |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3453 echo "Creating $destdir/$dir$ignore" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3454 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3455 if test "$ignore" = .cvsignore; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3456 echo ".deps" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3457 # Automake generates Makefile rules that create .dirstamp files. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3458 echo ".dirstamp" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3459 fi |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
3460 echo "$dir_added" | sed -e '/^$/d' -e "s|^|$anchor|" | LC_ALL=C sort -u |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3461 } > "$destdir/$dir$ignore" |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3462 else |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3463 echo "Create $destdir/$dir$ignore" |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3464 fi |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3465 fi |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3466 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3467 } |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3468 func_done_dir () |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3469 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3470 dir="$1" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3471 dir_added="$2" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3472 dir_removed="$3" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3473 if test -d "$destdir/CVS" || test -d "$destdir/${dir}CVS" || test -f "$destdir/${dir}.cvsignore"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3474 func_update_ignorelist .cvsignore |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3475 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3476 if test -d "$destdir/.git" || test -f "$destdir/${dir}.gitignore"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3477 func_update_ignorelist .gitignore |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3478 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3479 } |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3480 last_dir= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3481 last_dir_added= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3482 last_dir_removed= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3483 while read line; do |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3484 # Why not ''read next_dir op file'' ? Because the dir column can be empty. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3485 next_dir=`echo "$line" | sed -e 's,|.*,,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3486 op=`echo "$line" | sed -e 's,^[^|]*|\([^|]*\)|.*$,\1,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3487 file=`echo "$line" | sed -e 's,^[^|]*|[^|]*|,,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3488 if test "$next_dir" != "$last_dir"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3489 func_done_dir "$last_dir" "$last_dir_added" "$last_dir_removed" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3490 last_dir="$next_dir" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3491 last_dir_added= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3492 last_dir_removed= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3493 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3494 case $op in |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3495 A) func_append last_dir_added "$file$nl";; |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3496 R) func_append last_dir_removed "$file$nl";; |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3497 esac |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3498 done |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3499 func_done_dir "$last_dir" "$last_dir_added" "$last_dir_removed" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3500 exec 0<&5 5<&- |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3501 } |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3502 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3503 |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3504 echo "Finished." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3505 echo |
5572
54000928a33d
Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents:
5527
diff
changeset
|
3506 echo "You may need to add #include directives for the following .h files." |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3507 # Intersect $specified_modules and $main_modules |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3508 # (since $specified_modules is not necessarily of subset of $main_modules |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3509 # - some may have been skipped through --avoid, and since the elements of |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3510 # $main_modules but not in $specified_modules can go away without explicit |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3511 # notice - through changes in the module dependencies). |
7721
ef2654457d79
Don't show the includes for modules that were not explicitly specified.
Bruno Haible <bruno@clisp.org>
parents:
7701
diff
changeset
|
3512 echo "$specified_modules" > "$tmp"/modules1 # a sorted list, one module per line |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3513 echo "$main_modules" > "$tmp"/modules2 # also a sorted list, one module per line |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3514 # First the #include <...> directives without #ifs, sorted for convenience, |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3515 # then the #include "..." directives without #ifs, sorted for convenience, |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3516 # then the #include directives that are surrounded by #ifs. Not sorted. |
7722 | 3517 for module in `LC_ALL=C join "$tmp"/modules1 "$tmp"/modules2`; do |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3518 include_directive=`func_get_include_directive "$module"` |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3519 case "$nl$include_directive" in |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3520 *"$nl#if"*) |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3521 echo "$include_directive" 1>&5 |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3522 ;; |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3523 *) |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3524 echo "$include_directive" | grep -v 'include "' 1>&6 |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3525 echo "$include_directive" | grep 'include "' 1>&7 |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3526 ;; |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3527 esac |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3528 done 5> "$tmp"/include-if 6> "$tmp"/include-angles 7> "$tmp"/include-quotes |
6756
4d481eff340f
Sort the #include directives more carefully.
Bruno Haible <bruno@clisp.org>
parents:
6750
diff
changeset
|
3529 ( |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3530 LC_ALL=C sort -u "$tmp"/include-angles |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3531 LC_ALL=C sort -u "$tmp"/include-quotes |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3532 cat "$tmp"/include-if |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3533 ) | sed -e '/^$/d' -e 's/^/ /' |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3534 rm -f "$tmp"/include-angles "$tmp"/include-quotes "$tmp"/include-if |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
3535 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3536 for module in $main_modules; do |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3537 func_get_link_directive "$module" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3538 done \ |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3539 | LC_ALL=C sort -u | sed -e '/^$/d' -e 's/^/ /' > "$tmp"/link |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3540 if test `wc -l < "$tmp"/link` != 0; then |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3541 echo |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3542 echo "You may need to use the following Makefile variables when linking." |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3543 echo "Use them in <program>_LDADD when linking a program, or" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3544 echo "in <library>_a_LDFLAGS or <library>_la_LDFLAGS when linking a library." |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3545 cat "$tmp"/link |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3546 fi |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3547 rm -f "$tmp"/link |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
3548 |
5572
54000928a33d
Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents:
5527
diff
changeset
|
3549 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
3550 echo "Don't forget to" |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
3551 if test "$makefile_am" = Makefile.am; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3552 echo " - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in $configure_ac," |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3553 else |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3554 echo " - \"include $makefile_name\" from within \"$sourcebase/Makefile.am\"," |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3555 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3556 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3557 echo " - add \"$pobase/Makefile.in\" to AC_CONFIG_FILES in $configure_ac," |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3558 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3559 if test -n "$inctests"; then |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
3560 if test "$makefile_am" = Makefile.am; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3561 echo " - add \"$testsbase/Makefile\" to AC_CONFIG_FILES in $configure_ac," |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3562 else |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3563 echo " - \"include $makefile_name\" from within \"$testsbase/Makefile.am\"," |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3564 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3565 fi |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3566 edit=0 |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3567 while test $edit != $makefile_am_edits; do |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3568 edit=`expr $edit + 1` |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3569 eval dir=\"\$makefile_am_edit${edit}_dir\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3570 eval var=\"\$makefile_am_edit${edit}_var\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3571 eval val=\"\$makefile_am_edit${edit}_val\" |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3572 if test -n "$var"; then |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3573 echo " - mention \"${val}\" in ${var} in ${dir}Makefile.am," |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3574 fi |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3575 done |
6176 | 3576 echo " - invoke ${macro_prefix}_EARLY in $configure_ac, right after AC_PROG_CC," |
3577 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
|
3578 } |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3579 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3580 # func_create_testdir testdir modules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
3581 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
3582 # - local_gnulib_dir from --local-dir |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
3583 # - 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
|
3584 func_create_testdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3585 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3586 testdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3587 modules="$2" |
7484
57fe575409ae
--create-testdir without module names now means to use nearly all modules.
Bruno Haible <bruno@clisp.org>
parents:
7421
diff
changeset
|
3588 if test -z "$modules"; then |
57fe575409ae
--create-testdir without module names now means to use nearly all modules.
Bruno Haible <bruno@clisp.org>
parents:
7421
diff
changeset
|
3589 # All modules together. |
57fe575409ae
--create-testdir without module names now means to use nearly all modules.
Bruno Haible <bruno@clisp.org>
parents:
7421
diff
changeset
|
3590 # Except config-h, which breaks all modules which use HAVE_CONFIG_H. |
57fe575409ae
--create-testdir without module names now means to use nearly all modules.
Bruno Haible <bruno@clisp.org>
parents:
7421
diff
changeset
|
3591 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME. |
7533
029a26ecb19a
Don't include ftruncate and mountlist by default.
Bruno Haible <bruno@clisp.org>
parents:
7530
diff
changeset
|
3592 # Except ftruncate, mountlist, which abort the configuration on mingw. FIXME. |
7484
57fe575409ae
--create-testdir without module names now means to use nearly all modules.
Bruno Haible <bruno@clisp.org>
parents:
7421
diff
changeset
|
3593 modules=`func_all_modules` |
10157
0c183af9efd5
Undo last commit, as it does not solve the problem entirely.
Bruno Haible <bruno@clisp.org>
parents:
10156
diff
changeset
|
3594 modules=`for m in $modules; do case $m in config-h | fnmatch-posix | ftruncate | mountlist) ;; *) echo $m;; esac; done` |
7484
57fe575409ae
--create-testdir without module names now means to use nearly all modules.
Bruno Haible <bruno@clisp.org>
parents:
7421
diff
changeset
|
3595 fi |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
3596 modules=`for m in $modules; do echo $m; done | LC_ALL=C sort -u` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3597 |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3598 # Check that the license of every module is consistent with the license of |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3599 # its dependencies. |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3600 saved_modules="$modules" |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
3601 saved_inctests="$inctests" |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
3602 # When computing transitive closures, don't consider $module to depend on |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
3603 # $module-tests. Need this becauses tests are implicitly GPL and may depend |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
3604 # on GPL modules - therefore we don't want a warning in this case. |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
3605 inctests="" |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3606 for requested_module in $saved_modules; do |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3607 requested_license=`func_get_license "$requested_module"` |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3608 if test "$requested_license" != GPL; then |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3609 # Here we use func_modules_transitive_closure, not just |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3610 # func_get_dependencies, so that we also detect weird situations like |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3611 # an LGPL module which depends on a GPLed build tool module which depends |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3612 # on a GPL module. |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3613 modules="$requested_module" |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3614 func_modules_transitive_closure |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3615 for module in $modules; do |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3616 license=`func_get_license "$module"` |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3617 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3618 'GPLed build tool') ;; |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3619 'public domain' | 'unlimited' | 'unmodifiable license text') ;; |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3620 *) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3621 case "$requested_license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3622 GPLv2+) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3623 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3624 GPLv2+ | LGPLv2+) ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3625 *) echo "warning: module $requested_module depends on a module with an incompatible license: $module" 1>&2 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3626 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3627 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3628 LGPL) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3629 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3630 LGPL | LGPLv2+) ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3631 *) echo "warning: module $requested_module depends on a module with an incompatible license: $module" 1>&2 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3632 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3633 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3634 LGPLv2+) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3635 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3636 LGPLv2+) ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3637 *) echo "warning: module $requested_module depends on a module with an incompatible license: $module" 1>&2 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3638 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3639 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3640 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
3641 ;; |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3642 esac |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3643 done |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3644 fi |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3645 done |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3646 modules="$saved_modules" |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
3647 inctests="$saved_inctests" |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
3648 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3649 # Subdirectory names. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3650 sourcebase=gllib |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3651 m4base=glm4 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3652 pobase= |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3653 docbase=gldoc |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3654 testsbase=gltests |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3655 macro_prefix=gl |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3656 po_domain= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3657 vc_files= |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3658 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3659 # Determine final module list. |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3660 func_modules_transitive_closure |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3661 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3662 echo "Module list with included dependencies:" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3663 echo "$modules" | sed -e 's/^/ /' |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3664 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3665 |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3666 # 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
|
3667 func_modules_add_dummy |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3668 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3669 # Show banner notice of every module. |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3670 func_modules_notice |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3671 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3672 # Determine final file list. |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3673 func_modules_to_filelist |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3674 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3675 echo "File list:" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3676 echo "$files" | sed -e 's/^/ /' |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3677 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3678 |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3679 sed_rewrite_files="\ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3680 s,^build-aux/,$auxdir/, |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3681 s,^doc/,$docbase/, |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3682 s,^lib/,$sourcebase/, |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3683 s,^m4/,$m4base/, |
9807
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
3684 s,^tests/,$testsbase/, |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
3685 s,^top/,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3686 |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3687 # Create directories. |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3688 for f in $files; do echo $f; done \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3689 | sed -e "$sed_rewrite_files" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3690 | sed -n -e 's,^\(.*\)/[^/]*,\1,p' \ |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3691 | LC_ALL=C sort -u \ |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3692 > "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3693 { # Rearrange file descriptors. Needed because "while ... done < ..." |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3694 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3695 exec 5<&0 < "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3696 while read d; do |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3697 mkdir -p "$testdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3698 done |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3699 exec 0<&5 5<&- |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3700 } |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3701 |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3702 # Copy files or make symbolic links. |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3703 delimiter=' ' |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3704 for f in $files; do echo $f; done \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3705 | sed -e "s,^.*\$,&$delimiter&," -e "$sed_rewrite_files" \ |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3706 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3707 > "$tmp"/files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3708 { # Rearrange file descriptors. Needed because "while ... done < ..." |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3709 # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh. |
7368
a7abebdb07f4
* gnulib-tool (func_import, func_create_testdir): Fix typos in
Eric Blake <ebb9@byu.net>
parents:
7350
diff
changeset
|
3710 exec 5<&0 < "$tmp"/files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3711 while read g f; do |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3712 func_lookup_file "$f" |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3713 if test -n "$lookedup_tmp"; then |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
3714 cp -p "$lookedup_file" "$testdir/$g" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
3715 else |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3716 ln "$lookedup_file" "$testdir/$g" 2>/dev/null || |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
3717 if { test -n "$symbolic" \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
3718 || { test -n "$lsymbolic" \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
3719 && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; }; then |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
3720 func_ln "$lookedup_file" "$testdir/$g" |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
3721 else |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3722 cp -p "$lookedup_file" "$testdir/$g" |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3723 fi |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
3724 fi |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3725 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
3726 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3727 } |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3728 |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3729 # Create Makefile.ams that are for testing. |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3730 for_test=true |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3731 |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3732 # No special edits are needed. |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3733 makefile_am_edits=0 |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3734 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3735 # Create $sourcebase/Makefile.am. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3736 mkdir -p "$testdir/$sourcebase" |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3737 destfile="$sourcebase/Makefile.am" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3738 func_emit_lib_Makefile_am > "$testdir/$sourcebase/Makefile.am" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3739 any_uses_subdirs="$uses_subdirs" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3740 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3741 # Create $m4base/Makefile.am. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3742 mkdir -p "$testdir/$m4base" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3743 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3744 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3745 echo "EXTRA_DIST =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3746 for f in $files; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3747 case "$f" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3748 m4/* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3749 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3750 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3751 done |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3752 ) > "$testdir/$m4base/Makefile.am" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3753 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3754 subdirs="$sourcebase $m4base" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3755 subdirs_with_configure_ac="" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3756 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3757 if false && test -f "$testdir"/$m4base/gettext.m4; then |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3758 # Avoid stupid error message from automake: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3759 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3760 mkdir -p "$testdir/po" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3761 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3762 ) > "$testdir/po/Makefile.am" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3763 func_append subdirs " po" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3764 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3765 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3766 if test -n "$inctests"; then |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3767 test -d "$testdir/$testsbase" || mkdir "$testdir/$testsbase" |
9541
aad8160fa3ef
Fix the value of $auxdir used when generating the tests directory.
Bruno Haible <bruno@clisp.org>
parents:
9540
diff
changeset
|
3768 # Viewed from the $testsbase subdirectory, $auxdir is different. |
aad8160fa3ef
Fix the value of $auxdir used when generating the tests directory.
Bruno Haible <bruno@clisp.org>
parents:
9540
diff
changeset
|
3769 saved_auxdir="$auxdir" |
aad8160fa3ef
Fix the value of $auxdir used when generating the tests directory.
Bruno Haible <bruno@clisp.org>
parents:
9540
diff
changeset
|
3770 auxdir=`echo "$testsbase/"|sed 's%[^/][^/]*//*%../%g'`"$auxdir" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3771 # Create $testsbase/Makefile.am. |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3772 use_libtests=false |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3773 destfile="$testsbase/Makefile.am" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3774 func_emit_tests_Makefile_am > "$testdir/$testsbase/Makefile.am" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3775 any_uses_subdirs="$any_uses_subdirs$uses_subdirs" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3776 # Create $testsbase/configure.ac. |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3777 (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
|
3778 echo "AC_INIT([dummy], [0])" |
9541
aad8160fa3ef
Fix the value of $auxdir used when generating the tests directory.
Bruno Haible <bruno@clisp.org>
parents:
9540
diff
changeset
|
3779 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3780 echo "AM_INIT_AUTOMAKE" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3781 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3782 echo "AM_CONFIG_HEADER([config.h])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3783 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3784 echo "AC_PROG_CC" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3785 echo "AC_PROG_INSTALL" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3786 echo "AC_PROG_MAKE_SET" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3787 echo "AC_PROG_RANLIB" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3788 echo |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3789 if grep AC_GNU_SOURCE "$testdir/$m4base"/*.m4 >/dev/null 2>/dev/null; then |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3790 echo "AC_GNU_SOURCE" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3791 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3792 fi |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3793 for module in $modules; do |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3794 func_verify_module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3795 if test -n "$module"; then |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3796 func_get_autoconf_early_snippet "$module" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3797 fi |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3798 done \ |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3799 | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)\])/\1/' |
7077 | 3800 if test "$libtool" = true; then |
3801 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" | |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3802 echo "gl_cond_libtool=true" |
7077 | 3803 else |
6418
e0a8b9b05999
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6414
diff
changeset
|
3804 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3805 echo "gl_cond_libtool=false" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3806 echo "gl_libdeps=" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3807 echo "gl_ltlibdeps=" |
6414
46d47c8fe734
* gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents:
6389
diff
changeset
|
3808 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3809 # Wrap the set of autoconf snippets into an autoconf macro that is then |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3810 # invoked. This is needed because autoconf does not support AC_REQUIRE |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3811 # at the top level: |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3812 # error: AC_REQUIRE(gt_CSHARPCOMP): cannot be used outside of an AC_DEFUN'd macro |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3813 # but we want the AC_REQUIRE to have its normal meaning (provide one |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3814 # expansion of the required macro before the current point, and only one |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3815 # expansion total). |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3816 echo "AC_DEFUN([gl_INIT], [" |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
3817 sed_replace_build_aux=' |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
3818 :a |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
3819 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ |
9541
aad8160fa3ef
Fix the value of $auxdir used when generating the tests directory.
Bruno Haible <bruno@clisp.org>
parents:
9540
diff
changeset
|
3820 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| |
9009 | 3821 ba |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
3822 }' |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3823 func_emit_initmacro_start $macro_prefix |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3824 # 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
|
3825 # 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
|
3826 # those of the tests. |
7647
c26d75cebcfa
Fix --create-testdir --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
7646
diff
changeset
|
3827 echo "gl_source_base='../$sourcebase'" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3828 for module in $modules; do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3829 func_verify_nontests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3830 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
|
3831 func_get_autoconf_snippet "$module" \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3832 | sed -e "$sed_replace_build_aux" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3833 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3834 done |
7647
c26d75cebcfa
Fix --create-testdir --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
7646
diff
changeset
|
3835 echo "gl_source_base='.'" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3836 for module in $modules; do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3837 func_verify_tests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3838 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
|
3839 func_get_autoconf_snippet "$module" \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3840 | sed -e "$sed_replace_build_aux" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3841 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3842 done |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3843 func_emit_initmacro_end $macro_prefix |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3844 # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3845 # created using libtool, because libtool already handles the dependencies. |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3846 if test "$libtool" != true; then |
9086
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
3847 libname_upper=`echo "$libname" | LC_ALL=C tr 'a-z-' 'A-Z_'` |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3848 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3849 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3850 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3851 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3852 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3853 echo "])" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3854 func_emit_initmacro_done $macro_prefix $sourcebase # FIXME use $sourcebase or $testsbase? |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3855 echo |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3856 echo "gl_INIT" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3857 echo |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3858 # Usually $testsbase/config.h will be a superset of config.h. Verify this |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3859 # by "merging" config.h into $testsbase/config.h; look out for gcc warnings. |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3860 echo "AH_TOP([#include \"../config.h\"])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3861 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3862 echo "AC_OUTPUT([Makefile])" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3863 ) > "$testdir/$testsbase/configure.ac" |
9541
aad8160fa3ef
Fix the value of $auxdir used when generating the tests directory.
Bruno Haible <bruno@clisp.org>
parents:
9540
diff
changeset
|
3864 auxdir="$saved_auxdir" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3865 func_append subdirs " $testsbase" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3866 subdirs_with_configure_ac="$subdirs_with_configure_ac $testsbase" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3867 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3868 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3869 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3870 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3871 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3872 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3873 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3874 echo "SUBDIRS = $subdirs" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3875 echo |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3876 echo "ACLOCAL_AMFLAGS = -I $m4base" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3877 ) > "$testdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3878 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3879 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3880 (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
|
3881 echo "AC_INIT([dummy], [0])" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
3882 if test "$auxdir" != "."; then |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
3883 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
3884 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3885 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3886 echo |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
3887 echo "AM_CONFIG_HEADER([config.h])" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3888 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3889 echo "AC_PROG_CC" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3890 echo "AC_PROG_INSTALL" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3891 echo "AC_PROG_MAKE_SET" |
7106
b9fff044578d
Apply last patch also to --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7105
diff
changeset
|
3892 echo |
7777
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
3893 echo "# For autobuild." |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
3894 echo "AC_CANONICAL_BUILD" |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
3895 echo "AC_CANONICAL_HOST" |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
3896 echo |
7106
b9fff044578d
Apply last patch also to --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7105
diff
changeset
|
3897 echo "m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace" |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3898 echo "m4_pattern_allow([^gl_ES\$])dnl a valid locale name" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3899 echo "m4_pattern_allow([^gl_LIBOBJS\$])dnl a variable" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3900 echo "m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable" |
7106
b9fff044578d
Apply last patch also to --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7105
diff
changeset
|
3901 echo |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3902 echo "AC_PROG_RANLIB" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3903 echo |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3904 if test -n "$any_uses_subdirs"; then |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3905 echo "AM_PROG_CC_C_O" |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3906 echo |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3907 fi |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
3908 if grep AC_GNU_SOURCE "$testdir/$m4base"/*.m4 >/dev/null 2>/dev/null; then |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3909 echo "AC_GNU_SOURCE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3910 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3911 fi |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3912 for module in $modules; do |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3913 func_verify_nontests_module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3914 if test -n "$module"; then |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3915 func_get_autoconf_early_snippet "$module" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3916 fi |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3917 done \ |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
3918 | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)\])/\1/' |
7077 | 3919 if test "$libtool" = true; then |
3920 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" | |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3921 echo "gl_cond_libtool=true" |
7077 | 3922 else |
6418
e0a8b9b05999
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6414
diff
changeset
|
3923 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3924 echo "gl_cond_libtool=false" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3925 echo "gl_libdeps=" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3926 echo "gl_ltlibdeps=" |
6414
46d47c8fe734
* gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents:
6389
diff
changeset
|
3927 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3928 # Wrap the set of autoconf snippets into an autoconf macro that is then |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3929 # invoked. This is needed because autoconf does not support AC_REQUIRE |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3930 # at the top level: |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3931 # error: AC_REQUIRE(gt_CSHARPCOMP): cannot be used outside of an AC_DEFUN'd macro |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3932 # but we want the AC_REQUIRE to have its normal meaning (provide one |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3933 # expansion of the required macro before the current point, and only one |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3934 # expansion total). |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3935 echo "AC_DEFUN([gl_INIT], [" |
6556 | 3936 if test "$auxdir" != "build-aux"; then |
3937 sed_replace_build_aux=' | |
3938 :a | |
3939 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ | |
3940 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| | |
3941 ba | |
3942 }' | |
3943 else | |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
3944 sed_replace_build_aux="$sed_noop" |
6556 | 3945 fi |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3946 func_emit_initmacro_start $macro_prefix |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3947 echo "gl_source_base='$sourcebase'" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3948 for module in $modules; do |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3949 func_verify_nontests_module |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3950 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
|
3951 func_get_autoconf_snippet "$module" \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3952 | sed -e "$sed_replace_build_aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3953 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3954 done |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3955 func_emit_initmacro_end $macro_prefix |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3956 # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3957 # created using libtool, because libtool already handles the dependencies. |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3958 if test "$libtool" != true; then |
9086
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
3959 libname_upper=`echo "$libname" | LC_ALL=C tr 'a-z-' 'A-Z_'` |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3960 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3961 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3962 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3963 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3964 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3965 echo "])" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3966 func_emit_initmacro_done $macro_prefix $sourcebase |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3967 echo |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
3968 echo "gl_INIT" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3969 echo |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3970 if test -n "$subdirs_with_configure_ac"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3971 echo "AC_CONFIG_SUBDIRS(["`echo $subdirs_with_configure_ac`"])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3972 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3973 makefiles="Makefile" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3974 for d in $subdirs; do |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3975 # 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
|
3976 # 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
|
3977 case " $subdirs_with_configure_ac " in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3978 *" $d "*) ;; |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3979 *) func_append makefiles " $d/Makefile" ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3980 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3981 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3982 echo "AC_OUTPUT([$makefiles])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3983 ) > "$testdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3984 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3985 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3986 (cd "$testdir" |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3987 # Do not use "${AUTORECONF} --force --install", because it may invoke |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3988 # autopoint, which brings in older versions of some of our .m4 files. |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3989 if test -f $m4base/gettext.m4; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3990 func_execute_command ${AUTOPOINT} --force || func_exit 1 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3991 for f in $m4base/*.m4~; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3992 mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3993 done |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3994 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3995 func_execute_command ${ACLOCAL} -I $m4base || func_exit 1 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3996 if ! test -d build-aux; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3997 func_execute_command mkdir build-aux || func_exit 1 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
3998 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3999 func_execute_command ${AUTOCONF} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4000 func_execute_command ${AUTOHEADER} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4001 func_execute_command ${AUTOMAKE} --add-missing --copy || func_exit 1 |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4002 ) || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4003 if test -n "$inctests"; then |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4004 # Create autogenerated files. |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4005 (cd "$testdir/$testsbase" || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4006 # Do not use "${AUTORECONF} --force --install", because it may invoke |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4007 # autopoint, which brings in older versions of some of our .m4 files. |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4008 if test -f ../$m4base/gettext.m4; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4009 func_execute_command ${AUTOPOINT} --force || func_exit 1 |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4010 for f in ../$m4base/*.m4~; do |
9009 | 4011 mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4012 done |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4013 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4014 func_execute_command ${ACLOCAL} -I ../$m4base || func_exit 1 |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4015 if ! test -d ../build-aux; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4016 func_execute_command mkdir ../build-aux |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4017 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4018 func_execute_command ${AUTOCONF} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4019 func_execute_command ${AUTOHEADER} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4020 func_execute_command ${AUTOMAKE} --add-missing --copy || func_exit 1 |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4021 ) || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4022 fi |
7866
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4023 # Need to run configure and make once, to create built files that are to be |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4024 # distributed (such as getdate.c). |
8410
bf7fdc3211a4
Avoiding the "./configure && make && make distclean" did not work most of the
Bruno Haible <bruno@clisp.org>
parents:
8356
diff
changeset
|
4025 # Extract the value of "CLEANFILES += ..." and "MOSTLYCLEANFILES += ...". |
7866
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4026 cleaned_files=`sed -e "$sed_remove_backslash_newline" < "$testdir/$sourcebase/Makefile.am" \ |
8503
7c0e7f4f1ac1
* gnulib-tool: Rearrange space-tab sequences, since some editors
Eric Blake <ebb9@byu.net>
parents:
8451
diff
changeset
|
4027 | sed -n -e 's,^CLEANFILES[ ]*+=\([^#]*\).*$,\1,p' -e 's,^MOSTLYCLEANFILES[ ]*+=\([^#]*\).*$,\1,p'` |
8410
bf7fdc3211a4
Avoiding the "./configure && make && make distclean" did not work most of the
Bruno Haible <bruno@clisp.org>
parents:
8356
diff
changeset
|
4028 cleaned_files=`for file in $cleaned_files; do echo " $file "; done` |
7866
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4029 # Extract the value of "BUILT_SOURCES += ...". Remove variable references |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4030 # such $(FOO_H) because they don't refer to distributed files. |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4031 sed_remove_make_variables='s,[$]([A-Za-z0-9_]*),,g' |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4032 built_sources=`sed -e "$sed_remove_backslash_newline" < "$testdir/$sourcebase/Makefile.am" \ |
8503
7c0e7f4f1ac1
* gnulib-tool: Rearrange space-tab sequences, since some editors
Eric Blake <ebb9@byu.net>
parents:
8451
diff
changeset
|
4033 | sed -n -e 's,^BUILT_SOURCES[ ]*+=\([^#]*\).*$,\1,p' \ |
7866
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4034 | sed -e "$sed_remove_make_variables"` |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4035 distributed_built_sources=`for file in $built_sources; do |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4036 case "$cleaned_files" in |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4037 *" "$file" "*) ;; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4038 *) echo $file ;; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4039 esac; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4040 done` |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
4041 if test -n "$distributed_built_sources"; then |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4042 (cd "$testdir" |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4043 ./configure || func_exit 1 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4044 cd "$sourcebase" |
6389
c1766dccfd4f
Simplification, from Stepan Kasal.
Bruno Haible <bruno@clisp.org>
parents:
6380
diff
changeset
|
4045 echo 'built_sources: $(BUILT_SOURCES)' >> Makefile |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4046 make built_sources || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4047 cd .. |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4048 make distclean || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4049 ) || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4050 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4051 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4052 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4053 # func_create_megatestdir megatestdir allmodules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
4054 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
4055 # - local_gnulib_dir from --local-dir |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
4056 # - 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
|
4057 func_create_megatestdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4058 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4059 megatestdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4060 allmodules="$2" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4061 if test -z "$allmodules"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4062 allmodules=`func_all_modules` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4063 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4064 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4065 megasubdirs= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4066 # First, all modules one by one. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4067 for onemodule in $allmodules; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4068 func_create_testdir "$megatestdir/$onemodule" $onemodule |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4069 func_append megasubdirs "$onemodule " |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4070 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4071 # Then, all modules all together. |
7350
6c5c8c8b93a3
Don't include the config-h module in megatestdir.
Bruno Haible <bruno@clisp.org>
parents:
7348
diff
changeset
|
4072 # Except config-h, which breaks all modules which use HAVE_CONFIG_H. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4073 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME. |
10157
0c183af9efd5
Undo last commit, as it does not solve the problem entirely.
Bruno Haible <bruno@clisp.org>
parents:
10156
diff
changeset
|
4074 allmodules=`for m in $allmodules; do if test $m != config-h && test $m != fnmatch-posix; then echo $m; fi; done` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4075 func_create_testdir "$megatestdir/ALL" "$allmodules" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4076 func_append megasubdirs "ALL" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4077 |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4078 # Create autobuild. |
9377
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
4079 cvsdate=`if test -f "$gnulib_dir/CVS/Entries"; then \ |
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
4080 vc_witness="$gnulib_dir/CVS/Entries"; \ |
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
4081 else \ |
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
4082 vc_witness="$gnulib_dir/.git/refs/heads/master"; \ |
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
4083 fi; \ |
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
4084 sh "$gnulib_dir/build-aux/mdate-sh" "$vc_witness" \ |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4085 | sed -e 's,January,01,' -e 's,Jan,01,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4086 -e 's,February,02,' -e 's,Feb,02,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4087 -e 's,March,03,' -e 's,Mar,03,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4088 -e 's,April,04,' -e 's,Apr,04,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4089 -e 's,May,05,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4090 -e 's,June,06,' -e 's,Jun,06,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4091 -e 's,July,07,' -e 's,Jul,07,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4092 -e 's,August,08,' -e 's,Aug,08,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4093 -e 's,September,09,' -e 's,Sep,09,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4094 -e 's,October,10,' -e 's,Oct,10,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4095 -e 's,November,11,' -e 's,Nov,11,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4096 -e 's,December,12,' -e 's,Dec,12,' \ |
9022
44509698ba9d
* gnulib-tool: Fix indentation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9010
diff
changeset
|
4097 -e 's,^,00,' -e 's,^[0-9]*\([0-9][0-9] \),\1,' \ |
9005
e04f36b292ad
* gnulib-tool (IFS): Initialize early, so we don't set it to
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9003
diff
changeset
|
4098 -e 's,^\([0-9]*\) \([0-9]*\) \([0-9]*\),\3\2\1,'` |
8418
6840759b4ce2
Start the autobuild script with /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
8416
diff
changeset
|
4099 (echo '#!/bin/sh' |
6840759b4ce2
Start the autobuild script with /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
8416
diff
changeset
|
4100 echo "CVSDATE=$cvsdate" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4101 echo "test -d logs || mkdir logs" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4102 echo "for module in $megasubdirs; do" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4103 echo " echo \"Working on module \$module...\"" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4104 echo " safemodule=\`echo \$module | sed -e 's|/|-|g'\`" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4105 echo " (echo \"To: gnulib@autobuild.josefsson.org\"" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4106 echo " echo" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4107 echo " set -x" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4108 echo " : autobuild project... \$module" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4109 echo " : autobuild revision... cvs-\$CVSDATE-000000" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4110 echo " : autobuild timestamp... \`date \"+%Y%m%d-%H%M%S\"\`" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4111 echo " : autobuild hostname... \`hostname\`" |
8432
2c533460124b
Request a "make distclean" after successful "make check", to save disk space.
Bruno Haible <bruno@clisp.org>
parents:
8419
diff
changeset
|
4112 echo " cd \$module && ./configure \$CONFIGURE_OPTIONS && make && make check && make distclean" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4113 echo " echo rc=\$?" |
8419
d5e85ac6458c
Avoid using sed -e "", not supported by AIX sed.
Bruno Haible <bruno@clisp.org>
parents:
8418
diff
changeset
|
4114 echo " ) 2>&1 | { if test -n \"\$AUTOBUILD_SUBST\"; then sed -e \"\$AUTOBUILD_SUBST\"; else cat; fi; } > logs/\$safemodule" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4115 echo "done" |
8672
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
4116 ) > "$megatestdir/do-autobuild" |
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
4117 chmod a+x "$megatestdir/do-autobuild" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4118 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4119 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4120 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4121 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4122 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4123 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4124 echo "SUBDIRS = $megasubdirs" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
4125 echo |
8672
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
4126 echo "EXTRA_DIST = do-autobuild" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4127 ) > "$megatestdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4128 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4129 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4130 (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
|
4131 echo "AC_INIT([dummy], [0])" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
4132 if test "$auxdir" != "."; then |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
4133 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
4134 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4135 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4136 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4137 echo "AC_PROG_MAKE_SET" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4138 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4139 echo "AC_CONFIG_SUBDIRS([$megasubdirs])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4140 echo "AC_OUTPUT([Makefile])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4141 ) > "$megatestdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4142 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4143 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4144 (cd "$megatestdir" |
6547
1a65fb7ddbbb
Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents:
6546
diff
changeset
|
4145 # 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
|
4146 # 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
|
4147 # calling autoreconf here would only waste lots of CPU time. |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4148 func_execute_command ${ACLOCAL} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4149 func_execute_command mkdir build-aux |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4150 func_execute_command ${AUTOCONF} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4151 func_execute_command ${AUTOMAKE} --add-missing --copy || func_exit 1 |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4152 ) || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4153 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4154 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4155 case $mode in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4156 "" ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4157 func_fatal_error "no mode specified" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4158 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4159 list ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4160 func_all_modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4161 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4162 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
4163 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
|
4164 |
5343 | 4165 # Where to import. |
4166 if test -z "$destdir"; then | |
4167 destdir=. | |
4168 fi | |
4169 test -d "$destdir" \ | |
4170 || 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
|
4171 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4172 # 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
|
4173 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
|
4174 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
|
4175 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4176 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
|
4177 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
|
4178 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4179 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
|
4180 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4181 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4182 |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4183 # Analyze configure.ac. |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4184 guessed_auxdir="." |
7077 | 4185 guessed_libtool=false |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4186 my_sed_traces=' |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4187 s,#.*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4188 s,^dnl .*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4189 s, dnl .*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4190 /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
|
4191 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
|
4192 } |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4193 /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
|
4194 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
|
4195 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4196 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
|
4197 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4198 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
|
4199 auxdir="$guessed_auxdir" |
5343 | 4200 fi |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
4201 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4202 # 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
|
4203 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
|
4204 # 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
|
4205 # Any number of additional modules can be given. |
6204
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
4206 if test ! -f "$destdir/$m4base"/gnulib-cache.m4; then |
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
4207 # First use of gnulib in the given m4base. |
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
4208 test -n "$supplied_libname" || supplied_libname=true |
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
4209 test -n "$sourcebase" || sourcebase="lib" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
4210 test -n "$docbase" || docbase="doc" |
6262
bef30dac846f
Provide a default for --tests-base.
Bruno Haible <bruno@clisp.org>
parents:
6250
diff
changeset
|
4211 test -n "$testsbase" || testsbase="tests" |
6204
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
4212 test -n "$macro_prefix" || macro_prefix="gl" |
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
4213 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4214 func_import "$*" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4215 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4216 # 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
|
4217 # 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
|
4218 # 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
|
4219 # "find $destdir -name gnulib-cache.m4", as it might be too expensive.) |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4220 m4dirs= |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4221 m4dirs_count=0 |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4222 if test -f "$destdir"/Makefile.am; then |
8040
3905dae579b6
* gnulib-tool (func_emit_lib_Makefile_am, func_add_or_update)
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7981
diff
changeset
|
4223 aclocal_amflags=`sed -n 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/p' "$destdir"/Makefile.am` |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4224 m4dir_is_next= |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4225 for arg in $aclocal_amflags; do |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4226 if test -n "$m4dir_is_next"; then |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4227 # Ignore absolute directory pathnames, like /usr/local/share/aclocal. |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4228 case "$arg" in |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4229 /*) ;; |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4230 *) |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4231 if test -f "$destdir/$arg"/gnulib-cache.m4; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4232 func_append m4dirs " $arg" |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4233 m4dirs_count=`expr $m4dirs_count + 1` |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4234 fi |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4235 ;; |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4236 esac |
8040
3905dae579b6
* gnulib-tool (func_emit_lib_Makefile_am, func_add_or_update)
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7981
diff
changeset
|
4237 m4dir_is_next= |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4238 else |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4239 if test "X$arg" = "X-I"; then |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4240 m4dir_is_next=yes |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4241 else |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4242 m4dir_is_next= |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4243 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4244 fi |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4245 done |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4246 else |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4247 # No Makefile.am! Oh well. Look at the last generated aclocal.m4. |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4248 if test -f "$destdir"/aclocal.m4; then |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4249 sedexpr1='s,^m4_include(\[\(.*\)])$,\1,p' |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4250 sedexpr2='s,^[^/]*$,.,' |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4251 sedexpr3='s,/[^/]*$,,' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4252 m4dirs=`sed -n -e "$sedexpr1" aclocal.m4 | sed -e "$sedexpr2" -e "$sedexpr3" | LC_ALL=C sort -u` |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4253 m4dirs_count=`echo "$m4dirs" | wc -l` |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4254 fi |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
4255 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4256 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
|
4257 # 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
|
4258 # 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
|
4259 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
|
4260 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
|
4261 m4base="m4" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
4262 test -n "$docbase" || docbase="doc" |
6262
bef30dac846f
Provide a default for --tests-base.
Bruno Haible <bruno@clisp.org>
parents:
6250
diff
changeset
|
4263 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
|
4264 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
|
4265 func_import "$*" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4266 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4267 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
|
4268 # 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
|
4269 # 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
|
4270 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
|
4271 func_import "$*" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4272 done |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4273 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4274 # 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
|
4275 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
|
4276 # 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
|
4277 for m4base in $m4dirs; do |
7239
e6f5fe9992ff
Fix problem when calling "gnulib-tool --update" on multiple directories.
Bruno Haible <bruno@clisp.org>
parents:
7235
diff
changeset
|
4278 # Perform func_import in a subshell, so that variable values |
e6f5fe9992ff
Fix problem when calling "gnulib-tool --update" on multiple directories.
Bruno Haible <bruno@clisp.org>
parents:
7235
diff
changeset
|
4279 # such as |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4280 # local_gnulib_dir, avoidlist, sourcebase, m4base, pobase, |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4281 # docbase, testsbase, inctests, libname, lgpl, makefile_name, |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4282 # libtool, macro_prefix, po_domain, vc_files |
7239
e6f5fe9992ff
Fix problem when calling "gnulib-tool --update" on multiple directories.
Bruno Haible <bruno@clisp.org>
parents:
7235
diff
changeset
|
4283 # don't propagate from one directory to another. |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
4284 (func_import) || func_exit 1 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4285 done |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4286 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4287 # Really ambiguous. |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4288 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
|
4289 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4290 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
4291 fi |
6178 | 4292 fi |
5343 | 4293 ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4294 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4295 create-testdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4296 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4297 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4298 fi |
4126
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
4299 mkdir "$destdir" |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
4300 test -d "$destdir" \ |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
4301 || func_fatal_error "could not create destination directory" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
4302 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4303 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4304 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4305 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4306 create-megatestdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4307 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4308 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4309 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4310 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
|
4311 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4312 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4313 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4314 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4315 test ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4316 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4317 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
|
4318 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4319 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4320 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4321 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4322 cd build |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4323 ../configure || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4324 make || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4325 make check || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
4326 make distclean || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4327 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4328 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4329 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4330 echo "gnulib-tool: *** Stop." 1>&2 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
4331 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4332 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4333 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4334 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4335 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4336 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4337 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4338 megatest ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4339 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4340 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
|
4341 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4342 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4343 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4344 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4345 cd build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4346 ../configure |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4347 make |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4348 make check |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4349 make distclean |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4350 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4351 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4352 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4353 echo "gnulib-tool: *** Stop." 1>&2 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
4354 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4355 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4356 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4357 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4358 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4359 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4360 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4361 extract-description ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4362 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4363 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4364 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4365 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4366 func_get_description "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4367 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4368 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4369 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4370 |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4371 extract-status ) |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4372 for module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4373 do |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4374 func_verify_module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4375 if test -n "$module"; then |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4376 func_get_status "$module" |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4377 fi |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4378 done |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4379 ;; |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
4380 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4381 extract-notice ) |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4382 for module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4383 do |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4384 func_verify_module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4385 if test -n "$module"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4386 func_get_notice "$module" |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4387 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4388 done |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4389 ;; |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4390 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4391 extract-filelist ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4392 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4393 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4394 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4395 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4396 func_get_filelist "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4397 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4398 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4399 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4400 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4401 extract-dependencies ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4402 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4403 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4404 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4405 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4406 func_get_dependencies "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4407 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4408 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4409 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4410 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4411 extract-autoconf-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4412 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4413 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4414 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4415 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4416 func_get_autoconf_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4417 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4418 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4419 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4420 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4421 extract-automake-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4422 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4423 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4424 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4425 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4426 func_get_automake_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4427 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4428 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4429 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4430 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4431 extract-include-directive ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4432 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4433 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4434 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4435 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4436 func_get_include_directive "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4437 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4438 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4439 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4440 |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4441 extract-link-directive ) |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4442 for module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4443 do |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4444 func_verify_module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4445 if test -n "$module"; then |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4446 func_get_link_directive "$module" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4447 fi |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4448 done |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4449 ;; |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4450 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4451 extract-license ) |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4452 for module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4453 do |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4454 func_verify_module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4455 if test -n "$module"; then |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4456 func_get_license "$module" |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4457 fi |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4458 done |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4459 ;; |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
4460 |
4197 | 4461 extract-maintainer ) |
4462 for module | |
4463 do | |
4464 func_verify_module | |
4465 if test -n "$module"; then | |
4466 func_get_maintainer "$module" | |
4467 fi | |
4468 done | |
4469 ;; | |
4470 | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4471 extract-tests-module ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4472 for module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4473 do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4474 func_verify_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4475 if test -n "$module"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4476 func_get_tests_module "$module" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4477 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4478 done |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4479 ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4480 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4481 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4482 func_fatal_error "unknown operation mode --$mode" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4483 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4484 |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
4485 rm -rf "$tmp" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
4486 # Undo the effect of the previous 'trap' command. Some shellology: |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
4487 # We cannot use "trap - 0 1 2 3 13 15", because Solaris sh would attempt to |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
4488 # execute the command "-". "trap '' ..." is fine only for signal 0 (= normal |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
4489 # exit); for the others we need to call 'exit' explicitly. The value of $? is |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
4490 # 128 + signal number and is set before the trap-registered command is run. |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
4491 trap '' 0 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
4492 trap 'func_exit $?' 1 2 3 13 15 |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
4493 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4494 exit 0 |
7241
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
4495 |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
4496 # Local Variables: |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
4497 # indent-tabs-mode: nil |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
4498 # whitespace-check-buffer-indent: nil |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
4499 # End: |