Mercurial > hg > octave-nkf > gnulib-hg
annotate gnulib-tool @ 13632:09362ffa0085
gnulib-tool: Avoid error when run in a package without Makefile.am.
* gnulib-tool: When collecting the m4dirs in a package that does not
have a Makefile.am, eliminate those directories that contain no
gnulib-cache.m4.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 04 Sep 2010 17:38:58 +0200 |
parents | c2d737898a4e |
children | 38f90e1a26c2 |
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 # |
12559
c2cbabec01dd
update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents:
12460
diff
changeset
|
3 # Copyright (C) 2002-2010 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 |
12978
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
43 # You can set LIBTOOLPATH to empty if libtoolize 2.x is already in your PATH. |
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
44 LIBTOOLPATH= |
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
45 |
6551
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
46 # 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
|
47 # 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
|
48 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
|
49 AUTOCONF="${AUTOCONFPATH}autoconf" |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
50 fi |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
51 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
|
52 AUTOHEADER="${AUTOCONFPATH}autoheader" |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
53 fi |
6551
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
54 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
|
55 ACLOCAL="${AUTOMAKEPATH}aclocal" |
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 "${AUTOMAKE}" || test -n "${AUTOMAKEPATH}"; then |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
58 AUTOMAKE="${AUTOMAKEPATH}automake" |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
59 fi |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
60 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
|
61 AUTORECONF="${AUTOCONFPATH}autoreconf" |
d37637700b4e
Make the AUTOCONF etc. commands overridable by the user.
Bruno Haible <bruno@clisp.org>
parents:
6550
diff
changeset
|
62 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
64 # 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
|
65 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
|
66 AUTOPOINT="${GETTEXTPATH}autopoint" |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
67 fi |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
68 |
12978
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
69 # If you didn't set LIBTOOLPATH, you can also set the variable LIBTOOLIZE. |
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
70 if test -z "${LIBTOOLIZE}" || test -n "${LIBTOOLPATH}"; then |
12979
845824c37d6a
gnulib-tool (LIBTOOLPATH): Fix cut'n'paste bug.
Simon Josefsson <simon@josefsson.org>
parents:
12978
diff
changeset
|
71 LIBTOOLIZE="${LIBTOOLPATH}libtoolize" |
12978
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
72 fi |
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
73 |
11404
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
74 # You can set MAKE. |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
75 if test -z "${MAKE}"; then |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
76 MAKE=make |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
77 fi |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
78 |
11249
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
79 # When using GNU sed, turn off as many GNU extensions as possible, |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
80 # to minimize the risk of accidentally using non-portable features. |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
81 # However, do this only for gnulib-tool itself, not for the code that |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
82 # gnulib-tool generates, since we don't want "sed --posix" to leak |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
83 # into makefiles. And do it only for sed versions 4.2 or newer, |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
84 # because "sed --posix" is buggy in GNU sed 4.1.5, see |
11231
30f41a946fb0
Don't use "sed --posix", since it is buggy.
Bruno Haible <bruno@clisp.org>
parents:
11094
diff
changeset
|
85 # <http://lists.gnu.org/archive/html/bug-gnulib/2009-02/msg00225.html>. |
11249
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
86 if (alias) > /dev/null 2>&1 \ |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
87 && echo | sed --posix -e d >/dev/null 2>&1 \ |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
88 && case `sed --version | sed -e 's/^[^0-9]*//' -e 1q` in \ |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
89 [1-3]* | 4.[01]*) false;; \ |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
90 *) true;; \ |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
91 esac \ |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
92 ; then |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
93 # Define sed as an alias. |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
94 # It is not always possible to use aliases. Aliases are guaranteed to work |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
95 # if the executing shell is bash and either it is invoked as /bin/sh or |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
96 # is a version >= 2.0, supporting shopt. This is the common case. |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
97 # Two other approaches (use of a variable $sed or of a function func_sed |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
98 # instead of an alias) require massive, fragile code changes. |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
99 # An other approach (use of function sed) requires `which sed` - but |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
100 # 'which' is hard to emulate, due to missing "test -x" on some platforms. |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
101 if test -n "$BASH_VERSION"; then |
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
102 shopt -s expand_aliases >/dev/null 2>&1 |
9213
6c916785c03e
Try harder to enable the alias for 'sed'.
Bruno Haible <bruno@clisp.org>
parents:
9189
diff
changeset
|
103 fi |
11249
0a95b8deac2e
Re-enable the use of "sed --posix" with sed >= 4.2.
Bruno Haible <bruno@clisp.org>
parents:
11232
diff
changeset
|
104 alias sed='sed --posix' |
7737
19ff03763d73
Use "sed --posix" instead of "sed" when possible.
Bruno Haible <bruno@clisp.org>
parents:
7722
diff
changeset
|
105 fi |
19ff03763d73
Use "sed --posix" instead of "sed" when possible.
Bruno Haible <bruno@clisp.org>
parents:
7722
diff
changeset
|
106 |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
107 # sed_noop is a sed expression that does nothing. |
10401 | 108 # 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
|
109 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
|
110 |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
111 # sed_comments is true or false, depending whether 'sed' supports comments. |
13562
f304978fb062
Fix gnulib-tool sed script de-commentation for AIX sed.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
13420
diff
changeset
|
112 # AIX 5.3 sed barfs over indented comments. |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
113 if echo fo | sed -e 's/f/g/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
114 # s/o/u/ |
13562
f304978fb062
Fix gnulib-tool sed script de-commentation for AIX sed.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
13420
diff
changeset
|
115 # indented comment |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
116 s/o/e/' 2>/dev/null | grep ge > /dev/null; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
117 sed_comments=true |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
118 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
119 sed_comments=false |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
120 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
121 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
122 # func_usage |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
123 # outputs to stdout the --help usage message. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
124 func_usage () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
125 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
126 echo "\ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
127 Usage: gnulib-tool --list |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
128 gnulib-tool --find filename |
5344
c2f5677fc6ed
Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents:
5343
diff
changeset
|
129 gnulib-tool --import [module1 ... moduleN] |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
130 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
|
131 gnulib-tool --create-testdir --dir=directory [module1 ... moduleN] |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
132 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN] |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
133 gnulib-tool --test --dir=directory module1 ... moduleN |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
134 gnulib-tool --megatest --dir=directory [module1 ... moduleN] |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
135 gnulib-tool --extract-description module |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
136 gnulib-tool --extract-comment module |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
137 gnulib-tool --extract-status module |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
138 gnulib-tool --extract-notice module |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
139 gnulib-tool --extract-applicability module |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
140 gnulib-tool --extract-filelist module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
141 gnulib-tool --extract-dependencies module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
142 gnulib-tool --extract-autoconf-snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
143 gnulib-tool --extract-automake-snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
144 gnulib-tool --extract-include-directive module |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
145 gnulib-tool --extract-link-directive module |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
146 gnulib-tool --extract-license module |
4197 | 147 gnulib-tool --extract-maintainer module |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
148 gnulib-tool --extract-tests-module module |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
149 gnulib-tool --copy-file file [destination] |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
150 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
151 Operation modes: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
152 --list print the available module names |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
153 --find find the modules which contain the specified file |
6633
5118aa463328
* gnulib-tool (Usage): Fix --import, from
Simon Josefsson <simon@josefsson.org>
parents:
6614
diff
changeset
|
154 --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
|
155 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
|
156 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
|
157 --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
|
158 from CVS |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
159 --create-testdir create a scratch package with the given modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
160 --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
|
161 one by one and all together |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
162 --test test the combination of the given modules |
4197 | 163 (recommended to use CC=\"gcc -Wall\" here) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
164 --megatest test the given modules one by one and all together |
4197 | 165 (recommended to use CC=\"gcc -Wall\" here) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
166 --extract-description extract the description |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
167 --extract-comment extract the comment |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
168 --extract-status extract the status (obsolete etc.) |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
169 --extract-notice extract the notice or banner |
13069
5a91813baecc
Addendum to 2010-02-07 commit.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
170 --extract-applicability extract the applicability |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
171 --extract-filelist extract the list of files |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
172 --extract-dependencies extract the dependencies |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
173 --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
|
174 --extract-automake-snippet extract the snippet for library makefile |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
175 --extract-include-directive extract the #include directive |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
176 --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
|
177 --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
|
178 under lib/ |
4197 | 179 --extract-maintainer report the maintainer(s) inside gnulib |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
180 --extract-tests-module report the unit test module, if it exists |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
181 --copy-file copy a file that is not part of any module |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
182 |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
183 General options: |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
184 --dir=DIRECTORY Specify the target directory. |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
185 For --import, this specifies where your |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
186 configure.ac can be found. Defaults to current |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
187 directory. |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
188 --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
|
189 up files before looking in gnulib's directory. |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
190 --cache-modules Enable module caching optimization. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
191 --no-cache-modules Disable module caching optimization. |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
192 --verbose Increase verbosity. May be repeated. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
193 --quiet Decrease verbosity. May be repeated. |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
194 |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
195 Options for --import, --update: |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
196 --dry-run Only print what would have been done. |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
197 |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
198 Options for --import, --create-[mega]testdir, --[mega]test: |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
199 --with-tests Include unit tests for the included modules. |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
200 --with-obsolete Include obsolete modules when they occur among the |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
201 dependencies. By default, dependencies to obsolete |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
202 modules are ignored. |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
203 --with-c++-tests Include even unit tests for C++ interoperability. |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
204 --with-longrunning-tests |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
205 Include even unit tests that are long-runners. |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
206 --with-privileged-tests |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
207 Include even unit tests that require root |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
208 privileges. |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
209 --with-unportable-tests |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
210 Include even unit tests that fail on some platforms. |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
211 --with-all-tests Include all kinds of problematic unit tests. |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
212 --avoid=MODULE Avoid including the given MODULE. Useful if you |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
213 have code that provides equivalent functionality. |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
214 This option can be repeated. |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
215 --libtool Use libtool rules. |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
216 --no-libtool Don't use libtool rules. |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
217 |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
218 Options for --import: |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
219 --lib=LIBRARY Specify the library name. Defaults to 'libgnu'. |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
220 --source-base=DIRECTORY |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
221 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
|
222 placed (default \"lib\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
223 --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
|
224 placed (default \"m4\"). |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
225 --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
|
226 placed (default \"po\"). |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
227 --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
|
228 placed (default \"doc\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
229 --tests-base=DIRECTORY |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
230 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
|
231 placed (default \"tests\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
232 --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
|
233 tools are placed (default \"build-aux\"). |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
234 --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
|
235 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
|
236 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
|
237 the default is currently LGPLv3. |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
238 --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
|
239 source-base and tests-base directories |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
240 (default \"Makefile.am\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
241 --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
|
242 'gl_INIT'. Default is 'gl'. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
243 --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
|
244 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
|
245 --vc-files Update version control related files. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
246 --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
|
247 (.gitignore and/or .cvsignore). |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
248 --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
|
249 |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
250 Options for --create-[mega]testdir, --[mega]test: |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
251 --without-c++-tests Exclude unit tests for C++ interoperability. |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
252 --without-longrunning-tests |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
253 Exclude unit tests that are long-runners. |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
254 --without-privileged-tests |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
255 Exclude unit tests that require root privileges. |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
256 --without-unportable-tests |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
257 Exclude unit tests that fail on some platforms. |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
258 |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
259 Options for --import, --update, --create-[mega]testdir, --[mega]test: |
6966 | 260 -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
|
261 --local-symlink Make symbolic links instead of copying files, only |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
262 for files from the local override directory. |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
263 |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
264 Options for --import, --update: |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
265 -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
|
266 don't replace copyright notices. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
267 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
268 Report bugs to <bug-gnulib@gnu.org>." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
269 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
270 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
271 # func_version |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
272 # outputs to stdout the --version message. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
273 func_version () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
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 |
9805
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
276 if test -d "$gnulib_dir"/.git \ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
277 && (git --version) >/dev/null 2>/dev/null \ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
278 && (date --version) >/dev/null 2>/dev/null; then |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
279 # gnulib checked out from git. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
280 sed_extract_first_date='/^Date/{ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
281 s/^Date:[ ]*//p |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
282 q |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
283 }' |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
284 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
|
285 # 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
|
286 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
|
287 date=`echo "$date" | sed -e "$sed_year_before_time"` |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
288 # Use GNU date to compute the time in GMT. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
289 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
|
290 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
|
291 else |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
292 if test -d "$gnulib_dir"/CVS \ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
293 && (cvs --version) >/dev/null 2>/dev/null; then |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
294 # gnulib checked out from CVS. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
295 sed_extract_first_date='/^date: /{ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
296 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
|
297 q |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
298 }' |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
299 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
|
300 else |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
301 # gnulib copy without versioning information. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
302 date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog` |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
303 fi |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
304 version= |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
305 fi |
12417 | 306 year=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed -e 's,^.* ,,'` |
7347
d86464f614f7
* gnulib-tool (func_version): Create output all at once. This
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7335
diff
changeset
|
307 echo "\ |
9805
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
308 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
|
309 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
|
310 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
|
311 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
|
312 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
|
313 |
7347
d86464f614f7
* gnulib-tool (func_version): Create output all at once. This
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7335
diff
changeset
|
314 Written by" "Bruno Haible" "and" "Simon Josefsson" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
315 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
316 |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
317 # func_emit_copyright_notice |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
318 # 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
|
319 func_emit_copyright_notice () |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
320 { |
12417 | 321 sed -n -e '/Copyright/ { |
322 p | |
323 q | |
324 }' < "$self_abspathname" | |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
325 echo "#" |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
326 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
|
327 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
|
328 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
|
329 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
|
330 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
|
331 echo "#" |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
332 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
|
333 } |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
334 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
335 # func_exit STATUS |
10453 | 336 # exits with a given status. |
337 # This function needs to be used, rather than 'exit', when a 'trap' handler is | |
338 # 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
|
339 func_exit () |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
340 { |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
341 (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
|
342 } |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
343 |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
344 # func_gnulib_dir |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
345 # 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
|
346 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
347 # - 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
|
348 # Sets variables |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
349 # - 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
|
350 # - 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
|
351 func_gnulib_dir () |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
352 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
353 case "$progname" in |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
354 /*) self_abspathname="$progname" ;; |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
355 */*) self_abspathname=`pwd`/"$progname" ;; |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
356 *) |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
357 # Look in $PATH. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
358 # 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
|
359 # We use IFS=: instead of |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
360 # 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
|
361 # 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
|
362 # 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
|
363 # 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
|
364 # 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
|
365 # - /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
|
366 # 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
|
367 # - /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
|
368 # 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
|
369 # - 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
|
370 # 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
|
371 # 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
|
372 # 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
|
373 self_abspathname= |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
374 if test "${PATH_SEPARATOR+set}" != set; then |
13625
c2d737898a4e
Set PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
13562
diff
changeset
|
375 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which |
c2d737898a4e
Set PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
13562
diff
changeset
|
376 # contains only /bin. Note that ksh looks also at the FPATH variable, |
c2d737898a4e
Set PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
13562
diff
changeset
|
377 # so we have to set that as well for the test. |
c2d737898a4e
Set PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
13562
diff
changeset
|
378 PATH_SEPARATOR=: |
c2d737898a4e
Set PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
13562
diff
changeset
|
379 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ |
c2d737898a4e
Set PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
13562
diff
changeset
|
380 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ |
c2d737898a4e
Set PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
13562
diff
changeset
|
381 || PATH_SEPARATOR=';' |
c2d737898a4e
Set PATH_SEPARATOR the same way autoconf does.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
13562
diff
changeset
|
382 } |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
383 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
384 if test "$PATH_SEPARATOR" = ";"; then |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
385 # 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
|
386 pathx=".;$PATH" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
387 else |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
388 # 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
|
389 pathx="$PATH" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
390 case :$PATH: in |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
391 *::*) |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
392 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
|
393 ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
394 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
395 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
396 save_IFS="$IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
397 IFS="$PATH_SEPARATOR" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
398 for d in $pathx; do |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
399 IFS="$save_IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
400 test -z "$d" && d=. |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
401 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
|
402 self_abspathname="$d/$progname" |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
403 break |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
404 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
405 done |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
406 IFS="$save_IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
407 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
|
408 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
|
409 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
410 ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
411 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
412 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
|
413 # Resolve symbolic link. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
414 linkval=`func_readlink "$self_abspathname"` |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
415 test -n "$linkval" || break |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
416 case "$linkval" in |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
417 /* ) self_abspathname="$linkval" ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
418 * ) 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
|
419 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
420 done |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
421 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
|
422 } |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
423 |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
424 # func_tmpdir |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
425 # creates a temporary directory. |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
426 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
427 # - 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
|
428 # Sets variable |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
429 # - 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
|
430 func_tmpdir () |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
431 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
432 # 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
|
433 # 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
|
434 # /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
|
435 : ${TMPDIR=/tmp} |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
436 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
437 # 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
|
438 # 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
|
439 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
|
440 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
|
441 } || |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
442 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
443 # 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
|
444 # 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
|
445 # 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
|
446 # 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
|
447 # directory. |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
448 tmp=$TMPDIR/gl$$-$RANDOM |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
449 (umask 077 && mkdir "$tmp") |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
450 } || |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
451 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
452 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
|
453 func_exit 1 |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
454 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
455 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
456 |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
457 # func_append var value |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
458 # 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
|
459 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
|
460 # 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
|
461 # 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
|
462 func_append () |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
463 { |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
464 eval "$1+=\"\$2\"" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
465 } |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
466 fast_func_append=true |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
467 else |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
468 func_append () |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
469 { |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
470 eval "$1=\"\$$1\$2\"" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
471 } |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
472 fast_func_append=false |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
473 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
474 |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
475 # func_remove_prefix var prefix |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
476 # removes the given prefix from the value of the shell variable var. |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
477 # var should be the name of a shell variable. |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
478 # Its value should not contain a newline and not start or end with whitespace. |
11037
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
479 # prefix should not contain the characters "$`\{}[]^|. |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
480 if ( foo=bar; eval 'test "${foo#b}" = ar' ) >/dev/null 2>&1; then |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
481 func_remove_prefix () |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
482 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
483 eval "$1=\${$1#\$2}" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
484 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
485 fast_func_remove_prefix=true |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
486 else |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
487 func_remove_prefix () |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
488 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
489 eval "value=\"\$$1\"" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
490 prefix="$2" |
11037
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
491 case "$prefix" in |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
492 *.*) |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
493 sed_escape_dots='s/\([.]\)/\\\1/g' |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
494 prefix=`echo "$prefix" | sed -e "$sed_escape_dots"` |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
495 ;; |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
496 esac |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
497 value=`echo "$value" | sed -e "s|^${prefix}||"` |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
498 eval "$1=\"\$value\"" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
499 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
500 fast_func_remove_prefix=false |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
501 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
502 |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
503 # func_remove_suffix var suffix |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
504 # removes the given suffix from the value of the shell variable var. |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
505 # var should be the name of a shell variable. |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
506 # Its value should not contain a newline and not start or end with whitespace. |
11037
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
507 # suffix should not contain the characters "$`\{}[]^|. |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
508 if ( foo=bar; eval 'test "${foo%r}" = ba' ) >/dev/null 2>&1; then |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
509 func_remove_suffix () |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
510 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
511 eval "$1=\${$1%\$2}" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
512 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
513 fast_func_remove_suffix=true |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
514 else |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
515 func_remove_suffix () |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
516 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
517 eval "value=\"\$$1\"" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
518 suffix="$2" |
11037
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
519 case "$suffix" in |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
520 *.*) |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
521 sed_escape_dots='s/\([.]\)/\\\1/g' |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
522 suffix=`echo "$suffix" | sed -e "$sed_escape_dots"` |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
523 ;; |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
524 esac |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
525 value=`echo "$value" | sed -e "s|${suffix}\$||"` |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
526 eval "$1=\"\$value\"" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
527 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
528 fast_func_remove_suffix=false |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
529 fi |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
530 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
531 # func_fatal_error message |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
532 # 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
|
533 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
534 # - progname name of this program |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
535 func_fatal_error () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
536 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
537 echo "$progname: *** $1" 1>&2 |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
538 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
|
539 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
540 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
541 |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
542 # func_warning message |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
543 # Outputs to stderr a warning message, |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
544 func_warning () |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
545 { |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
546 echo "gnulib-tool: warning: $1" 1>&2 |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
547 } |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
548 |
6248
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
549 # func_readlink SYMLINK |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
550 # outputs the target of the given symlink. |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
551 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
|
552 func_readlink () |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
553 { |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
554 # Use the readlink program from GNU coreutils. |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
555 readlink "$1" |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
556 } |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
557 else |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
558 func_readlink () |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
559 { |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
560 # 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
|
561 # 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
|
562 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
|
563 } |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
564 fi |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
565 |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
566 # func_relativize DIR1 DIR2 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
567 # 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
|
568 # Input: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
569 # - 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
|
570 # - 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
|
571 # Output: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
572 # - 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
|
573 func_relativize () |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
574 { |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
575 dir0=`pwd` |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
576 dir1="$1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
577 dir2="$2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
578 sed_first='s,^\([^/]*\)/.*$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
579 sed_rest='s,^[^/]*/*,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
580 sed_last='s,^.*/\([^/]*\)$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
581 sed_butlast='s,/*[^/]*$,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
582 while test -n "$dir1"; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
583 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
|
584 if test "$first" != "."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
585 if test "$first" = ".."; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
586 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
|
587 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
|
588 else |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
589 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
|
590 if test "$first2" = "$first"; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
591 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
|
592 else |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
593 dir2="../$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
594 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
595 dir0="$dir0"/"$first" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
596 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
597 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
598 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
|
599 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
600 reldir="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
601 } |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
602 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
603 # func_relconcat DIR1 DIR2 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
604 # 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
|
605 # Input: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
606 # - 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
|
607 # - 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
|
608 # Output: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
609 # - 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
|
610 func_relconcat () |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
611 { |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
612 dir1="$1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
613 dir2="$2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
614 sed_first='s,^\([^/]*\)/.*$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
615 sed_rest='s,^[^/]*/*,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
616 sed_last='s,^.*/\([^/]*\)$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
617 sed_butlast='s,/*[^/]*$,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
618 while true; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
619 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
|
620 if test "$first" = "."; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
621 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
|
622 if test -z "$dir2"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
623 relconcat="$dir1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
624 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
625 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
626 else |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
627 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
|
628 while test "$last" = "."; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
629 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
|
630 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
|
631 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
632 if test -z "$dir1"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
633 relconcat="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
634 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
635 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
636 if test "$first" = ".."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
637 if test "$last" = ".."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
638 relconcat="$dir1/$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
639 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
640 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
641 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
|
642 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
|
643 if test -z "$dir1"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
644 relconcat="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
645 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
646 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
647 if test -z "$dir2"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
648 relconcat="$dir1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
649 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
650 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
651 else |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
652 relconcat="$dir1/$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
653 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
654 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
655 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
656 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
657 } |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
658 |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
659 # func_ln SRC DEST |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
660 # 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
|
661 # 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
|
662 func_ln () |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
663 { |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
664 case "$1" in |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
665 /*) |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
666 ln -s "$1" "$2" ;; |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
667 *) # SRC is relative. |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
668 case "$2" in |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
669 /*) |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
670 ln -s "`pwd`/$1" "$2" ;; |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
671 *) # DEST is relative too. |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
672 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
|
673 test -n "$ln_destdir" || ln_destdir="." |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
674 func_relativize "$ln_destdir" "$1" |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
675 ln -s "$reldir" "$2" |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
676 ;; |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
677 esac |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
678 ;; |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
679 esac |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
680 } |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
681 |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
682 # func_ln_if_changed SRC DEST |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
683 # 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
|
684 func_ln_if_changed () |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
685 { |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
686 if test $# -ne 2; then |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
687 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
|
688 fi |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
689 ln_target=`func_readlink "$2"` |
9167 | 690 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
|
691 : |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
692 else |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
693 rm -f "$2" |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
694 func_ln "$1" "$2" |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
695 fi |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
696 } |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
697 |
12882 | 698 # Ensure an 'echo' command that |
12881
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
699 # 1. does not interpret backslashes and |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
700 # 2. does not print an error message "broken pipe" when writing into a pipe |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
701 # with no writers. |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
702 # |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
703 # Test cases for problem 1: |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
704 # 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
|
705 # echo '\t' | grep t > /dev/null has return code 0 when OK, 1 when KO |
12881
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
706 # Test cases for problem 2: |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
707 # echo hi | true frequently prints |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
708 # "bash: echo: write error: Broken pipe" |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
709 # to standard error in bash 3.2. |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
710 # |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
711 # Problem 1 is a weird heritage from SVR4. BSD got it right (except that |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
712 # 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
|
713 # 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
|
714 # - 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
|
715 # 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
|
716 # 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
|
717 # - 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
|
718 # - 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
|
719 # 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
|
720 # - 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
|
721 # We try the following workarounds: |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
722 # - 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
|
723 # - 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
|
724 # - 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
|
725 # - 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
|
726 # - 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
|
727 # - 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
|
728 # - 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
|
729 # - 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
|
730 # the ksh workaround. |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
731 # - 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
|
732 # 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
|
733 # turning this script into a fork bomb in unlucky situations. |
12881
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
734 # |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
735 # Problem 2 is specific to bash 3.2 and affects the 'echo' built-in, but not |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
736 # the 'printf' built-in. See |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
737 # <http://lists.gnu.org/archive/html/bug-bash/2008-12/msg00050.html> |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
738 # <http://lists.gnu.org/archive/html/bug-gnulib/2010-02/msg00154.html> |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
739 # The workaround is: define echo to a function that uses the printf built-in. |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
740 have_echo= |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
741 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
|
742 have_echo=yes # Lucky! |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
743 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
744 # Try the workarounds. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
745 # 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
|
746 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
747 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
748 && test -n "$CONFIG_SHELL" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
749 && test -f "$CONFIG_SHELL" \ |
11919
6a1268d2cf2a
Fix test whether $CONFIG_SHELL has a working 'echo' command.
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
11737
diff
changeset
|
750 && $CONFIG_SHELL -c "echo '\\t' | grep t > /dev/null"; then |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
751 exec $CONFIG_SHELL "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
752 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
753 fi |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
754 # 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
|
755 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
756 && test -n "$BASH_VERSION" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
757 && (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
|
758 shopt -o xpg_echo |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
759 have_echo=yes |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
760 fi |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
761 # 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
|
762 # 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
|
763 # (There is no win in using 'printf' over 'cat' if it is not a shell built-in.) |
12903
82f649e8c371
Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21.
Bruno Haible <bruno@clisp.org>
parents:
12882
diff
changeset
|
764 # Also handle problem 2, specific to bash 3.2, here. |
82f649e8c371
Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21.
Bruno Haible <bruno@clisp.org>
parents:
12882
diff
changeset
|
765 if { test -z "$have_echo" \ |
82f649e8c371
Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21.
Bruno Haible <bruno@clisp.org>
parents:
12882
diff
changeset
|
766 || case "$BASH_VERSION" in 3.2*) true;; *) false;; esac; \ |
82f649e8c371
Fix breakage of gnulib-tool with ksh, introduced on 2010-02-21.
Bruno Haible <bruno@clisp.org>
parents:
12882
diff
changeset
|
767 } \ |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
768 && test -n "$BASH_VERSION"; then \ |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
769 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
|
770 # '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
|
771 echo () |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
772 { |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
773 cat <<EOF |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
774 $* |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
775 EOF |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
776 } |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
777 else |
9007 | 778 # '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
|
779 echo () |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
780 { |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
781 printf '%s\n' "$*" |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
782 } |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
783 fi |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
784 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
|
785 have_echo=yes |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
786 fi |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
787 fi |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
788 # For zsh: turn sh-emulation on. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
789 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
790 && test -n "$ZSH_VERSION" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
791 && (emulate sh) >/dev/null 2>&1; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
792 emulate sh |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
793 fi |
9008
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
794 # 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
|
795 if test -z "$have_echo" \ |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
796 && (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
|
797 # A 'print' command exists. |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
798 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
|
799 : |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
800 else |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
801 # 'print' is a shell built-in. |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
802 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
|
803 # '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
|
804 alias echo='print -r' |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
805 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
806 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
807 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
808 if test -z "$have_echo" \ |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
809 && 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
|
810 have_echo=yes |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
811 fi |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
812 # 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
|
813 # The ksh manual page says: |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
814 # "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
|
815 # 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
|
816 # 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
|
817 # 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
|
818 # 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
|
819 # command. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
820 if test -z "$have_echo"; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
821 bsd_echo () |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
822 { |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
823 cat <<EOF |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
824 $* |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
825 EOF |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
826 } |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
827 alias echo=bsd_echo 2>/dev/null |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
828 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
829 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
830 && echo '\t' | grep t > /dev/null; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
831 have_echo=yes |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
832 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
833 if test -z "$have_echo"; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
834 unalias echo 2>/dev/null |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
835 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
836 # 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
|
837 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
838 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
839 && test -f /bin/ksh; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
840 exec /bin/ksh "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
841 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
842 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
843 # Otherwise: respawn using /bin/sh. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
844 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
845 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
846 && test -f /bin/sh; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
847 exec /bin/sh "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
848 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
849 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
850 if test -z "$have_echo"; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
851 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
|
852 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
853 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
|
854 : # Works fine now. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
855 else |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
856 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
|
857 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
858 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
|
859 shift |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
860 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
861 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
862 # Command-line option processing. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
863 # Removes the OPTIONS from the arguments. Sets the variables: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
864 # - mode list or import or create-testdir or create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
865 # - destdir from --dir |
7215 | 866 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
867 # - modcache true or false, from --cache-modules/--no-cache-modules |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
868 # - 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
|
869 # - libname, supplied_libname from --lib |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
870 # - sourcebase from --source-base |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
871 # - m4base from --m4-base |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
872 # - pobase from --po-base |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
873 # - docbase from --doc-base |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
874 # - testsbase from --tests-base |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
875 # - auxdir from --aux-dir |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
876 # - inctests true if --with-tests was given, blank otherwise |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
877 # - incobsolete true if --with-obsolete was given, blank otherwise |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
878 # - inc_cxx_tests true if --with-c++-tests was given, blank otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
879 # - inc_longrunning_tests true if --with-longrunning-tests was given, blank |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
880 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
881 # - inc_privileged_tests true if --with-privileged-tests was given, blank |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
882 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
883 # - inc_unportable_tests true if --with-unportable-tests was given, blank |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
884 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
885 # - inc_all_tests true if --with-all-tests was given, blank otherwise |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
886 # - excl_cxx_tests true if --without-c++-tests was given, blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
887 # - excl_longrunning_tests true if --without-longrunning-tests was given, |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
888 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
889 # - excl_privileged_tests true if --without-privileged-tests was given, blank |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
890 # otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
891 # - excl_unportable_tests true if --without-unportable-tests was given, blank |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
892 # otherwise |
5981 | 893 # - 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
|
894 # - 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
|
895 # - makefile_name from --makefile-name |
7077 | 896 # - libtool true if --libtool was given, false if --no-libtool was |
897 # given, blank otherwise | |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
898 # - macro_prefix from --macro-prefix |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
899 # - po_domain from --po-domain |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
900 # - 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
|
901 # given, blank otherwise |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
902 # - autoconf_minversion minimum supported autoconf version |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
903 # - 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
|
904 # - 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
|
905 # - 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
|
906 # otherwise |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
907 # - 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
|
908 # - 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
|
909 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
910 mode= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
911 destdir= |
7215 | 912 local_gnulib_dir= |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
913 modcache=true |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
914 verbose=0 |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
915 libname=libgnu |
5344
c2f5677fc6ed
Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents:
5343
diff
changeset
|
916 supplied_libname= |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
917 sourcebase= |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
918 m4base= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
919 pobase= |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
920 docbase= |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
921 testsbase= |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
922 auxdir= |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
923 inctests= |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
924 incobsolete= |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
925 inc_cxx_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
926 inc_longrunning_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
927 inc_privileged_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
928 inc_unportable_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
929 inc_all_tests= |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
930 excl_cxx_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
931 excl_longrunning_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
932 excl_privileged_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
933 excl_unportable_tests= |
5981 | 934 avoidlist= |
935 lgpl= | |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
936 makefile_name= |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
937 libtool= |
6176 | 938 macro_prefix= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
939 po_domain= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
940 vc_files= |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
941 do_changelog=: |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
942 doit=: |
5799
ad9eff556694
2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
5798
diff
changeset
|
943 symbolic= |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
944 lsymbolic= |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
945 do_copyrights=true |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
946 |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
947 supplied_opts="$@" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
948 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
949 while test $# -gt 0; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
950 case "$1" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
951 --list | --lis ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
952 mode=list |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
953 shift ;; |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
954 --find | --fin | --fi | --f ) |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
955 mode=find |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
956 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
957 --import | --impor | --impo | --imp | --im | --i ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
958 mode=import |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
959 shift ;; |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
960 --update | --updat | --upda | --upd | --up | --u ) |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
961 mode=update |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
962 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
963 --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
|
964 mode=create-testdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
965 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
966 --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
|
967 mode=create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
968 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
969 --test | --tes | --te | --t ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
970 mode=test |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
971 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
972 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
973 mode=megatest |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
974 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
975 --extract-* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
976 mode=`echo "X$1" | sed -e 's/^X--//'` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
977 shift ;; |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
978 --copy-file | --copy-fil | --copy-fi | --copy-f | --copy- | --copy | --cop | --co ) |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
979 mode=copy-file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
980 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
981 --dir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
982 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
983 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
984 func_fatal_error "missing argument for --dir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
985 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
986 destdir=$1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
987 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
988 --dir=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
989 destdir=`echo "X$1" | sed -e 's/^X--dir=//'` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
990 shift ;; |
7215 | 991 --local-dir ) |
992 shift | |
993 if test $# = 0; then | |
994 func_fatal_error "missing argument for --local-dir" | |
995 fi | |
996 local_gnulib_dir=$1 | |
997 shift ;; | |
998 --local-dir=* ) | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
999 local_gnulib_dir=`echo "X$1" | sed -e 's/^X--local-dir=//'` |
7215 | 1000 shift ;; |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1001 --cache-modules | --cache-module | --cache-modul | --cache-modu | --cache-mod | --cache-mo | --cache-m | --cache- | --cache | --cach | --cac | --ca ) |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1002 modcache=true |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1003 shift ;; |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1004 --no-cache-modules | --no-cache-module | --no-cache-modul | --no-cache-modu | --no-cache-mod | --no-cache-mo | --no-cache-m | --no-cache- | --no-cache | --no-cach | --no-cac | --no-ca ) |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1005 modcache=false |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1006 shift ;; |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1007 --verbose | --verbos | --verbo | --verb ) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1008 verbose=`expr $verbose + 1` |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1009 shift ;; |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1010 --quiet | --quie | --qui | --qu | --q ) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1011 verbose=`expr $verbose - 1` |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1012 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1013 --lib ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1014 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1015 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1016 func_fatal_error "missing argument for --lib" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1017 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1018 libname=$1 |
5343 | 1019 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1020 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1021 --lib=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1022 libname=`echo "X$1" | sed -e 's/^X--lib=//'` |
5343 | 1023 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1024 shift ;; |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1025 --source-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1026 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1027 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1028 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
|
1029 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1030 sourcebase=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1031 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1032 --source-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1033 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
|
1034 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1035 --m4-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1036 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1037 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1038 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
|
1039 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1040 m4base=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1041 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1042 --m4-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1043 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
|
1044 shift ;; |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1045 --po-base ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1046 shift |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1047 if test $# = 0; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1048 func_fatal_error "missing argument for --po-base" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1049 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1050 pobase=$1 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1051 shift ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1052 --po-base=* ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1053 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
|
1054 shift ;; |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1055 --doc-base ) |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1056 shift |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1057 if test $# = 0; then |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1058 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
|
1059 fi |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1060 docbase=$1 |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1061 shift ;; |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1062 --doc-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1063 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
|
1064 shift ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1065 --tests-base ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1066 shift |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1067 if test $# = 0; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1068 func_fatal_error "missing argument for --tests-base" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1069 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1070 testsbase=$1 |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1071 shift ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1072 --tests-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1073 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
|
1074 shift ;; |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1075 --aux-dir ) |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1076 shift |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1077 if test $# = 0; then |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1078 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
|
1079 fi |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1080 auxdir=$1 |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1081 shift ;; |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1082 --aux-dir=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1083 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
|
1084 shift ;; |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1085 --with-tests | --with-test | --with-tes | --with-te | --with-t) |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1086 inctests=true |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1087 shift ;; |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1088 --with-obsolete | --with-obsolet | --with-obsole | --with-obsol | --with-obso | --with-obs | --with-ob | --with-o) |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1089 incobsolete=true |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1090 shift ;; |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1091 --with-c++-tests | --with-c++-test | --with-c++-tes | --with-c++-te | --with-c++-t | --with-c++- | --with-c++ | --with-c+ | --with-c) |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1092 inc_cxx_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1093 shift ;; |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1094 --with-longrunning-tests | --with-longrunning-test | --with-longrunning-tes | --with-longrunning-te | --with-longrunning-t | --with-longrunning- | --with-longrunning | --with-longrunnin | --with-longrunni | --with-longrunn | --with-longrun | --with-longru | --with-longr | --with-long | --with-lon | --with-lo | --with-l) |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1095 inc_longrunning_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1096 shift ;; |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1097 --with-privileged-tests | --with-privileged-test | --with-privileged-tes | --with-privileged-te | --with-privileged-t | --with-privileged- | --with-privileged | --with-privilege | --with-privileg | --with-privile | --with-privil | --with-privi | --with-priv | --with-pri | --with-pr | --with-p) |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1098 inc_privileged_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1099 shift ;; |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1100 --with-unportable-tests | --with-unportable-test | --with-unportable-tes | --with-unportable-te | --with-unportable-t | --with-unportable- | --with-unportable | --with-unportabl | --with-unportab | --with-unporta | --with-unport | --with-unpor | --with-unpo | --with-unp | --with-un | --with-u) |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1101 inc_unportable_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1102 shift ;; |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1103 --with-all-tests | --with-all-test | --with-all-tes | --with-all-te | --with-all-t | --with-all- | --with-all | --with-al | --with-a) |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1104 inc_all_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1105 shift ;; |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1106 --without-c++-tests | --without-c++-test | --without-c++-tes | --without-c++-te | --without-c++-t | --without-c++- | --without-c++ | --without-c+ | --without-c) |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1107 excl_cxx_tests=true |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1108 shift ;; |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1109 --without-longrunning-tests | --without-longrunning-test | --without-longrunning-tes | --without-longrunning-te | --without-longrunning-t | --without-longrunning- | --without-longrunning | --without-longrunnin | --without-longrunni | --without-longrunn | --without-longrun | --without-longru | --without-longr | --without-long | --without-lon | --without-lo | --without-l) |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1110 excl_longrunning_tests=true |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1111 shift ;; |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1112 --without-privileged-tests | --without-privileged-test | --without-privileged-tes | --without-privileged-te | --without-privileged-t | --without-privileged- | --without-privileged | --without-privilege | --without-privileg | --without-privile | --without-privil | --without-privi | --without-priv | --without-pri | --without-pr | --without-p) |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1113 excl_privileged_tests=true |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1114 shift ;; |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1115 --without-unportable-tests | --without-unportable-test | --without-unportable-tes | --without-unportable-te | --without-unportable-t | --without-unportable- | --without-unportable | --without-unportabl | --without-unportab | --without-unporta | --without-unport | --without-unpor | --without-unpo | --without-unp | --without-un | --without-u) |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1116 excl_unportable_tests=true |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1117 shift ;; |
5981 | 1118 --avoid ) |
1119 shift | |
1120 if test $# = 0; then | |
1121 func_fatal_error "missing argument for --avoid" | |
1122 fi | |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
1123 func_append avoidlist " $1" |
5981 | 1124 shift ;; |
1125 --avoid=* ) | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1126 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
|
1127 func_append avoidlist " $arg" |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1128 shift ;; |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
1129 --lgpl ) |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1130 lgpl=yes |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1131 shift ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1132 --lgpl=* ) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1133 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
|
1134 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
|
1135 2 | 3) ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1136 *) 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
|
1137 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1138 lgpl=$arg |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
1139 shift ;; |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1140 --makefile-name ) |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1141 shift |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1142 if test $# = 0; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1143 func_fatal_error "missing argument for --makefile-name" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1144 fi |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1145 makefile_name="$1" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1146 shift ;; |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1147 --makefile-name=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1148 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
|
1149 shift ;; |
5981 | 1150 --libtool ) |
1151 libtool=true | |
1152 shift ;; | |
7077 | 1153 --no-libtool ) |
1154 libtool=false | |
1155 shift ;; | |
6176 | 1156 --macro-prefix ) |
1157 shift | |
1158 if test $# = 0; then | |
1159 func_fatal_error "missing argument for --macro-prefix" | |
1160 fi | |
1161 macro_prefix="$1" | |
1162 shift ;; | |
1163 --macro-prefix=* ) | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1164 macro_prefix=`echo "X$1" | sed -e 's/^X--macro-prefix=//'` |
6176 | 1165 shift ;; |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1166 --po-domain ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1167 shift |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1168 if test $# = 0; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1169 func_fatal_error "missing argument for --po-domain" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1170 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1171 po_domain="$1" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1172 shift ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1173 --po-domain=* ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1174 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
|
1175 shift ;; |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1176 --vc-files ) |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1177 vc_files=true |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1178 shift ;; |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1179 --no-vc-files ) |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1180 vc_files=false |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1181 shift ;; |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1182 --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch ) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1183 do_changelog=false |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1184 shift ;; |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1185 --dry-run ) |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
1186 doit=false |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1187 shift ;; |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1188 -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
|
1189 symbolic=true |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1190 shift ;; |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
1191 --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
|
1192 lsymbolic=true |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
1193 shift ;; |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1194 -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
|
1195 symbolic=true |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1196 do_copyrights= |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1197 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1198 --help | --hel | --he | --h ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1199 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
|
1200 func_exit $? ;; |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1201 --version | --versio | --versi | --vers ) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1202 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
|
1203 func_exit $? ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1204 -- ) |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1205 # Stop option processing |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1206 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1207 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1208 -* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1209 echo "gnulib-tool: unknown option $1" 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1210 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
|
1211 func_exit 1 ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1212 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1213 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1214 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1215 done |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1216 |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1217 if test "$mode" = import; then |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1218 if test -n "$excl_cxx_tests" || test -n "$excl_longrunning_tests" \ |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1219 || test -n "$excl_privileged_tests" || test -n "$excl_unportable_tests"; then |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1220 echo "gnulib-tool: invalid options for 'import' mode" 1>&2 |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1221 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1222 func_exit 1 |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1223 fi |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1224 fi |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1225 if test "$mode" = update; then |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1226 if test $# != 0; then |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1227 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
|
1228 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1229 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
|
1230 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
|
1231 func_exit 1 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1232 fi |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
1233 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
|
1234 || 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
|
1235 || test -n "$docbase" || test -n "$testsbase" || test -n "$auxdir" \ |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1236 || test -n "$inctests" || test -n "$incobsolete" \ |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1237 || test -n "$inc_cxx_tests" || test -n "$inc_longrunning_tests" \ |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1238 || test -n "$inc_privileged_tests" || test -n "$inc_unportable_tests" \ |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1239 || test -n "$inc_all_tests" \ |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1240 || test -n "$excl_cxx_tests" || test -n "$excl_longrunning_tests" \ |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1241 || test -n "$excl_privileged_tests" || test -n "$excl_unportable_tests" \ |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1242 || test -n "$avoidlist" || test -n "$lgpl" || test -n "$makefile_name" \ |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1243 || test -n "$macro_prefix" || test -n "$po_domain" \ |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1244 || test -n "$vc_files"; then |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1245 echo "gnulib-tool: invalid options for 'update' mode" 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1246 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1247 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
|
1248 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
|
1249 func_exit 1 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1250 fi |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1251 do_changelog=false |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1252 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1253 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
|
1254 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
|
1255 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
|
1256 func_exit 1 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1257 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1258 if test -z "$pobase" && test -n "$po_domain"; then |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
1259 func_warning "--po-domain has no effect without a --po-base option" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1260 fi |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1261 |
7071
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1262 # 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
|
1263 # configure.ac. |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1264 DEFAULT_AUTOCONF_MINVERSION="2.59" |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1265 autoconf_minversion= |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1266 configure_ac= |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1267 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
|
1268 if test -f "$destdir"/configure.ac; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1269 configure_ac="$destdir/configure.ac" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1270 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1271 if test -f "$destdir"/configure.in; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1272 configure_ac="$destdir/configure.in" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1273 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1274 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1275 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1276 if test -f configure.ac; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1277 configure_ac="configure.ac" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1278 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1279 if test -f configure.in; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1280 configure_ac="configure.in" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1281 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1282 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1283 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1284 if test -n "$configure_ac"; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1285 # 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
|
1286 # 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
|
1287 # "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
|
1288 # 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
|
1289 # autom4te: m4 failed with exit status: 1 |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1290 prereqs= |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1291 my_sed_traces=' |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1292 s,#.*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1293 s,^dnl .*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1294 s, dnl .*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1295 /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
|
1296 s,^.*AC_PREREQ([[ ]*\([^])]*\).*$,\1,p |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1297 }' |
7767
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1298 prereqs=`sed -n -e "$my_sed_traces" < "$configure_ac"` |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1299 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
|
1300 autoconf_minversion=` |
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1301 for version in $prereqs; do echo $version; done | |
12417 | 1302 LC_ALL=C sort -nru | sed -e 1q |
7767
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1303 ` |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1304 fi |
7071
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1305 fi |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1306 if test -z "$autoconf_minversion"; then |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1307 autoconf_minversion=$DEFAULT_AUTOCONF_MINVERSION |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1308 fi |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1309 case "$autoconf_minversion" in |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1310 1.* | 2.[0-4]* | 2.5[0-8]*) |
7071
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1311 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
|
1312 esac |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1313 |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1314 # 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
|
1315 # 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
|
1316 sed_trimtrailingslashes='s,\([^/]\)//*$,\1,' |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
1317 case "$local_gnulib_dir" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1318 */ ) 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
|
1319 esac |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1320 case "$sourcebase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1321 */ ) 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
|
1322 esac |
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1323 case "$m4base" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1324 */ ) 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
|
1325 esac |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1326 case "$pobase" in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1327 */ ) pobase=`echo "$pobase" | sed -e "$sed_trimtrailingslashes"` ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1328 esac |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1329 case "$docbase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1330 */ ) 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
|
1331 esac |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1332 case "$testsbase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1333 */ ) 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
|
1334 esac |
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1335 case "$auxdir" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1336 */ ) 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
|
1337 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1338 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1339 |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
1340 func_gnulib_dir |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1341 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
|
1342 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
|
1343 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
|
1344 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
|
1345 fi |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1346 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
|
1347 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
|
1348 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
|
1349 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
|
1350 done |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1351 signal=0 |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1352 |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1353 # func_lookup_file file |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1354 # 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
|
1355 # 'patch'. |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1356 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1357 # - 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
|
1358 # Output: |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1359 # - 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
|
1360 # - 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
|
1361 func_lookup_file () |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1362 { |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1363 lkfile="$1" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1364 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
|
1365 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
|
1366 lookedup_tmp= |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1367 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1368 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
|
1369 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
|
1370 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
|
1371 rm -f "$tmp/$lkbase" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1372 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
|
1373 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
|
1374 || 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
|
1375 lookedup_file="$tmp/$lkbase" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1376 lookedup_tmp=true |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1377 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1378 lookedup_file="$gnulib_dir/$lkfile" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1379 lookedup_tmp= |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1380 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1381 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1382 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
|
1383 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1384 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1385 } |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1386 |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1387 # func_sanitize_modulelist |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1388 # receives a list of possible module names on standard input, one per line. |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1389 # It removes those which are just file names unrelated to modules, and outputs |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1390 # the resulting list to standard output, one per line. |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1391 func_sanitize_modulelist () |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1392 { |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1393 sed -e '/^CVS\//d' -e '/\/CVS\//d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1394 -e '/^ChangeLog$/d' -e '/\/ChangeLog$/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1395 -e '/^COPYING$/d' -e '/\/COPYING$/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1396 -e '/^README$/d' -e '/\/README$/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1397 -e '/^TEMPLATE$/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1398 -e '/^TEMPLATE-EXTENDED$/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1399 -e '/^TEMPLATE-TESTS$/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1400 -e '/^\..*/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1401 -e '/~$/d' |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1402 } |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1403 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1404 # func_all_modules |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1405 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1406 # - local_gnulib_dir from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1407 func_all_modules () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1408 { |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1409 # 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
|
1410 # 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
|
1411 # --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
|
1412 { |
7805
2ee7433618fe
Add support for subdirectories of the 'modules/' directory.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
1413 (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
|
1414 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
|
1415 (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
|
1416 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1417 } \ |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1418 | func_sanitize_modulelist \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1419 | sed -e '/-tests$/d' \ |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
1420 | LC_ALL=C sort -u |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1421 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1422 |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1423 # func_exists_module module |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1424 # tests whether a module, given by name, exists |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1425 # Input: |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1426 # - local_gnulib_dir from --local-dir |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1427 func_exists_module () |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1428 { |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1429 { test -f "$gnulib_dir/modules/$1" \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1430 || { test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules" \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1431 && test -f "$local_gnulib_dir/modules/$1"; }; } \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1432 && test "CVS" != "$1" \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1433 && test "ChangeLog" != "$1" \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1434 && test "COPYING" != "$1" \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1435 && test "README" != "$1" \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1436 && test "TEMPLATE" != "$1" \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1437 && test "TEMPLATE-EXTENDED" != "$1" \ |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1438 && test "TEMPLATE-TESTS" != "$1" |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1439 } |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1440 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1441 # func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1442 # verifies a module name |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1443 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1444 # - local_gnulib_dir from --local-dir |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1445 # - module module name argument |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1446 func_verify_module () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1447 { |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1448 if func_exists_module "$module"; then |
7168
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1449 # OK, $module is a correct module name. |
7212 | 1450 # Verify that building the module description with 'patch' succeeds. |
1451 func_lookup_file "modules/$module" | |
7168
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1452 else |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
1453 func_warning "module $module doesn't exist" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1454 module= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1455 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1456 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1457 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1458 # func_verify_nontests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1459 # verifies a module name, excluding tests modules |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1460 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1461 # - local_gnulib_dir from --local-dir |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1462 # - module module name argument |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1463 func_verify_nontests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1464 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1465 case "$module" in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1466 *-tests ) module= ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1467 * ) func_verify_module ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1468 esac |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1469 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1470 |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1471 # func_verify_tests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1472 # 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
|
1473 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1474 # - local_gnulib_dir from --local-dir |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1475 # - module module name argument |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1476 func_verify_tests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1477 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1478 case "$module" in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1479 *-tests ) func_verify_module ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1480 * ) module= ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1481 esac |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1482 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1483 |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1484 # Suffix of a sed expression that extracts a particular field from a |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1485 # module description. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1486 # A field starts with a line that contains a keyword, such as 'Description', |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1487 # followed by a colon and optional whitespace. All following lines, up to |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1488 # the next field (or end of file if there is none) form the contents of the |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1489 # field. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1490 # An absent field is equivalent to a field with empty contents. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1491 # NOTE: Keep this in sync with sed_extract_cache_prog below! |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1492 sed_extract_prog=':[ ]*$/ { |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1493 :a |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1494 n |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1495 s/^Description:[ ]*$// |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1496 s/^Comment:[ ]*$// |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1497 s/^Status:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1498 s/^Notice:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1499 s/^Applicability:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1500 s/^Files:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1501 s/^Depends-on:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1502 s/^configure\.ac-early:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1503 s/^configure\.ac:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1504 s/^Makefile\.am:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1505 s/^Include:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1506 s/^Link:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1507 s/^License:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1508 s/^Maintainer:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1509 tb |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1510 p |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1511 ba |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1512 :b |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1513 }' |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1514 |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1515 # Piece of a sed expression that converts a field header line to a shell |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1516 # variable name, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1517 # NOTE: Keep this in sync with sed_extract_prog above! |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1518 sed_extract_field_header=' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1519 s/^Description:[ ]*$/description/ |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1520 s/^Comment:[ ]*$/comment/ |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1521 s/^Status:[ ]*$/status/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1522 s/^Notice:[ ]*$/notice/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1523 s/^Applicability:[ ]*$/applicability/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1524 s/^Files:[ ]*$/files/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1525 s/^Depends-on:[ ]*$/dependson/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1526 s/^configure\.ac-early:[ ]*$/configureac_early/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1527 s/^configure\.ac:[ ]*$/configureac/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1528 s/^Makefile\.am:[ ]*$/makefile/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1529 s/^Include:[ ]*$/include/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1530 s/^Link:[ ]*$/link/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1531 s/^License:[ ]*$/license/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1532 s/^Maintainer:[ ]*$/maintainer/' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1533 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1534 if $modcache; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1535 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1536 # Note: The 'eval' silences stderr output in dash. |
13223
d8fa281b2a00
gnulib-tool: silence warning on BSD sh
Eric Blake <eblake@redhat.com>
parents:
13217
diff
changeset
|
1537 if (declare -A x && { x[f/2]='foo'; x[f/3]='bar'; eval test '${x[f/2]}' = foo; }) 2>/dev/null; then |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1538 # Zsh 4 and Bash 4 have associative arrays. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1539 have_associative=true |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1540 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1541 # For other shells, use 'eval' with computed shell variable names. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1542 have_associative=false |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1543 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1544 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1545 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1546 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1547 # Declare the associative arrays. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1548 declare -A modcache_cached |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1549 sed_to_declare_statement='s|^.*/\([a-zA-Z0-9_]*\)/$|declare -A modcache_\1|p' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1550 declare_script=`echo "$sed_extract_field_header" | sed -n -e "$sed_to_declare_statement"` |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1551 eval "$declare_script" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1552 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1553 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1554 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1555 # func_cache_var module |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1556 # computes the cache variable name corresponding to $module. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1557 # Note: This computation can map different module names to the same |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1558 # cachevar (such as 'foo-bar', 'foo_bar', or 'foo/bar'); the caller has |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1559 # to protect against this case. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1560 # Output: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1561 # - cachevar a shell variable name |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1562 if (f=foo; eval echo '${f//o/e}') < /dev/null 2>/dev/null | grep fee >/dev/null; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1563 # Bash 2.0 and newer, ksh, and zsh support the syntax |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1564 # ${param//pattern/replacement} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1565 # as a shorthand for |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1566 # `echo "$param" | sed -e "s/pattern/replacement/g"`. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1567 # Note: The 'eval' above silences stderr output in dash. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1568 func_cache_var () |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1569 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1570 cachevar=c_${1//[!a-zA-Z0-9_]/_} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1571 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1572 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1573 func_cache_var () |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1574 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1575 case $1 in |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1576 *[!a-zA-Z0-9_]*) |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1577 cachevar=c_`echo "$1" | LC_ALL=C sed -e 's/[^a-zA-Z0-9_]/_/g'` ;; |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1578 *) |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1579 cachevar=c_$1 ;; |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1580 esac |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1581 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1582 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1583 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1584 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1585 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1586 # func_init_sed_convert_to_cache_statements |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1587 # Input: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1588 # - modcachevar_assignment |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1589 # Output: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1590 # - sed_convert_to_cache_statements |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1591 func_init_sed_convert_to_cache_statements () |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1592 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1593 # 'sed' script that turns a module description into shell script |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1594 # assignments, suitable to be eval'ed. All active characters are escaped. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1595 # This script turns |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1596 # Description: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1597 # Some module's description |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1598 # |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1599 # Files: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1600 # lib/file.h |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1601 # into: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1602 # modcache_description[$1]=\ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1603 # 'Some module'"'"'s description |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1604 # ' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1605 # modcache_files[$1]=\ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1606 # 'lib/file.h' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1607 # or: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1608 # c_MODULE_description_set=set; c_MODULE_description=\ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1609 # 'Some module'"'"'s description |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1610 # ' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1611 # c_MODULE_files_set=set; c_MODULE_files=\ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1612 # 'lib/file.h' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1613 # The script consists of two parts: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1614 # 1) Ignore the lines before the first field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1615 # 2) A loop, treating non-field-header lines by escaping single quotes |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1616 # and adding a closing quote in the last line, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1617 sed_convert_to_cache_statements=" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1618 :llla |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1619 # Here we have not yet seen a field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1620 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1621 # See if the current line contains a field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1622 t llla1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1623 :llla1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1624 ${sed_extract_field_header} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1625 t lllb |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1626 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1627 # No field header. Ignore the line. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1628 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1629 # Read the next line. Upon EOF, just exit. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1630 n |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1631 b llla |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1632 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1633 :lllb |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1634 # The current line contains a field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1635 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1636 # Turn it into the beginning of an assignment. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1637 s/^\\(.*\\)\$/${modcachevar_assignment}\\\\/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1638 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1639 # Move it to the hold space. Don't print it yet, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1640 # because we want no assignment if the field is empty. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1641 h |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1642 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1643 # Read the next line. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1644 # Upon EOF, the field was empty. Print no assignment. Just exit. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1645 n |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1646 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1647 # See if the current line contains a field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1648 t lllb1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1649 :lllb1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1650 ${sed_extract_field_header} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1651 # If it is, the previous field was empty. Print no assignment. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1652 t lllb |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1653 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1654 # Not a field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1655 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1656 # Print the previous line, held in the hold space. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1657 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1658 p |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1659 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1660 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1661 # Transform single quotes. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1662 s/'/'\"'\"'/g |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1663 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1664 # Prepend a single quote. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1665 s/^/'/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1666 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1667 :lllc |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1668 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1669 # Move it to the hold space. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1670 h |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1671 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1672 # Read the next line. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1673 # Upon EOF, branch. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1674 \${ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1675 b llle |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1676 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1677 n |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1678 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1679 # See if the current line contains a field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1680 t lllc1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1681 :lllc1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1682 ${sed_extract_field_header} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1683 t llld |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1684 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1685 # Print the previous line, held in the hold space. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1686 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1687 p |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1688 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1689 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1690 # Transform single quotes. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1691 s/'/'\"'\"'/g |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1692 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1693 b lllc |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1694 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1695 :llld |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1696 # A field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1697 # Print the previous line, held in the hold space, with a single quote |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1698 # to end the assignment. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1699 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1700 s/\$/'/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1701 p |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1702 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1703 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1704 b lllb |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1705 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1706 :llle |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1707 # EOF seen. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1708 # Print the previous line, held in the hold space, with a single quote |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1709 # to end the assignment. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1710 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1711 s/\$/'/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1712 p |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1713 # Exit. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1714 n |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1715 " |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1716 if ! $sed_comments; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1717 # Remove comments. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1718 sed_convert_to_cache_statements=`echo "$sed_convert_to_cache_statements" \ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1719 | sed -e 's/^ *//' -e 's/^#.*//'` |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1720 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1721 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1722 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1723 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1724 # sed_convert_to_cache_statements does not depend on the module. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1725 modcachevar_assignment='modcache_\1[$1]=' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1726 func_init_sed_convert_to_cache_statements |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1727 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1728 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1729 # func_cache_lookup_module module |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1730 # |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1731 # looks up a module, like 'func_lookup_file modules/$module', and stores all |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1732 # of its relevant data in a cache in the memory of the processing shell. If |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1733 # already cached, it does not look it up again, thus saving file access time. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1734 # Parameters: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1735 # - module non-empty string |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1736 # Output if $have_associative: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1737 # - modcache_cached[$module] set to yes |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1738 # - modcache_description[$module] == |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1739 # - modcache_status[$module] \ set to the field's value, minus the |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1740 # - ... / final newline, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1741 # - modcache_maintainer[$module] == or unset if the field's value is empty |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1742 # Output if ! $have_associative: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1743 # - cachevar a shell variable name |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1744 # - ${cachevar}_cached set to $module |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1745 # - ${cachevar}_description == |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1746 # - ${cachevar}_status \ set to the field's value, minus the |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1747 # - ... / final newline, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1748 # - ${cachevar}_maintainer == or unset if the field's value is empty |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1749 # - ${cachevar}_description_set == |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1750 # - ${cachevar}_status_set \ set to non-empty if the field's value |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1751 # - ... / is non-empty, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1752 # - ${cachevar}_maintainer_set == or unset if the field's value is empty |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1753 func_cache_lookup_module () |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1754 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1755 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1756 cached=${modcache_cached[$1]} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1757 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1758 func_cache_var "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1759 eval "cached=\"\$${cachevar}_cached\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1760 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1761 if test -z "$cached"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1762 # Not found in cache. Look it up on the file system. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1763 func_lookup_file "modules/$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1764 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1765 modcache_cached[$1]=yes |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1766 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1767 eval "${cachevar}_cached=\"\$1\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1768 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1769 if ! $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1770 # sed_convert_to_cache_statements depends on the module. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1771 modcachevar_assignment="${cachevar}"'_\1_set=set; '"${cachevar}"'_\1=' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1772 func_init_sed_convert_to_cache_statements |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1773 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1774 cache_statements=`LC_ALL=C sed -n -e "$sed_convert_to_cache_statements" < "$lookedup_file"` |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1775 eval "$cache_statements" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1776 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1777 if ! $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1778 if test "$1" != "$cached"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1779 func_fatal_error "cache variable collision between $1 and $cached" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1780 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1781 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1782 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1783 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1784 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1785 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1786 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1787 # func_get_description module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1788 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1789 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1790 # - modcache true or false, from --cache-modules/--no-cache-modules |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1791 func_get_description () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1792 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1793 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1794 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1795 sed -n -e "/^Description$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1796 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1797 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1798 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1799 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1800 if test -n "${modcache_description[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1801 echo "${modcache_description[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1802 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1803 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1804 eval "field_set=\"\$${cachevar}_description_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1805 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1806 eval "field_value=\"\$${cachevar}_description\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1807 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1808 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1809 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1810 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1811 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1812 |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1813 # func_get_comment module |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1814 # Input: |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1815 # - local_gnulib_dir from --local-dir |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1816 # - modcache true or false, from --cache-modules/--no-cache-modules |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1817 func_get_comment () |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1818 { |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1819 if ! $modcache; then |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1820 func_lookup_file "modules/$1" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1821 sed -n -e "/^Comment$sed_extract_prog" < "$lookedup_file" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1822 else |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1823 func_cache_lookup_module "$1" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1824 # Output the field's value, including the final newline (if any). |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1825 if $have_associative; then |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1826 if test -n "${modcache_comment[$1]+set}"; then |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1827 echo "${modcache_comment[$1]}" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1828 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1829 else |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1830 eval "field_set=\"\$${cachevar}_comment_set\"" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1831 if test -n "$field_set"; then |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1832 eval "field_value=\"\$${cachevar}_comment\"" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1833 echo "${field_value}" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1834 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1835 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1836 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1837 } |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1838 |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1839 # func_get_status module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1840 # Input: |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1841 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1842 # - modcache true or false, from --cache-modules/--no-cache-modules |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1843 func_get_status () |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1844 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1845 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1846 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1847 sed -n -e "/^Status$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1848 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1849 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1850 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1851 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1852 if test -n "${modcache_status[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1853 echo "${modcache_status[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1854 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1855 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1856 eval "field_set=\"\$${cachevar}_status_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1857 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1858 eval "field_value=\"\$${cachevar}_status\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1859 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1860 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1861 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1862 fi |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1863 } |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
1864 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1865 # func_get_notice module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1866 # Input: |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1867 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1868 # - modcache true or false, from --cache-modules/--no-cache-modules |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1869 func_get_notice () |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1870 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1871 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1872 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1873 sed -n -e "/^Notice$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1874 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1875 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1876 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1877 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1878 if test -n "${modcache_notice[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1879 echo "${modcache_notice[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1880 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1881 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1882 eval "field_set=\"\$${cachevar}_notice_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1883 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1884 eval "field_value=\"\$${cachevar}_notice\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1885 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1886 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1887 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1888 fi |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1889 } |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
1890 |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1891 # func_get_applicability module |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1892 # Input: |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1893 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1894 # - modcache true or false, from --cache-modules/--no-cache-modules |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1895 # The expected result (on stdout) is either 'main', or 'tests', or 'all'. |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1896 func_get_applicability () |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1897 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1898 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1899 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1900 my_applicability=`sed -n -e "/^Applicability$sed_extract_prog" < "$lookedup_file"` |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1901 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1902 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1903 # Get the field's value, without the final newline. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1904 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1905 my_applicability="${modcache_applicability[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1906 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1907 eval "my_applicability=\"\$${cachevar}_applicability\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1908 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1909 fi |
12854
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
1910 if test -n "$my_applicability"; then |
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
1911 echo $my_applicability |
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
1912 else |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1913 # The default is 'main' or 'tests', depending on the module's name. |
12854
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
1914 case $1 in |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1915 *-tests) echo "tests";; |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1916 *) echo "main";; |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1917 esac |
12854
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
1918 fi |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1919 } |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
1920 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1921 # func_get_filelist module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1922 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1923 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1924 # - modcache true or false, from --cache-modules/--no-cache-modules |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1925 func_get_filelist () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1926 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1927 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1928 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1929 sed -n -e "/^Files$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1930 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1931 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1932 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1933 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1934 if test -n "${modcache_files[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1935 echo "${modcache_files[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1936 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1937 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1938 eval "field_set=\"\$${cachevar}_files_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1939 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1940 eval "field_value=\"\$${cachevar}_files\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1941 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1942 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1943 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1944 fi |
11094
5e937a2f5647
Backport improved autoconf semantics of AC_DEFUN_ONCE.
Eric Blake <ebb9@byu.net>
parents:
11065
diff
changeset
|
1945 echo m4/00gnulib.m4 |
7788
e3424061171f
Back from an automatic module-indicator macro to a module-indicator macro
Bruno Haible <bruno@clisp.org>
parents:
7781
diff
changeset
|
1946 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
|
1947 case "$autoconf_minversion" in |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1948 2.59) |
9879
e0ce0891df69
Avoid some more autoconf warnings.
Eric Blake <ebb9@byu.net>
parents:
9875
diff
changeset
|
1949 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
|
1950 ;; |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1951 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1952 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1953 |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1954 # func_filter_filelist outputvar separator filelist prefix suffix removed_prefix removed_suffix [added_prefix [added_suffix]] |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1955 # stores in outputvar the filtered and processed filelist. Filtering: Only the |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1956 # elements starting with prefix and ending with suffix are considered. |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1957 # Processing: removed_prefix and removed_suffix are removed from each element, |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1958 # added_prefix and added_suffix are added to each element. |
12743
3d337755e12c
gnulib-tool: fix filelist for AIX, HP-UX ksh.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12741
diff
changeset
|
1959 # prefix, suffix should not contain shell-special characters. |
11037
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
1960 # removed_prefix, removed_suffix should not contain the characters "$`\{}[]^|. |
11421
57b6d75143fd
Fix comment for func_filter_filelist.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11404
diff
changeset
|
1961 # added_prefix, added_suffix should not contain the characters \|&. |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1962 func_filter_filelist () |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1963 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1964 if test "$2" != "$nl" \ |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1965 || { $fast_func_append \ |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1966 && { test -z "$6" || $fast_func_remove_prefix; } \ |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1967 && { test -z "$7" || $fast_func_remove_suffix; }; \ |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1968 }; then |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1969 ffflist= |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1970 for fff in $3; do |
12743
3d337755e12c
gnulib-tool: fix filelist for AIX, HP-UX ksh.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12741
diff
changeset
|
1971 # Do not quote possibly-empty parameters in case patterns, |
3d337755e12c
gnulib-tool: fix filelist for AIX, HP-UX ksh.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12741
diff
changeset
|
1972 # AIX and HP-UX ksh won't match them if they are empty. |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1973 case "$fff" in |
12743
3d337755e12c
gnulib-tool: fix filelist for AIX, HP-UX ksh.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12741
diff
changeset
|
1974 $4*$5) |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1975 if test -n "$6"; then |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1976 func_remove_prefix fff "$6" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1977 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1978 if test -n "$7"; then |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1979 func_remove_suffix fff "$7" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1980 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1981 fff="$8${fff}$9" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1982 if test -z "$ffflist"; then |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1983 ffflist="${fff}" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1984 else |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1985 func_append ffflist "$2${fff}" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1986 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1987 ;; |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1988 esac |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1989 done |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1990 else |
10993
996a5b3859fe
gnulib-tool: fix sed-based filtering
Jim Meyering <meyering@redhat.com>
parents:
10989
diff
changeset
|
1991 sed_fff_filter="s|^$6\(.*\)$7\$|$8\\1$9|" |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1992 ffflist=`for fff in $3; do |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1993 case "$fff" in |
12743
3d337755e12c
gnulib-tool: fix filelist for AIX, HP-UX ksh.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12741
diff
changeset
|
1994 $4*$5) echo "$fff" ;; |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1995 esac |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1996 done | sed -e "$sed_fff_filter"` |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1997 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1998 eval "$1=\"\$ffflist\"" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
1999 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2000 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2001 # func_get_dependencies module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2002 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2003 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2004 # - modcache true or false, from --cache-modules/--no-cache-modules |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2005 func_get_dependencies () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2006 { |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
2007 # ${module}-tests implicitly depends on ${module}, if that module exists. |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2008 case "$1" in |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2009 *-tests) |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2010 fgd1="$1" |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2011 func_remove_suffix fgd1 '-tests' |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
2012 if func_exists_module "$fgd1"; then |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
2013 echo "$fgd1" |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
2014 fi |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2015 ;; |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2016 esac |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2017 # Then the explicit dependencies listed in the module description. |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2018 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2019 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2020 sed -n -e "/^Depends-on$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2021 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2022 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2023 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2024 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2025 if test -n "${modcache_dependson[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2026 echo "${modcache_dependson[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2027 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2028 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2029 eval "field_set=\"\$${cachevar}_dependson_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2030 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2031 eval "field_value=\"\$${cachevar}_dependson\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2032 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2033 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2034 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2035 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2036 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2037 |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2038 # func_get_autoconf_early_snippet module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2039 # Input: |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2040 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2041 # - modcache true or false, from --cache-modules/--no-cache-modules |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2042 func_get_autoconf_early_snippet () |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2043 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2044 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2045 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2046 sed -n -e "/^configure\.ac-early$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2047 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2048 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2049 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2050 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2051 if test -n "${modcache_configureac_early[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2052 echo "${modcache_configureac_early[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2053 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2054 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2055 eval "field_set=\"\$${cachevar}_configureac_early_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2056 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2057 eval "field_value=\"\$${cachevar}_configureac_early\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2058 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2059 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2060 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2061 fi |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2062 } |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2063 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2064 # func_get_autoconf_snippet module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2065 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2066 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2067 # - modcache true or false, from --cache-modules/--no-cache-modules |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2068 func_get_autoconf_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2069 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2070 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2071 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2072 sed -n -e "/^configure\.ac$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2073 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2074 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2075 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2076 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2077 if test -n "${modcache_configureac[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2078 echo "${modcache_configureac[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2079 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2080 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2081 eval "field_set=\"\$${cachevar}_configureac_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2082 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2083 eval "field_value=\"\$${cachevar}_configureac\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2084 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2085 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2086 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2087 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2088 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2089 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2090 # func_get_automake_snippet module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2091 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2092 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2093 # - modcache true or false, from --cache-modules/--no-cache-modules |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2094 func_get_automake_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2095 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2096 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2097 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2098 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2099 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2100 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2101 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2102 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2103 if test -n "${modcache_makefile[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2104 echo "${modcache_makefile[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2105 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2106 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2107 eval "field_set=\"\$${cachevar}_makefile_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2108 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2109 eval "field_value=\"\$${cachevar}_makefile\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2110 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2111 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2112 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2113 fi |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2114 case "$1" in |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2115 *-tests) |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2116 # *-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
|
2117 # Synthesize an EXTRA_DIST augmentation. |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2118 all_files=`func_get_filelist $1` |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2119 func_filter_filelist tests_files " " "$all_files" 'tests/' '' 'tests/' '' |
9284
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2120 extra_files="$tests_files" |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2121 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
|
2122 echo "EXTRA_DIST +=" $extra_files |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2123 echo |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2124 fi |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2125 ;; |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2126 *) |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2127 # Synthesize an EXTRA_DIST augmentation. |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2128 sed_combine_lines='/\\$/{ |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2129 :a |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2130 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
|
2131 s/\\\n/ / |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2132 s/\\$/\\/ |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2133 ta |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2134 }' |
7754
ed8105720327
* modules/absolute-header: New module.
Eric Blake <ebb9@byu.net>
parents:
7752
diff
changeset
|
2135 sed_extract_mentioned_files='s/^lib_SOURCES[ ]*+=[ ]*//p' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2136 already_mentioned_files=` \ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2137 { if ! $modcache; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2138 sed -n -e "/^Makefile\.am$sed_extract_prog" < "$lookedup_file" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2139 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2140 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2141 if test -n "${modcache_makefile[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2142 echo "${modcache_makefile[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2143 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2144 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2145 eval 'field_set="$'"${cachevar}"'_makefile_set"' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2146 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2147 eval 'field_value="$'"${cachevar}"'_makefile"' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2148 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2149 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2150 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2151 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2152 } \ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2153 | sed -e "$sed_combine_lines" \ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2154 | 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
|
2155 all_files=`func_get_filelist $1` |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2156 func_filter_filelist lib_files "$nl" "$all_files" 'lib/' '' 'lib/' '' |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2157 # 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
|
2158 echo "$lib_files" | LC_ALL=C sort -u > "$tmp"/lib-files |
12881
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
2159 extra_files=`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
|
2160 | 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
|
2161 if test -n "$extra_files"; then |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2162 echo "EXTRA_DIST +=" $extra_files |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2163 echo |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2164 fi |
7640
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
2165 # Synthesize also an EXTRA_lib_SOURCES augmentation. |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
2166 # 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
|
2167 # dependency rules. |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
2168 # 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
|
2169 # 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
|
2170 # (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
|
2171 # 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
|
2172 # 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
|
2173 # 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
|
2174 # 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
|
2175 # 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
|
2176 case "$1" in |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2177 relocatable-prog-wrapper) ;; |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2178 *) |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2179 func_filter_filelist extra_files "$nl" "$extra_files" '' '.c' '' '' |
8356
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2180 if test -n "$extra_files"; then |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2181 echo "EXTRA_lib_SOURCES +=" $extra_files |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2182 echo |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2183 fi |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2184 ;; |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2185 esac |
9107
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
2186 # Synthesize an EXTRA_DIST augmentation also for the files in build-aux/. |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2187 func_filter_filelist buildaux_files "$nl" "$all_files" 'build-aux/' '' 'build-aux/' '' |
9107
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
2188 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
|
2189 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
|
2190 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
|
2191 echo |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
2192 fi |
9807
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2193 # Synthesize an EXTRA_DIST augmentation also for the files from top/. |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2194 func_filter_filelist top_files "$nl" "$all_files" 'top/' '' 'top/' '' |
9807
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2195 if test -n "$top_files"; then |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2196 sed_prepend_topdir='s,^,$(top_srcdir)/,' |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2197 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
|
2198 echo |
24b7b77b3295
Install files from top/ in the destination directory.
Bruno Haible <bruno@clisp.org>
parents:
9806
diff
changeset
|
2199 fi |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2200 ;; |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2201 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2202 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2203 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2204 # func_get_include_directive module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2205 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2206 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2207 # - modcache true or false, from --cache-modules/--no-cache-modules |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2208 func_get_include_directive () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2209 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2210 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2211 if ! $modcache; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2212 func_lookup_file "modules/$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2213 sed -n -e "/^Include$sed_extract_prog" < "$lookedup_file" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2214 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2215 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2216 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2217 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2218 if test -n "${modcache_include[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2219 echo "${modcache_include[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2220 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2221 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2222 eval "field_set=\"\$${cachevar}_include_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2223 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2224 eval "field_value=\"\$${cachevar}_include\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2225 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2226 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2227 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2228 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2229 } | sed -e 's/^\(["<]\)/#include \1/' |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2230 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2231 |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2232 # func_get_link_directive module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2233 # Input: |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2234 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2235 # - modcache true or false, from --cache-modules/--no-cache-modules |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2236 func_get_link_directive () |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2237 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2238 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2239 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2240 sed -n -e "/^Link$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2241 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2242 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2243 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2244 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2245 if test -n "${modcache_link[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2246 echo "${modcache_link[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2247 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2248 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2249 eval "field_set=\"\$${cachevar}_link_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2250 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2251 eval "field_value=\"\$${cachevar}_link\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2252 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2253 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2254 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2255 fi |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2256 } |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2257 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2258 # func_get_license module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2259 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2260 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2261 # - modcache true or false, from --cache-modules/--no-cache-modules |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2262 func_get_license () |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2263 { |
12854
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
2264 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2265 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2266 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2267 sed -n -e "/^License$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2268 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2269 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2270 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2271 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2272 if test -n "${modcache_license[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2273 echo "${modcache_license[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2274 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2275 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2276 eval "field_set=\"\$${cachevar}_license_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2277 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2278 eval "field_value=\"\$${cachevar}_license\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2279 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2280 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2281 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2282 fi |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
2283 # The default is GPL. |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
2284 echo "GPL" |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
2285 } | sed -e 's,^ *$,,' | sed -e 1q |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2286 } |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2287 |
4197 | 2288 # func_get_maintainer module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2289 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2290 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2291 # - modcache true or false, from --cache-modules/--no-cache-modules |
4197 | 2292 func_get_maintainer () |
2293 { | |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2294 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2295 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2296 sed -n -e "/^Maintainer$sed_extract_prog" < "$lookedup_file" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2297 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2298 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2299 # Output the field's value, including the final newline (if any). |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2300 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2301 if test -n "${modcache_maintainer[$1]+set}"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2302 echo "${modcache_maintainer[$1]}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2303 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2304 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2305 eval "field_set=\"\$${cachevar}_maintainer_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2306 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2307 eval "field_value=\"\$${cachevar}_maintainer\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2308 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2309 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2310 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2311 fi |
4197 | 2312 } |
2313 | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2314 # func_get_tests_module module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2315 # Input: |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2316 # - local_gnulib_dir from --local-dir |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2317 func_get_tests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2318 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2319 # 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
|
2320 if test -f "$gnulib_dir/modules/$1"-tests \ |
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2321 || { 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
|
2322 && 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
|
2323 echo "$1"-tests |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2324 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2325 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2326 |
5981 | 2327 # func_acceptable module |
2328 # tests whether a module is acceptable. | |
2329 # Input: | |
2330 # - avoidlist list of modules to avoid | |
2331 func_acceptable () | |
2332 { | |
2333 for avoid in $avoidlist; do | |
2334 if test "$avoid" = "$1"; then | |
2335 return 1 | |
2336 fi | |
2337 done | |
2338 return 0 | |
2339 } | |
2340 | |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2341 # func_modules_transitive_closure |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2342 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2343 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2344 # - modcache true or false, from --cache-modules/--no-cache-modules |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2345 # - modules list of specified modules |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2346 # - inctests true if tests should be included, blank otherwise |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
2347 # - incobsolete true if obsolete modules among dependencies should be |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
2348 # included, blank otherwise |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2349 # - inc_cxx_tests true if C++ interoperability tests should be included, |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2350 # blank otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2351 # - inc_longrunning_tests true if long-runnings tests should be included, |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2352 # blank otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2353 # - inc_privileged_tests true if tests that require root privileges should be |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2354 # included, blank otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2355 # - inc_unportable_tests true if tests that fail on some platforms should be |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2356 # included, blank otherwise |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2357 # - inc_all_direct_tests true if all kinds of problematic unit tests among |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2358 # the unit tests of the specified modules should be |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2359 # included, blank otherwise |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2360 # - inc_all_indirect_tests true if all kinds of problematic unit tests among |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2361 # the unit tests of the dependencies should be |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2362 # included, blank otherwise |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2363 # - excl_cxx_tests true if C++ interoperability tests should be excluded, |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2364 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2365 # - excl_longrunning_tests true if long-runnings tests should be excluded, |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2366 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2367 # - excl_privileged_tests true if tests that require root privileges should be |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2368 # excluded, blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2369 # - excl_unportable_tests true if tests that fail on some platforms should be |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2370 # excluded, blank otherwise |
5981 | 2371 # - avoidlist list of modules to avoid |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2372 # - 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
|
2373 # Output: |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2374 # - 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
|
2375 func_modules_transitive_closure () |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2376 { |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2377 # 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
|
2378 # 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
|
2379 # 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
|
2380 # 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
|
2381 # to process it again. |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2382 handledmodules= |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2383 inmodules="$modules" |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2384 outmodules= |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2385 fmtc_inc_all_tests="$inc_all_direct_tests" |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2386 while test -n "$inmodules"; do |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2387 inmodules_this_round="$inmodules" |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2388 inmodules= # Accumulator, queue for next round |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2389 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
|
2390 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2391 if test -n "$module"; then |
5981 | 2392 if func_acceptable $module; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2393 func_append outmodules " $module" |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2394 deps=`func_get_dependencies $module` |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2395 # 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
|
2396 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
|
2397 if test -n "$duplicated_deps"; then |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
2398 func_warning "module $module has duplicated dependencies: "`echo $duplicated_deps` |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2399 fi |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2400 if test -n "$inctests"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2401 testsmodule=`func_get_tests_module $module` |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2402 if test -n "$testsmodule"; then |
13299
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2403 deps="$deps $testsmodule" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2404 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2405 fi |
13299
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2406 for dep in $deps; do |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2407 # Determine whether to include the dependency or tests module. |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2408 inc=true |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2409 for word in `func_get_status $dep`; do |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2410 case "$word" in |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2411 obsolete) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2412 test -n "$incobsolete" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2413 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2414 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2415 c++-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2416 test -z "$excl_cxx_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2417 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2418 test -n "$fmtc_inc_all_tests" || test -n "$inc_cxx_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2419 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2420 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2421 longrunning-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2422 test -z "$excl_longrunning_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2423 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2424 test -n "$fmtc_inc_all_tests" || test -n "$inc_longrunning_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2425 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2426 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2427 privileged-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2428 test -z "$excl_privileged_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2429 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2430 test -n "$fmtc_inc_all_tests" || test -n "$inc_privileged_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2431 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2432 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2433 unportable-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2434 test -z "$excl_unportable_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2435 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2436 test -n "$fmtc_inc_all_tests" || test -n "$inc_unportable_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2437 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2438 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2439 *-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2440 test -n "$fmtc_inc_all_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2441 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2442 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2443 esac |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2444 done |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2445 if $inc; then |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2446 func_append inmodules " $dep" |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2447 fi |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2448 done |
5981 | 2449 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2450 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2451 done |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2452 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
|
2453 # Remove $handledmodules from $inmodules. |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2454 for m in $inmodules; do echo $m; done | LC_ALL=C sort -u > "$tmp"/queued-modules |
12881
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
2455 inmodules=`echo "$handledmodules" | LC_ALL=C join -v 2 - "$tmp"/queued-modules` |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2456 fmtc_inc_all_tests="$inc_all_indirect_tests" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2457 done |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2458 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
|
2459 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
|
2460 } |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2461 |
13420
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2462 # func_show_module_list |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2463 # Input: |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2464 # - specified_modules list of specified modules (one per line, sorted) |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2465 # - modules complete list of modules (one per line, sorted) |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2466 # - tmp pathname of a temporary directory |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2467 func_show_module_list () |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2468 { |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2469 if case "$TERM" in |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2470 xterm*) test -t 1;; |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2471 *) false;; |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2472 esac; then |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2473 # Assume xterm compatible escape sequences. |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2474 bold_on=`printf '\x1b[1m'` |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2475 bold_off=`printf '\x1b[0m'` |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2476 else |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2477 bold_on= |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2478 bold_off= |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2479 fi |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2480 echo "Module list with included dependencies (indented):" |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2481 echo "$specified_modules" | sed -e '/^$/d' -e 's/$/| /' > "$tmp"/specified-modules |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2482 echo "$modules" | sed -e '/^$/d' \ |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2483 | LC_ALL=C join -t '|' -a 2 "$tmp"/specified-modules - \ |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2484 | sed -e 's/^\(.*\)|.*/|\1/' -e 's/^/ /' -e 's/^ |\(.*\)$/ '"${bold_on}"'\1'"${bold_off}"'/' |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2485 } |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
2486 |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2487 # func_modules_add_dummy |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2488 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2489 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2490 # - modcache true or false, from --cache-modules/--no-cache-modules |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2491 # - 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
|
2492 # Output: |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2493 # - 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
|
2494 func_modules_add_dummy () |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2495 { |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2496 # Determine whether any module provides a lib_SOURCES augmentation. |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2497 have_lib_SOURCES= |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2498 sed_remove_backslash_newline=':a |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2499 /\\$/{ |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2500 s/\\$// |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2501 N |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2502 s/\n// |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2503 ba |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2504 }' |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2505 for module in $modules; do |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2506 func_verify_nontests_module |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2507 if test -n "$module"; then |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2508 # 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
|
2509 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
|
2510 # 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
|
2511 case "$file" in |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2512 *.h) ;; |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2513 *) |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2514 have_lib_SOURCES=yes |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2515 break 2 |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2516 ;; |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2517 esac |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2518 done |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2519 fi |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2520 done |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2521 # 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
|
2522 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
|
2523 if func_acceptable "dummy"; then |
9c0fa5819ce3
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8626
diff
changeset
|
2524 func_append modules " dummy" |
9c0fa5819ce3
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8626
diff
changeset
|
2525 fi |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2526 fi |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2527 } |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
2528 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2529 # func_modules_notice |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2530 # Input: |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2531 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2532 # - modcache true or false, from --cache-modules/--no-cache-modules |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2533 # - 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
|
2534 # - modules list of modules, including dependencies |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2535 func_modules_notice () |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2536 { |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2537 if test $verbose -ge -1; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2538 for module in $modules; do |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2539 func_verify_module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2540 if test -n "$module"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2541 msg=`func_get_notice $module` |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2542 if test -n "$msg"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2543 echo "Notice from module $module:" |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2544 echo "$msg" | sed -e 's/^/ /' |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2545 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2546 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2547 done |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2548 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2549 } |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2550 |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2551 # func_modules_to_filelist |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2552 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2553 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2554 # - modcache true or false, from --cache-modules/--no-cache-modules |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2555 # - 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
|
2556 # Output: |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2557 # - files list of files |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2558 func_modules_to_filelist () |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2559 { |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2560 files= |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2561 for module in $modules; do |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2562 func_verify_module |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2563 if test -n "$module"; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2564 fs=`func_get_filelist $module` |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2565 func_append files " $fs" |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2566 fi |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2567 done |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
2568 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
|
2569 } |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
2570 |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2571 # func_execute_command command [args...] |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2572 # Executes a command. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2573 # Uses also the variables |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2574 # - verbose integer, default 0, inc/decremented by --verbose/--quiet |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2575 func_execute_command () |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2576 { |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2577 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2578 echo "executing $*" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2579 "$@" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2580 else |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
2581 # 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
|
2582 # Turn this output off if the command succeeds. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2583 "$@" > "$tmp"/cmdout 2>&1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2584 cmdret=$? |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2585 if test $cmdret = 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2586 rm -f "$tmp"/cmdout |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2587 else |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2588 echo "executing $*" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2589 cat "$tmp"/cmdout 1>&2 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2590 rm -f "$tmp"/cmdout |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2591 (exit $cmdret) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2592 fi |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2593 fi |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2594 } |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
2595 |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2596 # func_dest_tmpfilename file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2597 # determines the name of a temporary file (file is relative to destdir). |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2598 # Input: |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2599 # - destdir target directory |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2600 # - doit : if actions shall be executed, false if only to be printed |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2601 # - tmp pathname of a temporary directory |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2602 # Sets variable: |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2603 # - tmpfile absolute filename of the temporary file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2604 func_dest_tmpfilename () |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2605 { |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2606 if $doit; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2607 # Put the new contents of $file in a file in the same directory (needed |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2608 # to guarantee that an 'mv' to "$destdir/$file" works). |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2609 tmpfile="$destdir/$1.tmp" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2610 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2611 # Put the new contents of $file in a file in a temporary directory |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2612 # (because the directory of "$file" might not exist). |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2613 tmpfile="$tmp"/`basename "$1"`.tmp |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2614 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2615 } |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2616 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2617 # func_add_file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2618 # copies a file from gnulib into the destination directory. The destination |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2619 # is known to not exist. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2620 # Input: |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2621 # - destdir target directory |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2622 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2623 # - modcache true or false, from --cache-modules/--no-cache-modules |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2624 # - f the original file name |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2625 # - lookedup_file name of the merged (combined) file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2626 # - lookedup_tmp true if it is located in the tmp directory, blank otherwise |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2627 # - g the rewritten file name |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2628 # - tmpfile absolute filename of the temporary file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2629 # - doit : if actions shall be executed, false if only to be printed |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2630 # - symbolic true if files should be symlinked, copied otherwise |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2631 # - lsymbolic true if files from local_gnulib_dir should be symlinked, |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2632 # copied otherwise |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2633 func_add_file () |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2634 { |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2635 if $doit; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2636 echo "Copying file $g" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2637 if { test -n "$symbolic" \ |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2638 || { test -n "$lsymbolic" \ |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2639 && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; } \ |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2640 && test -z "$lookedup_tmp" \ |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2641 && cmp "$lookedup_file" "$tmpfile" > /dev/null; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2642 func_ln_if_changed "$lookedup_file" "$destdir/$g" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2643 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2644 mv -f "$tmpfile" "$destdir/${g}" || func_fatal_error "failed" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2645 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2646 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2647 echo "Copy file $g" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2648 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2649 } |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2650 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2651 # func_update_file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2652 # copies a file from gnulib into the destination directory. The destination |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2653 # is known to exist. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2654 # Input: |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2655 # - destdir target directory |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2656 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2657 # - modcache true or false, from --cache-modules/--no-cache-modules |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2658 # - f the original file name |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2659 # - lookedup_file name of the merged (combined) file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2660 # - lookedup_tmp true if it is located in the tmp directory, blank otherwise |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2661 # - g the rewritten file name |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2662 # - tmpfile absolute filename of the temporary file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2663 # - doit : if actions shall be executed, false if only to be printed |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2664 # - symbolic true if files should be symlinked, copied otherwise |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2665 # - lsymbolic true if files from local_gnulib_dir should be symlinked, |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2666 # copied otherwise |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2667 # - already_present nonempty if the file should already exist, empty otherwise |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2668 func_update_file () |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2669 { |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2670 if cmp "$destdir/$g" "$tmpfile" > /dev/null; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2671 : # The file has not changed. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2672 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2673 # Replace the file. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2674 if $doit; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2675 if test -n "$already_present"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2676 echo "Updating file $g (backup in ${g}~)" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2677 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2678 echo "Replacing file $g (non-gnulib code backed up in ${g}~) !!" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2679 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2680 mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2681 if { test -n "$symbolic" \ |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2682 || { test -n "$lsymbolic" \ |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2683 && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; } \ |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2684 && test -z "$lookedup_tmp" \ |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2685 && cmp "$lookedup_file" "$tmpfile" > /dev/null; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2686 func_ln_if_changed "$lookedup_file" "$destdir/$g" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2687 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2688 mv -f "$tmpfile" "$destdir/${g}" || func_fatal_error "failed" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2689 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2690 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2691 if test -n "$already_present"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2692 echo "Update file $g (backup in ${g}~)" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2693 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2694 echo "Replace file $g (non-gnulib code backed up in ${g}~) !!" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2695 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2696 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2697 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2698 } |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
2699 |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2700 # 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
|
2701 # 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
|
2702 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2703 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2704 # - modcache true or false, from --cache-modules/--no-cache-modules |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2705 # - 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
|
2706 # - libname library name |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2707 # - 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
|
2708 # - 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
|
2709 # - makefile_name from --makefile-name |
7077 | 2710 # - 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
|
2711 # - 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
|
2712 # - 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
|
2713 # - 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
|
2714 # - 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
|
2715 # - 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
|
2716 # 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
|
2717 # - 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
|
2718 # 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
|
2719 # Output: |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2720 # - 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
|
2721 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
|
2722 { |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2723 # 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
|
2724 # += instead of assigning them. |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2725 if test -n "$makefile_name"; then |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2726 assign='+=' |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2727 else |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2728 assign='=' |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2729 fi |
7077 | 2730 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
|
2731 libext=la |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2732 perhapsLT=LT |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
2733 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
|
2734 else |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2735 libext=a |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2736 perhapsLT= |
7335 | 2737 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
|
2738 fi |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
2739 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
|
2740 # 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
|
2741 # 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
|
2742 # "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
|
2743 # 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
|
2744 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
|
2745 else |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
2746 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
|
2747 fi |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
7391
diff
changeset
|
2748 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
|
2749 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
|
2750 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
|
2751 if test -n "$actioncmd"; then |
11465
618e55f1fba9
Work around an autoconf limitation on line lengths.
Bruno Haible <bruno@clisp.org>
parents:
11463
diff
changeset
|
2752 # The maximum line length (excluding the terminating newline) of any file |
618e55f1fba9
Work around an autoconf limitation on line lengths.
Bruno Haible <bruno@clisp.org>
parents:
11463
diff
changeset
|
2753 # that is to be preprocessed by config.status is 3070. config.status uses |
618e55f1fba9
Work around an autoconf limitation on line lengths.
Bruno Haible <bruno@clisp.org>
parents:
11463
diff
changeset
|
2754 # awk, and the HP-UX 11.00 awk fails if a line has length >= 3071; |
618e55f1fba9
Work around an autoconf limitation on line lengths.
Bruno Haible <bruno@clisp.org>
parents:
11463
diff
changeset
|
2755 # similarly, the IRIX 6.5 awk fails if a line has length >= 3072. |
618e55f1fba9
Work around an autoconf limitation on line lengths.
Bruno Haible <bruno@clisp.org>
parents:
11463
diff
changeset
|
2756 len=`echo "$actioncmd" | wc -c` |
618e55f1fba9
Work around an autoconf limitation on line lengths.
Bruno Haible <bruno@clisp.org>
parents:
11463
diff
changeset
|
2757 if test -n "$len" && test "$len" -le 3000; then |
618e55f1fba9
Work around an autoconf limitation on line lengths.
Bruno Haible <bruno@clisp.org>
parents:
11463
diff
changeset
|
2758 echo "# Reproduce by: $actioncmd" |
618e55f1fba9
Work around an autoconf limitation on line lengths.
Bruno Haible <bruno@clisp.org>
parents:
11463
diff
changeset
|
2759 fi |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2760 fi |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2761 echo |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2762 uses_subdirs= |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2763 { |
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
|
2764 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
|
2765 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
|
2766 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
|
2767 { |
cb505deddb22
Don't create a $(pkgdatadir) if there's nothing to be installed in it.
Bruno Haible <bruno@clisp.org>
parents:
7168
diff
changeset
|
2768 func_get_automake_snippet "$module" | |
12917
66202bb71d56
Fix incorrect Makefile.am generation in German locale.
Bruno Haible <bruno@clisp.org>
parents:
12903
diff
changeset
|
2769 LC_ALL=C \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2770 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
|
2771 -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
|
2772 -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
|
2773 -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
|
2774 -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
|
2775 -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
|
2776 -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
|
2777 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
|
2778 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
|
2779 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
|
2780 fi |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2781 } > "$tmp"/amsnippet |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
2782 # Skip the contents if it's entirely empty. |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2783 if grep '[^ ]' "$tmp"/amsnippet > /dev/null ; then |
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
|
2784 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
|
2785 echo |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2786 cat "$tmp"/amsnippet |
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
|
2787 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
|
2788 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
|
2789 fi |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2790 rm -f "$tmp"/amsnippet |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2791 # 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
|
2792 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
|
2793 case $f in |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2794 lib/*/*.c) |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2795 uses_subdirs=yes |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2796 break |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
2797 ;; |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2798 esac |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2799 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
|
2800 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
|
2801 done |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2802 } > "$tmp"/allsnippets |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2803 if test -z "$makefile_name"; then |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2804 # 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
|
2805 # 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
|
2806 subdir_options= |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2807 if test -n "$uses_subdirs"; then |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2808 subdir_options=' subdir-objects' |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2809 fi |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2810 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
|
2811 fi |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
2812 echo |
7246
4a748ab30907
* gnulib-tool (func_emit_lib_Makefile_am): Fix typos in
Paul Eggert <eggert@cs.ucla.edu>
parents:
7245
diff
changeset
|
2813 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
|
2814 echo "SUBDIRS =" |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2815 echo "noinst_HEADERS =" |
7701
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2816 echo "noinst_LIBRARIES =" |
7691
33b654c2cba8
Initialize also noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7660
diff
changeset
|
2817 echo "noinst_LTLIBRARIES =" |
7270
3d4ebfd658b2
A comment about automake-1.9b.
Bruno Haible <bruno@clisp.org>
parents:
7264
diff
changeset
|
2818 # 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
|
2819 # if you specify pkgdata_DATA to empty. This is a workaround. |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2820 if grep '^pkgdata_DATA *+=' "$tmp"/allsnippets > /dev/null; then |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2821 echo "pkgdata_DATA =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2822 fi |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2823 echo "EXTRA_DIST =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2824 echo "BUILT_SOURCES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2825 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
|
2826 fi |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2827 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
|
2828 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
|
2829 echo "MOSTLYCLEANDIRS =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2830 echo "CLEANFILES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2831 echo "DISTCLEANFILES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2832 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
|
2833 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2834 # 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
|
2835 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
|
2836 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
|
2837 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
|
2838 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
|
2839 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
|
2840 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
|
2841 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
|
2842 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
|
2843 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
|
2844 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
|
2845 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2846 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2847 done |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
2848 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
|
2849 echo |
13217
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
2850 if $for_test; then |
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
2851 echo "AM_CPPFLAGS = -DGNULIB_STRICT_CHECKING=1" |
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
2852 else |
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
2853 echo "AM_CPPFLAGS =" |
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
2854 fi |
11261
f0359b41944f
Make it easier to use the 'visibility' module.
Bruno Haible <bruno@clisp.org>
parents:
11249
diff
changeset
|
2855 echo "AM_CFLAGS =" |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
2856 fi |
6750
608add4e5b80
Support for packages that use "gettextize --intl". From Claudio Fontana.
Bruno Haible <bruno@clisp.org>
parents:
6745
diff
changeset
|
2857 echo |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2858 if LC_ALL=C grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *+\{0,1\}= *$libname\\.$libext\$" "$tmp"/allsnippets > /dev/null \ |
11463
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
2859 || { test -n "$makefile_name" \ |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
2860 && test -f "$sourcebase/Makefile.am" \ |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
2861 && LC_ALL=C grep "^[a-zA-Z0-9_]*_${perhapsLT}LIBRARIES *+\{0,1\}= *$libname\\.$libext\$" "$sourcebase/Makefile.am" > /dev/null; \ |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
2862 }; then |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
2863 # One of the snippets or the user's Makefile.am already specifies an |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
2864 # installation location for the library. Don't confuse automake by saying |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
2865 # it should not be installed. |
7701
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2866 : |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2867 else |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2868 # 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
|
2869 echo "noinst_${perhapsLT}LIBRARIES += $libname.$libext" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2870 fi |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2871 echo |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2872 echo "${libname}_${libext}_SOURCES =" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2873 # 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
|
2874 # 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
|
2875 echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2876 echo "${libname}_${libext}_DEPENDENCIES = \$(${macro_prefix}_${perhapsLT}LIBOBJS)" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2877 echo "EXTRA_${libname}_${libext}_SOURCES =" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2878 if test "$libtool" = true; then |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2879 echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2880 fi |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
2881 echo |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2882 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2883 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
|
2884 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2885 fi |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2886 cat "$tmp"/allsnippets \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
2887 | 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
|
2888 echo |
7086 | 2889 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
|
2890 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
|
2891 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
|
2892 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
|
2893 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
|
2894 echo " done; \\" |
03602a916a9a
Don't let the 'mostlyclean' target fail because of a nonempty directory.
Bruno Haible <bruno@clisp.org>
parents:
9009
diff
changeset
|
2895 echo " :" |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
2896 rm -f "$tmp"/allsnippets |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2897 } |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
2898 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2899 # func_emit_po_Makevars |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
2900 # 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
|
2901 # Input: |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2902 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2903 # - modcache true or false, from --cache-modules/--no-cache-modules |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2904 # - 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
|
2905 # - 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
|
2906 # - 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
|
2907 func_emit_po_Makevars () |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2908 { |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2909 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2910 func_emit_copyright_notice |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2911 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2912 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
|
2913 echo "# But here it has a '-gnulib' suffix." |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2914 echo "DOMAIN = ${po_domain}-gnulib" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2915 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2916 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
|
2917 echo "subdir = ${pobase}" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2918 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
|
2919 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2920 cat <<\EOF |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2921 # These options get passed to xgettext. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2922 XGETTEXT_OPTIONS = \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2923 --keyword=_ --flag=_:1:pass-c-format \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2924 --keyword=N_ --flag=N_:1:pass-c-format \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2925 --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
|
2926 --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
|
2927 --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
|
2928 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2929 # 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
|
2930 # $(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
|
2931 COPYRIGHT_HOLDER = Free Software Foundation, Inc. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2932 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2933 # 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
|
2934 # bugs in the untranslated strings: |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2935 # - 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
|
2936 # in the GNU gettext documentation, section 'Preparing Strings'. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2937 # - 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
|
2938 # understood. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2939 # - 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
|
2940 # money. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2941 # - Pluralisation problems. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2942 # - Incorrect English spelling. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2943 # - Incorrect formatting. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2944 # 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
|
2945 # 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
|
2946 # which the translators can contact you. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2947 MSGID_BUGS_ADDRESS = bug-gnulib@gnu.org |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2948 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2949 # 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
|
2950 # 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
|
2951 EXTRA_LOCALE_CATEGORIES = |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2952 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2953 # 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
|
2954 # 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
|
2955 # 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
|
2956 # 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
|
2957 USE_MSGCTXT = no |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2958 EOF |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2959 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2960 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2961 # func_emit_po_POTFILES_in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2962 # 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
|
2963 # Input: |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2964 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2965 # - modcache true or false, from --cache-modules/--no-cache-modules |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2966 # - 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
|
2967 # - files list of new files |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2968 func_emit_po_POTFILES_in () |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2969 { |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2970 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2971 func_emit_copyright_notice |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2972 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2973 echo "# List of files which contain translatable strings." |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2974 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
|
2975 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
2976 |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
2977 # func_emit_tests_Makefile_am witness_macro |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
2978 # 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
|
2979 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2980 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2981 # - modcache true or false, from --cache-modules/--no-cache-modules |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2982 # - modules list of modules, including dependencies |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2983 # - 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
|
2984 # - 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
|
2985 # - makefile_name from --makefile-name |
7077 | 2986 # - 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
|
2987 # - sourcebase relative directory containing lib source code |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2988 # - m4base relative directory containing autoconf macros |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
2989 # - 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
|
2990 # - 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
|
2991 # - 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
|
2992 # - 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
|
2993 # - 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
|
2994 # 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
|
2995 # - 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
|
2996 # 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
|
2997 # Output: |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
2998 # - 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
|
2999 func_emit_tests_Makefile_am () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3000 { |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
3001 witness_macro="$1" |
7077 | 3002 if test "$libtool" = true; then |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3003 libext=la |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
3004 sed_eliminate_LDFLAGS="$sed_noop" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3005 else |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3006 libext=a |
7335 | 3007 sed_eliminate_LDFLAGS='/^lib_LDFLAGS[ ]*+=/d' |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3008 fi |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3009 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
|
3010 # 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
|
3011 # 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
|
3012 # "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
|
3013 # 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
|
3014 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
|
3015 else |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
3016 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
|
3017 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3018 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
|
3019 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3020 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
|
3021 func_emit_copyright_notice |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3022 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
|
3023 uses_subdirs= |
12054
1c9a8901e75c
Fix value of uses_subdirs in tests/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
12021
diff
changeset
|
3024 { |
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
|
3025 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
|
3026 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
|
3027 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
|
3028 else |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3029 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
|
3030 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
|
3031 if test -n "$module"; then |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3032 { |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3033 func_get_automake_snippet "$module" | |
12917
66202bb71d56
Fix incorrect Makefile.am generation in German locale.
Bruno Haible <bruno@clisp.org>
parents:
12903
diff
changeset
|
3034 LC_ALL=C \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3035 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
|
3036 -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
|
3037 -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
|
3038 -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
|
3039 -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
|
3040 -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
|
3041 -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
|
3042 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
|
3043 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
|
3044 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
|
3045 fi |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3046 } > "$tmp"/amsnippet |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
3047 # Skip the contents if it's entirely empty. |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3048 if grep '[^ ]' "$tmp"/amsnippet > /dev/null ; then |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3049 # Mention long-running tests at the end. |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3050 ofd=3 |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3051 for word in `func_get_status "$module"`; do |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3052 if test "$word" = 'longrunning-test'; then |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3053 ofd=4 |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3054 break |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3055 fi |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3056 done |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3057 { echo "## begin gnulib module $module" |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3058 echo |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3059 cat "$tmp"/amsnippet |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3060 echo "## end gnulib module $module" |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3061 echo |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3062 } >&$ofd |
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
|
3063 fi |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3064 rm -f "$tmp"/amsnippet |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3065 # 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
|
3066 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
|
3067 case $f in |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3068 lib/*/*.c | tests/*/*.c) |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3069 uses_subdirs=yes |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3070 break |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3071 ;; |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3072 esac |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3073 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
|
3074 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
|
3075 done |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3076 } 3> "$tmp"/main_snippets 4> "$tmp"/longrunning_snippets |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3077 # 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
|
3078 # 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
|
3079 # 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
|
3080 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
|
3081 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
|
3082 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
|
3083 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3084 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
|
3085 echo |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3086 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
|
3087 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
|
3088 echo |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3089 fi |
6533
6bc4290ca85f
Avoid an automake error regarding the 'gettext' module.
Bruno Haible <bruno@clisp.org>
parents:
6512
diff
changeset
|
3090 # 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
|
3091 # 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
|
3092 # "AM_GNU_GETTEXT used but SUBDIRS not defined" |
13110
48f80c38f0ed
gnulib-tool: Ensure the tests in the main directory are executed first.
Bruno Haible <bruno@clisp.org>
parents:
13107
diff
changeset
|
3093 echo "SUBDIRS = ." |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3094 echo "TESTS =" |
12295
b8c65d432a3e
Add xalloc-die self-test.
Simon Josefsson <simon@josefsson.org>
parents:
12288
diff
changeset
|
3095 echo "XFAIL_TESTS =" |
10732
a97c57b9b48e
argp: Use standard gnulib idiom for EXEEXT.
Simon Josefsson <simon@josefsson.org>
parents:
10729
diff
changeset
|
3096 echo "TESTS_ENVIRONMENT =" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3097 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
|
3098 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
|
3099 echo "check_PROGRAMS =" |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3100 fi |
6548
060487c0b13c
Initialize also noinst_HEADERS to empty.
Bruno Haible <bruno@clisp.org>
parents:
6547
diff
changeset
|
3101 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
|
3102 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
|
3103 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
|
3104 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
|
3105 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
|
3106 else |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3107 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
|
3108 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3109 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3110 # 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
|
3111 # if you specify pkgdata_DATA to empty. This is a workaround. |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3112 if grep '^pkgdata_DATA *+=' "$tmp"/main_snippets "$tmp"/longrunning_snippets > /dev/null; then |
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
|
3113 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
|
3114 fi |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3115 echo "EXTRA_DIST =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3116 echo "BUILT_SOURCES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3117 echo "SUFFIXES =" |
7079 | 3118 echo "MOSTLYCLEANFILES = core *.stackdump" |
6862 | 3119 echo "MOSTLYCLEANDIRS =" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3120 echo "CLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3121 echo "DISTCLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3122 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
|
3123 # 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
|
3124 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
|
3125 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
|
3126 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
|
3127 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
|
3128 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
|
3129 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
|
3130 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
|
3131 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
|
3132 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
|
3133 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
|
3134 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3135 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3136 done |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3137 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3138 echo "AM_CPPFLAGS = \\" |
13217
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
3139 if $for_test; then |
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
3140 echo " -DGNULIB_STRICT_CHECKING=1 \\" |
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
3141 fi |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
3142 if test -n "${witness_macro}"; then |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
3143 echo " -D@${witness_macro}@=1 \\" |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
3144 fi |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3145 echo " -I. -I\$(srcdir) \\" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3146 echo " -I${testsbase_inverse} -I\$(srcdir)/${testsbase_inverse} \\" |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3147 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
|
3148 echo |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
3149 local_ldadd_before='' |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
3150 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
|
3151 if $use_libtests; then |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
3152 # 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
|
3153 # 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
|
3154 # 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
|
3155 # 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
|
3156 # 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
|
3157 # module whose dependency to 'progname' is voluntarily omitted). |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
3158 # 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
|
3159 # not matter. |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
3160 local_ldadd_before=' libtests.a' |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
3161 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
|
3162 fi |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
3163 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
|
3164 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
|
3165 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
|
3166 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
|
3167 # 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
|
3168 # 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
|
3169 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
|
3170 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
|
3171 echo "EXTRA_libtests_a_SOURCES =" |
9523
49f7561fc2d3
Allow circular dependency of separate libtests.a
Eric Blake <ebb9@byu.net>
parents:
9520
diff
changeset
|
3172 # The circular dependency in LDADD requires this. |
49f7561fc2d3
Allow circular dependency of separate libtests.a
Eric Blake <ebb9@byu.net>
parents:
9520
diff
changeset
|
3173 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
|
3174 echo |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3175 fi |
12775
03aab12b3f15
Provide EXEEXT and srcdir in TESTS_ENVIRONMENT by default.
Bruno Haible <bruno@clisp.org>
parents:
12743
diff
changeset
|
3176 # Many test scripts use ${EXEEXT} or ${srcdir}. |
03aab12b3f15
Provide EXEEXT and srcdir in TESTS_ENVIRONMENT by default.
Bruno Haible <bruno@clisp.org>
parents:
12743
diff
changeset
|
3177 # EXEEXT is defined by AC_PROG_CC through autoconf. |
03aab12b3f15
Provide EXEEXT and srcdir in TESTS_ENVIRONMENT by default.
Bruno Haible <bruno@clisp.org>
parents:
12743
diff
changeset
|
3178 # srcdir is defined by autoconf and automake. |
03aab12b3f15
Provide EXEEXT and srcdir in TESTS_ENVIRONMENT by default.
Bruno Haible <bruno@clisp.org>
parents:
12743
diff
changeset
|
3179 echo "TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='\$(srcdir)'" |
03aab12b3f15
Provide EXEEXT and srcdir in TESTS_ENVIRONMENT by default.
Bruno Haible <bruno@clisp.org>
parents:
12743
diff
changeset
|
3180 echo |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3181 cat "$tmp"/main_snippets "$tmp"/longrunning_snippets \ |
9515
b0f1495adfd8
Fix references to the build-aux directory in the generated tests/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
9514
diff
changeset
|
3182 | 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
|
3183 echo "# Clean up after Solaris cc." |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3184 echo "clean-local:" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3185 echo " rm -rf SunWS_cache" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3186 echo |
7086 | 3187 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
|
3188 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
|
3189 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
|
3190 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
|
3191 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
|
3192 echo " done; \\" |
03602a916a9a
Don't let the 'mostlyclean' target fail because of a nonempty directory.
Bruno Haible <bruno@clisp.org>
parents:
9009
diff
changeset
|
3193 echo " :" |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3194 rm -f "$tmp"/main_snippets "$tmp"/longrunning_snippets |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3195 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3196 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3197 # 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
|
3198 # 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
|
3199 # - 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
|
3200 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
|
3201 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3202 macro_prefix_arg="$1" |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
3203 # 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
|
3204 # 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
|
3205 # 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
|
3206 # 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
|
3207 # flexibility.) |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
3208 # 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
|
3209 # 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
|
3210 # 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
|
3211 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
|
3212 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
|
3213 # 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
|
3214 # 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
|
3215 # 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
|
3216 # 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
|
3217 # 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
|
3218 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
|
3219 # 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
|
3220 # 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
|
3221 # 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
|
3222 # 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
|
3223 # 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
|
3224 # in which to expect them. |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
3225 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
|
3226 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
|
3227 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
|
3228 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3229 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3230 # 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
|
3231 # 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
|
3232 # - 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
|
3233 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
|
3234 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3235 macro_prefix_arg="$1" |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
3236 # 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
|
3237 # 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
|
3238 # 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
|
3239 # check is skipped. |
10067
40a8c0b4f5e0
Oops, fix small mistake in last commit.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
3240 echo " m4_ifval(${macro_prefix_arg}_LIBSOURCES_LIST, [" |
10261 | 3241 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
|
3242 echo " for gl_file in ]${macro_prefix_arg}_LIBSOURCES_LIST[ ; do" |
10261 | 3243 echo " if test ! -r ]m4_defn([${macro_prefix_arg}_LIBSOURCES_DIR])[/\$gl_file ; then" |
3244 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
|
3245 echo " exit 1" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
3246 echo " fi" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
3247 echo " done])dnl" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
3248 echo " m4_if(m4_sysval, [0], []," |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
3249 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
|
3250 echo " ])" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
3251 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
|
3252 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
|
3253 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
|
3254 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
|
3255 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
|
3256 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
|
3257 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
|
3258 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
|
3259 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
|
3260 echo " # Remove the extension." |
472795eea368
Remove duplicates from the gl_LIBOBJS list.
Bruno Haible <bruno@clisp.org>
parents:
7497
diff
changeset
|
3261 echo " sed_drop_objext='s/\\.o\$//;s/\\.obj\$//'" |
12417 | 3262 echo " for i in \`for i in \$${macro_prefix_arg}_LIBOBJS; do echo \"\$i\"; done | sed -e \"\$sed_drop_objext\" | sort | uniq\`; 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
|
3263 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
|
3264 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
|
3265 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
|
3266 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
|
3267 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
|
3268 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
|
3269 echo " ])" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3270 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3271 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3272 # 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
|
3273 # 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
|
3274 # - 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
|
3275 # - 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
|
3276 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
|
3277 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3278 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
|
3279 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
|
3280 echo |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3281 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
|
3282 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
|
3283 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
|
3284 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
|
3285 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
|
3286 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
|
3287 echo |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3288 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
|
3289 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
|
3290 echo "AC_DEFUN([${macro_prefix_arg}_REPLACE_FUNCS], [" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
3291 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
|
3292 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
|
3293 echo "])" |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
3294 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
|
3295 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
|
3296 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
|
3297 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
|
3298 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
|
3299 echo "AC_DEFUN([${macro_prefix_arg}_LIBSOURCES], [" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
3300 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
|
3301 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
|
3302 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
|
3303 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
|
3304 echo " ])" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
3305 echo " ])" |
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
3306 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
|
3307 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
3308 |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3309 # func_import modules |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3310 # Uses also the variables |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3311 # - destdir target directory |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
3312 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3313 # - modcache true or false, from --cache-modules/--no-cache-modules |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3314 # - 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
|
3315 # - libname library name |
13632
09362ffa0085
gnulib-tool: Avoid error when run in a package without Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
13625
diff
changeset
|
3316 # - supplied_libname true if --lib was given, blank otherwise |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3317 # - 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
|
3318 # - 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
|
3319 # - 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
|
3320 # - 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
|
3321 # - 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
|
3322 # - 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
|
3323 # - inctests true if --with-tests was given, blank otherwise |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3324 # - incobsolete true if --with-obsolete was given, blank otherwise |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3325 # - inc_cxx_tests true if --with-c++-tests was given, blank otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3326 # - inc_longrunning_tests true if --with-longrunning-tests was given, blank |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3327 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3328 # - inc_privileged_tests true if --with-privileged-tests was given, blank |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3329 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3330 # - inc_unportable_tests true if --with-unportable-tests was given, blank |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3331 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3332 # - inc_all_tests true if --with-all-tests was given, blank otherwise |
5981 | 3333 # - 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
|
3334 # - 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
|
3335 # blank otherwise |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3336 # - makefile_name from --makefile-name |
7077 | 3337 # - libtool true if --libtool was given, false if --no-libtool was |
3338 # given, blank otherwise | |
3339 # - guessed_libtool true if the configure.ac file uses libtool, false otherwise | |
6176 | 3340 # - 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
|
3341 # - 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
|
3342 # - 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
|
3343 # given, blank otherwise |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
3344 # - autoconf_minversion minimum supported autoconf version |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3345 # - 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
|
3346 # - symbolic true if files should be symlinked, copied otherwise |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
3347 # - 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
|
3348 # copied otherwise |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
3349 # - 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
|
3350 # blank otherwise |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3351 func_import () |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3352 { |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3353 # Get the cached settings. |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3354 cached_local_gnulib_dir= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3355 cached_specified_modules= |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3356 cached_incobsolete= |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3357 cached_inc_cxx_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3358 cached_inc_longrunning_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3359 cached_inc_privileged_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3360 cached_inc_unportable_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3361 cached_inc_all_tests= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3362 cached_avoidlist= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3363 cached_sourcebase= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3364 cached_m4base= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3365 cached_pobase= |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3366 cached_docbase= |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3367 cached_testsbase= |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
3368 cached_inctests= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3369 cached_libname= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3370 cached_lgpl= |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3371 cached_makefile_name= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3372 cached_libtool= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3373 cached_macro_prefix= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3374 cached_po_domain= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3375 cached_vc_files= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3376 cached_files= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3377 if test -f "$destdir"/$m4base/gnulib-cache.m4; then |
7077 | 3378 cached_libtool=false |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3379 my_sed_traces=' |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3380 s,#.*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3381 s,^dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3382 s, dnl .*$,, |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3383 /gl_LOCAL_DIR(/ { |
10987 | 3384 s,^.*gl_LOCAL_DIR([[ ]*\([^]"$`\\)]*\).*$,cached_local_gnulib_dir="\1",p |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3385 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3386 /gl_MODULES(/ { |
10293
3c624b3d1039
Make a sed program more robust.
Bruno Haible <bruno@clisp.org>
parents:
10261
diff
changeset
|
3387 ta |
10246
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3388 :a |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3389 s/)/)/ |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3390 tb |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3391 N |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3392 ba |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
3393 :b |
10987 | 3394 s,^.*gl_MODULES([[ ]*\([^]"$`\\)]*\).*$,cached_specified_modules="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3395 } |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3396 /gl_WITH_OBSOLETE/ { |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3397 s,^.*$,cached_incobsolete=true,p |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3398 } |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3399 /gl_WITH_CXX_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3400 s,^.*$,cached_inc_cxx_tests=true,p |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3401 } |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3402 /gl_WITH_LONGRUNNING_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3403 s,^.*$,cached_inc_longrunning_tests=true,p |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3404 } |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3405 /gl_WITH_PRIVILEGED_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3406 s,^.*$,cached_inc_privileged_tests=true,p |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3407 } |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3408 /gl_WITH_UNPORTABLE_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3409 s,^.*$,cached_inc_unportable_tests=true,p |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3410 } |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3411 /gl_WITH_ALL_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3412 s,^.*$,cached_inc_all_tests=true,p |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3413 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3414 /gl_AVOID(/ { |
10987 | 3415 s,^.*gl_AVOID([[ ]*\([^]"$`\\)]*\).*$,cached_avoidlist="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3416 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3417 /gl_SOURCE_BASE(/ { |
10987 | 3418 s,^.*gl_SOURCE_BASE([[ ]*\([^]"$`\\)]*\).*$,cached_sourcebase="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3419 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3420 /gl_M4_BASE(/ { |
10987 | 3421 s,^.*gl_M4_BASE([[ ]*\([^]"$`\\)]*\).*$,cached_m4base="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3422 } |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3423 /gl_PO_BASE(/ { |
10987 | 3424 s,^.*gl_PO_BASE([[ ]*\([^]"$`\\)]*\).*$,cached_pobase="\1",p |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3425 } |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3426 /gl_DOC_BASE(/ { |
10987 | 3427 s,^.*gl_DOC_BASE([[ ]*\([^]"$`\\)]*\).*$,cached_docbase="\1",p |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3428 } |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3429 /gl_TESTS_BASE(/ { |
10987 | 3430 s,^.*gl_TESTS_BASE([[ ]*\([^]"$`\\)]*\).*$,cached_testsbase="\1",p |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3431 } |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
3432 /gl_WITH_TESTS/ { |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
3433 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
|
3434 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3435 /gl_LIB(/ { |
10987 | 3436 s,^.*gl_LIB([[ ]*\([^]"$`\\)]*\).*$,cached_libname="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3437 } |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3438 /gl_LGPL(/ { |
10987 | 3439 s,^.*gl_LGPL([[ ]*\([^]"$`\\)]*\).*$,cached_lgpl="\1",p |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3440 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3441 /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
|
3442 s,^.*$,cached_lgpl=yes,p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3443 } |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3444 /gl_MAKEFILE_NAME(/ { |
10987 | 3445 s,^.*gl_MAKEFILE_NAME([[ ]*\([^]"$`\\)]*\).*$,cached_makefile_name="\1",p |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3446 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3447 /gl_LIBTOOL/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3448 s,^.*$,cached_libtool=true,p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3449 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3450 /gl_MACRO_PREFIX(/ { |
10987 | 3451 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
|
3452 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3453 /gl_PO_DOMAIN(/ { |
10987 | 3454 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
|
3455 } |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3456 /gl_VC_FILES(/ { |
10987 | 3457 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
|
3458 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3459 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
|
3460 if test -f "$destdir"/$m4base/gnulib-comp.m4; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3461 my_sed_traces=' |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3462 s,#.*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3463 s,^dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3464 s, dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3465 /AC_DEFUN(\['"${cached_macro_prefix}"'_FILE_LIST\], \[/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3466 s,^.*$,cached_files=",p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3467 n |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3468 ta |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3469 :a |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3470 s,^\]).*$,", |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3471 tb |
10987 | 3472 s,["$`\\],,g |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3473 p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3474 n |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3475 ba |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3476 :b |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3477 p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3478 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3479 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
|
3480 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3481 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3482 |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3483 # Merge the cached settings with the specified ones. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3484 # 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
|
3485 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
|
3486 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
|
3487 fi |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3488 # 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
|
3489 # 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
|
3490 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
|
3491 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
|
3492 case "$destdir" in |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3493 /*) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3494 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
|
3495 *) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3496 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
|
3497 /*) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3498 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
|
3499 *) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3500 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
|
3501 local_gnulib_dir="$relconcat" ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3502 esac ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3503 esac |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3504 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
3505 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3506 # 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
|
3507 # "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
|
3508 specified_modules="$cached_specified_modules $1" |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3509 # Included obsolete modules among the dependencies if specified either way. |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3510 if test -z "$incobsolete"; then |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3511 incobsolete="$cached_incobsolete" |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
3512 fi |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3513 # Included special kinds of tests modules among the dependencies if specified |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3514 # either way. |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3515 if test -z "$inc_cxx_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3516 inc_cxx_tests="$cached_inc_cxx_tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3517 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3518 if test -z "$inc_longrunning_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3519 inc_longrunning_tests="$cached_inc_longrunning_tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3520 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3521 if test -z "$inc_privileged_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3522 inc_privileged_tests="$cached_inc_privileged_tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3523 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3524 if test -z "$inc_unportable_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3525 inc_unportable_tests="$cached_inc_unportable_tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3526 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3527 if test -z "$inc_all_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3528 inc_all_tests="$cached_inc_all_tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
3529 fi |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
3530 # --without-*-tests options are not supported here. |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
3531 excl_cxx_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
3532 excl_longrunning_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
3533 excl_privileged_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
3534 excl_unportable_tests= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3535 # 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
|
3536 # 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
|
3537 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
|
3538 avoidlist=`echo $avoidlist` |
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
3539 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3540 # The sourcebase defaults to the cached one. |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3541 if test -z "$sourcebase"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3542 sourcebase="$cached_sourcebase" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3543 if test -z "$sourcebase"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3544 func_fatal_error "missing --source-base option" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3545 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3546 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3547 # The pobase defaults to the cached one. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3548 if test -z "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3549 pobase="$cached_pobase" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3550 fi |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3551 # 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
|
3552 if test -z "$docbase"; then |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3553 docbase="$cached_docbase" |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3554 if test -z "$docbase"; then |
7076
0e471c8eb020
Tweak error message about missing --doc-base.
Bruno Haible <bruno@clisp.org>
parents:
7073
diff
changeset
|
3555 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
|
3556 fi |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3557 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3558 # The testsbase defaults to the cached one. |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3559 if test -z "$testsbase"; then |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3560 testsbase="$cached_testsbase" |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3561 if test -z "$testsbase"; then |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3562 func_fatal_error "missing --tests-base option" |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3563 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3564 fi |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
3565 # 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
|
3566 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
|
3567 inctests="$cached_inctests" |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
3568 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3569 # 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
|
3570 if test -z "$supplied_libname"; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3571 libname="$cached_libname" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3572 if test -z "$libname"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3573 func_fatal_error "missing --lib option" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3574 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3575 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3576 # Require LGPL if specified either way. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3577 if test -z "$lgpl"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3578 lgpl="$cached_lgpl" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3579 fi |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3580 # The makefile_name defaults to the cached one. |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3581 if test -z "$makefile_name"; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3582 makefile_name="$cached_makefile_name" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3583 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
3584 # 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
|
3585 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
|
3586 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
|
3587 libtool="$cached_libtool" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
3588 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
3589 libtool="$guessed_libtool" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
3590 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3591 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3592 # The macro_prefix defaults to the cached one. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3593 if test -z "$macro_prefix"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3594 macro_prefix="$cached_macro_prefix" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3595 if test -z "$macro_prefix"; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3596 func_fatal_error "missing --macro-prefix option" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3597 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3598 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3599 # The po_domain defaults to the cached one. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3600 if test -z "$po_domain"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3601 po_domain="$cached_po_domain" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3602 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3603 # 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
|
3604 if test -z "$vc_files"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3605 vc_files="$cached_vc_files" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
3606 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3607 |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3608 # Canonicalize the list of specified modules. |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
3609 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
|
3610 |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
3611 # Include all kinds of tests modules if --with-all-tests was specified. |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
3612 inc_all_direct_tests="$inc_all_tests" |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
3613 inc_all_indirect_tests="$inc_all_tests" |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
3614 |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3615 # Determine final module list. |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3616 modules="$specified_modules" |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
3617 func_modules_transitive_closure |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3618 if test $verbose -ge 0; then |
13420
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3619 func_show_module_list |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3620 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
|
3621 final_modules="$modules" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3622 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3623 # 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
|
3624 # 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
|
3625 # 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
|
3626 # 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
|
3627 # The tests-related module list is the transitive closure of the specified |
12055
4d4f9a27cde5
Add 'link-warning' to testsrelated_modules during --import.
Bruno Haible <bruno@clisp.org>
parents:
12054
diff
changeset
|
3628 # modules, including tests modules, minus the main module list excluding |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
3629 # modules of applicability 'all'. Its lib/* sources (brought in through |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
3630 # dependencies of *-tests modules) go into $testsbase/. It may contain GPLed |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
3631 # source, even if --lgpl is specified. |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3632 # 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
|
3633 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
|
3634 inctests="" |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3635 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
|
3636 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
|
3637 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
|
3638 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
|
3639 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
|
3640 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
|
3641 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
|
3642 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3643 # 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
|
3644 echo "$final_modules" | LC_ALL=C sort -u > "$tmp"/final-modules |
12881
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
3645 testsrelated_modules=`for module in $main_modules; do |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
3646 if test \`func_get_applicability $module\` = main; then |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
3647 echo $module |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
3648 fi |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
3649 done \ |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
3650 | 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
|
3651 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
|
3652 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
|
3653 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
|
3654 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3655 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3656 # 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
|
3657 modules="$main_modules" |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3658 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
|
3659 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
|
3660 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3661 # 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
|
3662 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
|
3663 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
|
3664 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
|
3665 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
|
3666 all_files=`func_get_filelist $module` |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3667 # Test whether some file in $all_files lies in lib/. |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3668 for f in $all_files; do |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3669 case $f in |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3670 lib/*) |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3671 use_libtests=true |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3672 break 2 |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3673 ;; |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3674 esac |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3675 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
|
3676 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3677 done |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3678 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3679 # 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
|
3680 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
|
3681 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
|
3682 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
|
3683 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
|
3684 fi |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3685 |
7235
3dbbe645b976
* MODULES.html.sh (Support for building documentation): Add gpl, lgpl.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7222
diff
changeset
|
3686 # 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
|
3687 if test -n "$lgpl"; then |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
3688 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
|
3689 for module in $main_modules; do |
5346 | 3690 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
|
3691 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
|
3692 'GPLed build tool') ;; |
7245 | 3693 '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
|
3694 *) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3695 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
|
3696 yes | 3) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3697 case $license in |
12310
4473116f2155
Add `gnulib-tool --import' support for LGPLv3+.
Ludovic Courtès <ludo@gnu.org>
parents:
12295
diff
changeset
|
3698 LGPL | LGPLv2+ | LGPLv3+) ;; |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
3699 *) 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
|
3700 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3701 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3702 2) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3703 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
|
3704 LGPLv2+) ;; |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
3705 *) 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
|
3706 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3707 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3708 *) 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
|
3709 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3710 ;; |
5963
6fb8c48c4dcd
* gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
3711 esac |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3712 done |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
3713 if test -n "$license_incompatibilities"; then |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
3714 # Format the license incompatibilities as a table. |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
3715 sed_expand_column1_width50_indent17='s,^\([^ ]*\) ,\1 , |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
3716 s,^\(.................................................[^ ]*\) *, \1 ,' |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
3717 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
|
3718 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
|
3719 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3720 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3721 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3722 # 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
|
3723 modules="$main_modules" |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3724 func_modules_notice |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3725 |
7199
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
3726 # 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
|
3727 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
|
3728 for module in $main_modules; do |
7245 | 3729 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
|
3730 # 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
|
3731 sed_transform_lib_file=$sed_transform_lib_file' |
7245 | 3732 s/^#ifdef[ ]*HAVE_CONFIG_H[ ]*$/#if 1/ |
3733 ' | |
3734 break | |
3735 fi | |
3736 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
|
3737 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
|
3738 if test -n "$do_copyrights"; then |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
3739 if test -n "$lgpl"; then |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
3740 # 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
|
3741 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
|
3742 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
|
3743 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
|
3744 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
|
3745 ' |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3746 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3747 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
|
3748 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
|
3749 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
|
3750 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
|
3751 ' |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3752 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
3753 *) 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
|
3754 esac |
9424
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
3755 else |
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
3756 # 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
|
3757 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
|
3758 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
|
3759 s/GNU Library General/GNU General/g |
11592
345504ca672e
gnulib-tool: Don't use non-POSIX regexps.
Simon Josefsson <simon@josefsson.org>
parents:
11560
diff
changeset
|
3760 s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g |
9424
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
3761 ' |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
3762 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
|
3763 fi |
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
3764 |
11594
36af7f748bb9
Don't do HAVE_CONFIG_H replacements on build-aux/ files.
Bruno Haible <bruno@clisp.org>
parents:
11593
diff
changeset
|
3765 # Determine script to apply to auxiliary files that go into $auxdir/. |
36af7f748bb9
Don't do HAVE_CONFIG_H replacements on build-aux/ files.
Bruno Haible <bruno@clisp.org>
parents:
11593
diff
changeset
|
3766 sed_transform_build_aux_file= |
11593
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3767 if test -n "$do_copyrights"; then |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3768 # Update license. |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3769 sed_transform_build_aux_file=$sed_transform_build_aux_file' |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3770 s/GNU Lesser General/GNU General/g |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3771 s/GNU Library General/GNU General/g |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3772 s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3773 ' |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3774 fi |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3775 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3776 # 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
|
3777 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
|
3778 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
|
3779 # 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
|
3780 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
|
3781 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
|
3782 s/GNU Library General/GNU General/g |
11592
345504ca672e
gnulib-tool: Don't use non-POSIX regexps.
Simon Josefsson <simon@josefsson.org>
parents:
11560
diff
changeset
|
3783 s/version 2\(.1\)\{0,1\}\([ ,]\)/version 3\2/g |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3784 ' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3785 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3786 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3787 # 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
|
3788 # 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
|
3789 # $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
|
3790 # 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
|
3791 # 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
|
3792 # 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
|
3793 modules="$main_modules" |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3794 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
|
3795 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
|
3796 # 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
|
3797 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
|
3798 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
|
3799 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
|
3800 # 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
|
3801 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
|
3802 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
|
3803 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3804 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
|
3805 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
|
3806 echo "$files" | sed -e "$sed_prettyprint_files" -e 's/^/ /' |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3807 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3808 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3809 test -n "$files" \ |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3810 || 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
|
3811 |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3812 # 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
|
3813 new_files="$files m4/gnulib-tool.m4" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3814 old_files="$cached_files" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3815 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
|
3816 func_append old_files " m4/gnulib-tool.m4" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3817 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3818 |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3819 rewritten='%REWRITTEN%' |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3820 sed_rewrite_old_files="\ |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3821 s,^build-aux/,$rewritten$auxdir/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3822 s,^doc/,$rewritten$cached_docbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3823 s,^lib/,$rewritten$cached_sourcebase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3824 s,^m4/,$rewritten$cached_m4base/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3825 s,^tests/,$rewritten$cached_testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3826 s,^tests=lib/,$rewritten$cached_testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3827 s,^top/,$rewritten, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3828 s,^$rewritten,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3829 sed_rewrite_new_files="\ |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3830 s,^build-aux/,$rewritten$auxdir/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3831 s,^doc/,$rewritten$docbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3832 s,^lib/,$rewritten$sourcebase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3833 s,^m4/,$rewritten$m4base/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3834 s,^tests/,$rewritten$testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3835 s,^tests=lib/,$rewritten$testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3836 s,^top/,$rewritten, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
3837 s,^$rewritten,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3838 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
3839 # Create directories. |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3840 { echo "$sourcebase" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3841 echo "$m4base" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3842 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3843 echo "$pobase" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3844 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3845 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
|
3846 if test -n "$docfiles"; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3847 echo "$docbase" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3848 fi |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3849 if test -n "$inctests"; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3850 echo "$testsbase" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
3851 fi |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3852 echo "$auxdir" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3853 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
|
3854 | sed -e "$sed_rewrite_new_files" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3855 | sed -n -e 's,^\(.*\)/[^/]*,\1,p' \ |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3856 | LC_ALL=C sort -u |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3857 } > "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3858 { # Rearrange file descriptors. Needed because "while ... done < ..." |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3859 # 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
|
3860 exec 5<&0 < "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3861 while read d; do |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3862 if test ! -d "$destdir/$d"; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3863 if $doit; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3864 echo "Creating directory $destdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3865 mkdir -p "$destdir/$d" || func_fatal_error "failed" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3866 else |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3867 echo "Create directory $destdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3868 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3869 fi |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3870 done |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3871 exec 0<&5 5<&- |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
3872 } |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
3873 |
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
|
3874 # 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
|
3875 added_files='' |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3876 removed_files='' |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3877 delimiter=' ' |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3878 # 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
|
3879 # 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
|
3880 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
|
3881 | 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
|
3882 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3883 > "$tmp"/old-files |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3884 # 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
|
3885 # representing the files after this gnulib-tool invocation. |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3886 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
|
3887 | 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
|
3888 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3889 > "$tmp"/new-files |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3890 # 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
|
3891 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
|
3892 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
|
3893 # 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
|
3894 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
|
3895 if $doit; then |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3896 echo "Removing file $g (backup in ${g}~)" |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3897 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
|
3898 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3899 echo "Remove file $g (backup in ${g}~)" |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
3900 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3901 func_append removed_files "$g$nl" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3902 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3903 done |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3904 # 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
|
3905 # Uses parameters |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3906 # - f the original file name |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3907 # - g the rewritten file name |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3908 # - already_present nonempty if the file should already exist, empty |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3909 # otherwise |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3910 func_add_or_update () |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3911 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3912 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
|
3913 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
|
3914 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
|
3915 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
|
3916 func_dest_tmpfilename "$g" |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
3917 func_lookup_file "$f" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
3918 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
|
3919 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
|
3920 case "$of" in |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3921 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
|
3922 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
|
3923 < "$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
|
3924 ;; |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3925 esac |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3926 fi |
11593
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3927 if test -n "$sed_transform_build_aux_file"; then |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3928 case "$of" in |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3929 build-aux/*) |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3930 sed -e "$sed_transform_build_aux_file" \ |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3931 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed" |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3932 ;; |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3933 esac |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
3934 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
|
3935 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
|
3936 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
|
3937 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
|
3938 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
|
3939 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3940 ;; |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3941 esac |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
3942 fi |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3943 if test -f "$destdir/$g"; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3944 # The file already exists. |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3945 func_update_file |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3946 else |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3947 # Install the file. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3948 # 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
|
3949 # frequently that developers don't put autogenerated files into CVS. |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3950 func_add_file |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
3951 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
|
3952 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
|
3953 rm -f "$tmpfile" |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3954 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3955 # 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
|
3956 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
|
3957 already_present= |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3958 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
|
3959 | sed -e "$sed_take_last_column" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3960 | 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
|
3961 { # 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
|
3962 # 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
|
3963 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
|
3964 while read g f; do |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3965 func_add_or_update |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3966 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
3967 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3968 } |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
3969 # 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
|
3970 already_present=true |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
3971 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
|
3972 | sed -e "$sed_take_last_column" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3973 | 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
|
3974 { # 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
|
3975 # 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
|
3976 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
|
3977 while read g f; do |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3978 func_add_or_update |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3979 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
3980 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
3981 } |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
3982 |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
3983 # 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
|
3984 actioncmd="gnulib-tool --import" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3985 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
|
3986 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
|
3987 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
|
3988 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3989 func_append actioncmd " --lib=$libname" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3990 func_append actioncmd " --source-base=$sourcebase" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3991 func_append actioncmd " --m4-base=$m4base" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3992 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3993 func_append actioncmd " --po-base=$pobase" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3994 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3995 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
|
3996 func_append actioncmd " --tests-base=$testsbase" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3997 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
|
3998 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
|
3999 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
|
4000 fi |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4001 if test -n "$incobsolete"; then |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4002 func_append actioncmd " --with-obsolete" |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4003 fi |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4004 if test -n "$inc_cxx_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4005 func_append actioncmd " --with-c++-tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4006 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4007 if test -n "$inc_longrunning_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4008 func_append actioncmd " --with-longrunning-tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4009 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4010 if test -n "$inc_privileged_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4011 func_append actioncmd " --with-privileged-tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4012 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4013 if test -n "$inc_unportable_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4014 func_append actioncmd " --with-unportable-tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4015 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4016 if test -n "$inc_all_tests"; then |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4017 func_append actioncmd " --with-all-tests" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4018 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4019 for module in $avoidlist; do |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4020 func_append actioncmd " --avoid=$module" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4021 done |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4022 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
|
4023 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
|
4024 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
|
4025 else |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4026 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
|
4027 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4028 fi |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4029 if test -n "$makefile_name"; then |
7600
42c51a6fef88
Fix typo in actioncmd. From Charles WIlson.
Bruno Haible <bruno@clisp.org>
parents:
7599
diff
changeset
|
4030 func_append actioncmd " --makefile-name=$makefile_name" |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4031 fi |
7077 | 4032 if test "$libtool" = true; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4033 func_append actioncmd " --libtool" |
7077 | 4034 else |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4035 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
|
4036 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4037 func_append actioncmd " --macro-prefix=$macro_prefix" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4038 if test -n "$po_domain"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4039 func_append actioncmd " --po-domain=$po_domain" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4040 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4041 if test -n "$vc_files"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4042 if test "$vc_files" = true; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4043 func_append actioncmd " --vc-files" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4044 else |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4045 func_append actioncmd " --no-vc-files" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4046 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4047 fi |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4048 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
|
4049 |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
4050 # 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
|
4051 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
|
4052 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
|
4053 else |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
4054 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
|
4055 fi |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
4056 |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
4057 # 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
|
4058 for_test=false |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
4059 |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4060 # 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
|
4061 # 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
|
4062 # 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
|
4063 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
|
4064 # 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
|
4065 # 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
|
4066 # ${value}. |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4067 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
|
4068 { |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4069 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
|
4070 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
|
4071 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
|
4072 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
|
4073 } |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4074 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
|
4075 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
|
4076 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
|
4077 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
|
4078 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4079 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
|
4080 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
|
4081 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
|
4082 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
|
4083 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4084 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
|
4085 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
|
4086 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
|
4087 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
|
4088 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
|
4089 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4090 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4091 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
|
4092 { |
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
|
4093 # 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
|
4094 # 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
|
4095 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
|
4096 s,//*$,/,' |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4097 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
|
4098 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
|
4099 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
|
4100 && ! { 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
|
4101 || 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
|
4102 || 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
|
4103 || { 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
|
4104 && { 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
|
4105 || 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
|
4106 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
|
4107 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
|
4108 done |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4109 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
|
4110 } |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4111 |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
4112 # Create library makefile. |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4113 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
|
4114 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
|
4115 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
|
4116 func_emit_lib_Makefile_am > "$tmpfile" |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4117 if test -f "$destdir"/$sourcebase/$makefile_am; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4118 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
|
4119 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4120 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4121 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4122 echo "Updating $sourcebase/$makefile_am (backup in $sourcebase/$makefile_am~)" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4123 mv -f "$destdir"/$sourcebase/$makefile_am "$destdir"/$sourcebase/$makefile_am~ |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4124 mv -f "$tmpfile" "$destdir"/$sourcebase/$makefile_am |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4125 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4126 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
|
4127 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4128 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4129 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4130 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4131 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4132 echo "Creating $sourcebase/$makefile_am" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4133 mv -f "$tmpfile" "$destdir"/$sourcebase/$makefile_am |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4134 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4135 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
|
4136 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4137 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4138 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
|
4139 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4140 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4141 # Create po/ directory. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4142 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4143 # Create po makefile and auxiliary files. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4144 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
|
4145 func_dest_tmpfilename $pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4146 func_lookup_file build-aux/po/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4147 cat "$lookedup_file" > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4148 if test -f "$destdir"/$pobase/$file; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4149 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
|
4150 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4151 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4152 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4153 echo "Updating $pobase/$file (backup in $pobase/$file~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4154 mv -f "$destdir"/$pobase/$file "$destdir"/$pobase/$file~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4155 mv -f "$tmpfile" "$destdir"/$pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4156 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4157 echo "Update $pobase/$file (backup in $pobase/$file~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4158 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4159 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4160 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4161 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4162 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4163 echo "Creating $pobase/$file" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4164 mv -f "$tmpfile" "$destdir"/$pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4165 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4166 echo "Create $pobase/$file" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4167 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4168 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4169 func_append added_files "$pobase/$file$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4170 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4171 done |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
4172 # Create po makefile parameterization, part 1. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4173 func_dest_tmpfilename $pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4174 func_emit_po_Makevars > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4175 if test -f "$destdir"/$pobase/Makevars; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4176 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
|
4177 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4178 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4179 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4180 echo "Updating $pobase/Makevars (backup in $pobase/Makevars~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4181 mv -f "$destdir"/$pobase/Makevars "$destdir"/$pobase/Makevars~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4182 mv -f "$tmpfile" "$destdir"/$pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4183 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4184 echo "Update $pobase/Makevars (backup in $pobase/Makevars~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4185 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4186 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4187 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4188 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4189 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4190 echo "Creating $pobase/Makevars" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4191 mv -f "$tmpfile" "$destdir"/$pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4192 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4193 echo "Create $pobase/Makevars" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4194 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4195 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4196 func_append added_files "$pobase/Makevars$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4197 fi |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
4198 # Create po makefile parameterization, part 2. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4199 func_dest_tmpfilename $pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4200 func_emit_po_POTFILES_in > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4201 if test -f "$destdir"/$pobase/POTFILES.in; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4202 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
|
4203 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4204 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4205 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4206 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
|
4207 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
|
4208 mv -f "$tmpfile" "$destdir"/$pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4209 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4210 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
|
4211 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4212 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4213 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4214 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4215 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4216 echo "Creating $pobase/POTFILES.in" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4217 mv -f "$tmpfile" "$destdir"/$pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4218 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4219 echo "Create $pobase/POTFILES.in" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4220 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4221 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4222 func_append added_files "$pobase/POTFILES.in$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4223 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4224 # Fetch PO files. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4225 TP_URL="http://translationproject.org/latest/" |
9187
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
4226 TP_RSYNC_URI="translationproject.org::tp/latest/" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4227 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4228 echo "Fetching gnulib PO files from $TP_URL" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4229 (cd "$destdir"/$pobase \ |
9187
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
4230 && { # 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
|
4231 # less network bandwidth, due to compression. |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
4232 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
|
4233 rsync -Lrtz "${TP_RSYNC_URI}gnulib/" . |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
4234 else |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
4235 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
|
4236 fi |
9d2d1cd46644
Prefer rsync over wget when available.
Bruno Haible <bruno@clisp.org>
parents:
9168
diff
changeset
|
4237 } |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4238 ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4239 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4240 echo "Fetch gnulib PO files from $TP_URL" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4241 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4242 # Create po/LINGUAS. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4243 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4244 func_dest_tmpfilename $pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4245 (cd "$destdir"/$pobase \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4246 && { echo '# Set of available languages.' |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4247 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
|
4248 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4249 ) > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4250 if test -f "$destdir"/$pobase/LINGUAS; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4251 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
|
4252 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4253 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4254 echo "Updating $pobase/LINGUAS (backup in $pobase/LINGUAS~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4255 mv -f "$destdir"/$pobase/LINGUAS "$destdir"/$pobase/LINGUAS~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4256 mv -f "$tmpfile" "$destdir"/$pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4257 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4258 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4259 echo "Creating $pobase/LINGUAS" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4260 mv -f "$tmpfile" "$destdir"/$pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4261 func_append added_files "$pobase/LINGUAS$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4262 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4263 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4264 if test -f "$destdir"/$pobase/LINGUAS; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4265 echo "Update $pobase/LINGUAS (backup in $pobase/LINGUAS~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4266 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4267 echo "Create $pobase/LINGUAS" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4268 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4269 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4270 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4271 |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4272 # 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
|
4273 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
|
4274 ( |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
4275 func_emit_copyright_notice |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4276 echo "#" |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4277 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
|
4278 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
|
4279 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
|
4280 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
|
4281 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4282 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4283 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
|
4284 echo "# $actioncmd" |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4285 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4286 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
|
4287 # 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
|
4288 case "$local_gnulib_dir" in |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4289 "" | /*) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4290 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
|
4291 * ) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4292 case "$destdir" in |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4293 /*) 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
|
4294 *) |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4295 # 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
|
4296 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
|
4297 relative_local_gnulib_dir="$reldir" ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4298 esac ;; |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4299 esac |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4300 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
|
4301 echo "gl_MODULES([" |
12417 | 4302 echo "$specified_modules" | sed -e 's/^/ /g' |
10246
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
4303 echo "])" |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4304 test -z "$incobsolete" || echo "gl_WITH_OBSOLETE" |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4305 test -z "$inc_cxx_tests" || echo "gl_WITH_CXX_TESTS" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4306 test -z "$inc_longrunning_tests" || echo "gl_WITH_LONGRUNNING_TESTS" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4307 test -z "$inc_privileged_tests" || echo "gl_WITH_PRIVILEGED_TESTS" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4308 test -z "$inc_unportable_tests" || echo "gl_WITH_UNPORTABLE_TESTS" |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4309 test -z "$inc_all_tests" || echo "gl_WITH_ALL_TESTS" |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4310 echo "gl_AVOID([$avoidlist])" |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4311 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
|
4312 echo "gl_M4_BASE([$m4base])" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4313 echo "gl_PO_BASE([$pobase])" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
4314 echo "gl_DOC_BASE([$docbase])" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4315 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
|
4316 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
|
4317 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
|
4318 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
|
4319 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
|
4320 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
|
4321 else |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4322 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
|
4323 fi |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4324 fi |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4325 echo "gl_MAKEFILE_NAME([$makefile_name])" |
7077 | 4326 if test "$libtool" = true; then |
4327 echo "gl_LIBTOOL" | |
4328 fi | |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4329 echo "gl_MACRO_PREFIX([$macro_prefix])" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4330 echo "gl_PO_DOMAIN([$po_domain])" |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4331 if test -n "$vc_files"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4332 echo "gl_VC_FILES([$vc_files])" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4333 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
|
4334 ) > "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4335 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
|
4336 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
|
4337 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4338 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4339 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4340 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
|
4341 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
|
4342 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
|
4343 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4344 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
|
4345 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
|
4346 cat "$tmpfile" |
6249
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
4347 echo |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
4348 echo "# gnulib-cache.m4 ends here" |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
4349 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
|
4350 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4351 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4352 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4353 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4354 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4355 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
|
4356 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
|
4357 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4358 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
|
4359 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
|
4360 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4361 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4362 fi |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4363 |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4364 # 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
|
4365 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
|
4366 ( |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
7391
diff
changeset
|
4367 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
|
4368 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
|
4369 echo "#" |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4370 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
|
4371 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
|
4372 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
|
4373 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
|
4374 echo |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4375 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
4376 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
|
4377 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
|
4378 echo "# any checks for libraries, header files, types and library functions." |
6176 | 4379 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
|
4380 echo "[" |
7105
641bac73140c
* gnulib-tool (func_import): Detect unexpanded macros in gnulib
Eric Blake <ebb9@byu.net>
parents:
7090
diff
changeset
|
4381 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
|
4382 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
|
4383 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
|
4384 echo " m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable" |
6512 | 4385 echo " AC_REQUIRE([AC_PROG_RANLIB])" |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
4386 if test -n "$uses_subdirs"; then |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
4387 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
|
4388 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
|
4389 for module in $final_modules; do |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4390 func_verify_module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4391 if test -n "$module"; then |
12983
39ddc4b73387
gnulib-tool (func_import): Explain origin of code.
Simon Josefsson <simon@josefsson.org>
parents:
12982
diff
changeset
|
4392 echo "# Code from module $module:" |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4393 func_get_autoconf_early_snippet "$module" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4394 fi |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4395 done \ |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4396 | 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
|
4397 echo "])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4398 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
4399 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
|
4400 echo "# \"Check for header files, types and library functions\"." |
6176 | 4401 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
|
4402 echo "[" |
7077 | 4403 if test "$libtool" = true; then |
4404 echo " AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" | |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4405 echo " gl_cond_libtool=true" |
7077 | 4406 else |
6512 | 4407 echo " AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4408 echo " gl_cond_libtool=false" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4409 echo " gl_libdeps=" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4410 echo " gl_ltlibdeps=" |
6414
46d47c8fe734
* gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents:
6389
diff
changeset
|
4411 fi |
6556 | 4412 if test "$auxdir" != "build-aux"; then |
4413 sed_replace_build_aux=' | |
4414 :a | |
4415 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ | |
4416 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| | |
4417 ba | |
4418 }' | |
4419 else | |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
4420 sed_replace_build_aux="$sed_noop" |
6556 | 4421 fi |
13105
6d950d2ec11e
gnulib-tool: Provide the value of --m4-base to modules.
Bruno Haible <bruno@clisp.org>
parents:
13090
diff
changeset
|
4422 echo " gl_m4_base='$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
|
4423 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
|
4424 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
|
4425 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
|
4426 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4427 if test -n "$module"; then |
12983
39ddc4b73387
gnulib-tool (func_import): Explain origin of code.
Simon Josefsson <simon@josefsson.org>
parents:
12982
diff
changeset
|
4428 echo " # Code from module $module:" |
6546
b32846b4d88d
Replace build-aux when it occurs in the autoconf snippet.
Bruno Haible <bruno@clisp.org>
parents:
6533
diff
changeset
|
4429 func_get_autoconf_snippet "$module" \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4430 | sed -e '/^$/d;' -e 's/^/ /' \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4431 -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
|
4432 -e "$sed_replace_build_aux" |
7077 | 4433 if test "$module" = 'alloca' && test "$libtool" = true; then |
5356
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
4434 echo 'changequote(,)dnl' |
12417 | 4435 echo 'LTALLOCA=`echo "$ALLOCA" | sed -e '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' |
5356
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
4436 echo 'changequote([, ])dnl' |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
4437 echo 'AC_SUBST([LTALLOCA])' |
5356
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
4438 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4439 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4440 done |
12983
39ddc4b73387
gnulib-tool (func_import): Explain origin of code.
Simon Josefsson <simon@josefsson.org>
parents:
12982
diff
changeset
|
4441 echo " # End of code from 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
|
4442 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
|
4443 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
|
4444 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
|
4445 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
|
4446 echo " gl_source_base='$testsbase'" |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4447 # Define a tests witness macro that depends on the package. |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4448 # PACKAGE is defined by AM_INIT_AUTOMAKE, PACKAGE_TARNAME is defined by AC_INIT. |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4449 # See <http://lists.gnu.org/archive/html/automake/2009-05/msg00145.html>. |
13089
a1999d4ef573
Fix definition of tests witness macro.
Bruno Haible <bruno@clisp.org>
parents:
13081
diff
changeset
|
4450 echo "changequote(,)dnl" |
13090
f870702f0e45
Fix definition of tests witness macro.
Bruno Haible <bruno@clisp.org>
parents:
13089
diff
changeset
|
4451 echo " ${macro_prefix}tests_WITNESS=IN_\`echo \"\${PACKAGE-\$PACKAGE_TARNAME}\" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'\`_GNULIB_TESTS" |
13089
a1999d4ef573
Fix definition of tests witness macro.
Bruno Haible <bruno@clisp.org>
parents:
13081
diff
changeset
|
4452 echo "changequote([, ])dnl" |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4453 echo " AC_SUBST([${macro_prefix}tests_WITNESS])" |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4454 echo " gl_module_indicator_condition=\$${macro_prefix}tests_WITNESS" |
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4455 echo " m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [\$gl_module_indicator_condition])" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4456 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
|
4457 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
|
4458 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
|
4459 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
|
4460 | 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
|
4461 -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
|
4462 -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
|
4463 -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
|
4464 -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
|
4465 -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
|
4466 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4467 done |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4468 echo " m4_popdef([gl_MODULE_INDICATOR_CONDITION])" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4469 func_emit_initmacro_end ${macro_prefix}tests |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4470 # _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
|
4471 # 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
|
4472 if test "$libtool" != true; then |
9086
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
4473 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
|
4474 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4475 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4476 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4477 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4478 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
|
4479 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
|
4480 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
|
4481 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
|
4482 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4483 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
|
4484 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
|
4485 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
|
4486 echo |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
4487 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
|
4488 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
|
4489 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
|
4490 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
|
4491 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
|
4492 ) > "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4493 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
|
4494 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
|
4495 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4496 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4497 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4498 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
|
4499 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
|
4500 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
|
4501 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4502 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
|
4503 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
|
4504 cat "$tmpfile" |
6249
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
4505 echo |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
4506 echo "# gnulib-comp.m4 ends here" |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
4507 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
|
4508 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4509 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4510 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4511 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4512 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4513 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
|
4514 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
|
4515 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4516 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
|
4517 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
|
4518 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4519 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4520 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4521 |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4522 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
|
4523 # Create tests makefile. |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4524 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
|
4525 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
|
4526 modules="$testsrelated_modules" |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4527 func_emit_tests_Makefile_am "${macro_prefix}tests_WITNESS" > "$tmpfile" |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4528 if test -f "$destdir"/$testsbase/$makefile_am; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4529 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
|
4530 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4531 else |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4532 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4533 echo "Updating $testsbase/$makefile_am (backup in $testsbase/$makefile_am~)" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4534 mv -f "$destdir"/$testsbase/$makefile_am "$destdir"/$testsbase/$makefile_am~ |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4535 mv -f "$tmpfile" "$destdir"/$testsbase/$makefile_am |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4536 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4537 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
|
4538 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4539 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4540 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4541 else |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4542 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4543 echo "Creating $testsbase/$makefile_am" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4544 mv -f "$tmpfile" "$destdir"/$testsbase/$makefile_am |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4545 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4546 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
|
4547 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4548 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4549 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
|
4550 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4551 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4552 |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4553 if test "$vc_files" != false; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4554 # Update the .cvsignore and .gitignore files. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4555 { 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
|
4556 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
|
4557 # 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
|
4558 echo "$m4base/|A|gnulib-comp.m4" |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4559 } | 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
|
4560 { # Rearrange file descriptors. Needed because "while ... done < ..." |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4561 # 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
|
4562 exec 5<&0 < "$tmp"/fileset-changes |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4563 func_update_ignorelist () |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4564 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4565 ignore="$1" |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4566 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
|
4567 # 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
|
4568 # 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
|
4569 anchor='/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4570 escaped_anchor='\/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4571 doubly_escaped_anchor='\\/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4572 else |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4573 anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4574 escaped_anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4575 doubly_escaped_anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4576 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4577 if test -f "$destdir/$dir$ignore"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4578 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
|
4579 sed -e "s|^$anchor||" < "$destdir/$dir$ignore" | LC_ALL=C sort > "$tmp"/ignore |
12881
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
4580 (echo "$dir_added" | sed -e '/^$/d' | LC_ALL=C sort -u \ |
10980
d54e63808f25
work around Solaris 8 'join' bug
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10969
diff
changeset
|
4581 | LC_ALL=C join -v 1 - "$tmp"/ignore > "$tmp"/ignore-added |
10379
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
4582 echo "$dir_removed" | sed -e '/^$/d' | LC_ALL=C sort -u \ |
10980
d54e63808f25
work around Solaris 8 'join' bug
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10969
diff
changeset
|
4583 | LC_ALL=C join -v 1 - "$tmp"/ignore > "$tmp"/ignore-removed |
10379
a4e295b67e54
Attempt to avoid error messages like "echo: write error: Broken pipe".
Bruno Haible <bruno@clisp.org>
parents:
10298
diff
changeset
|
4584 ) |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4585 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
|
4586 if $doit; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4587 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
|
4588 mv -f "$destdir/$dir$ignore" "$destdir/$dir$ignore"~ |
10981
78dea9790e0f
Fix small bug in update of .cvsignore or .gitignore.
Bruno Haible <bruno@clisp.org>
parents:
10980
diff
changeset
|
4589 { sed -e 's,/,\\/,g' -e 's,^,/^,' -e 's,$,\$/d,' < "$tmp"/ignore-removed |
11232
6df7300b55df
Make a sed expression POSIX compliant.
Bruno Haible <bruno@clisp.org>
parents:
11231
diff
changeset
|
4590 if test -n "$anchor"; then sed -e 's,/,\\/,g' -e "s,^,/^${doubly_escaped_anchor}," -e 's,$,$/d,' < "$tmp"/ignore-removed; fi |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4591 } > "$tmp"/sed-ignore-removed |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4592 { cat "$destdir/$dir$ignore"~ |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4593 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
|
4594 } | sed -f "$tmp"/sed-ignore-removed \ |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4595 > "$destdir/$dir$ignore" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4596 else |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4597 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
|
4598 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4599 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4600 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4601 else |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4602 if test -n "$dir_added"; then |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4603 if $doit; then |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4604 echo "Creating $destdir/$dir$ignore" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4605 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4606 if test "$ignore" = .cvsignore; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4607 echo ".deps" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4608 # 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
|
4609 echo ".dirstamp" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4610 fi |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
4611 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
|
4612 } > "$destdir/$dir$ignore" |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4613 else |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4614 echo "Create $destdir/$dir$ignore" |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4615 fi |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4616 fi |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4617 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4618 } |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4619 func_done_dir () |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4620 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4621 dir="$1" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4622 dir_added="$2" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4623 dir_removed="$3" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4624 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
|
4625 func_update_ignorelist .cvsignore |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4626 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4627 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
|
4628 func_update_ignorelist .gitignore |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4629 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4630 } |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4631 last_dir= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4632 last_dir_added= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4633 last_dir_removed= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4634 while read line; do |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4635 # 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
|
4636 next_dir=`echo "$line" | sed -e 's,|.*,,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4637 op=`echo "$line" | sed -e 's,^[^|]*|\([^|]*\)|.*$,\1,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4638 file=`echo "$line" | sed -e 's,^[^|]*|[^|]*|,,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4639 if test "$next_dir" != "$last_dir"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4640 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
|
4641 last_dir="$next_dir" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4642 last_dir_added= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4643 last_dir_removed= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4644 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4645 case $op in |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4646 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
|
4647 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
|
4648 esac |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4649 done |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4650 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
|
4651 exec 0<&5 5<&- |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4652 } |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4653 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
4654 |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4655 echo "Finished." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4656 echo |
5572
54000928a33d
Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents:
5527
diff
changeset
|
4657 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
|
4658 # 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
|
4659 # (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
|
4660 # - 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
|
4661 # $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
|
4662 # 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
|
4663 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
|
4664 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
|
4665 # 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
|
4666 # 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
|
4667 # then the #include directives that are surrounded by #ifs. Not sorted. |
7722 | 4668 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
|
4669 include_directive=`func_get_include_directive "$module"` |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4670 case "$nl$include_directive" in |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4671 *"$nl#if"*) |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4672 echo "$include_directive" 1>&5 |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4673 ;; |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4674 *) |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4675 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
|
4676 echo "$include_directive" | grep 'include "' 1>&7 |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4677 ;; |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4678 esac |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4679 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
|
4680 ( |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4681 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
|
4682 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
|
4683 cat "$tmp"/include-if |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4684 ) | sed -e '/^$/d' -e 's/^/ /' |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
4685 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
|
4686 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4687 for module in $main_modules; do |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4688 func_get_link_directive "$module" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4689 done \ |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4690 | 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
|
4691 if test `wc -l < "$tmp"/link` != 0; then |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4692 echo |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4693 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
|
4694 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
|
4695 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
|
4696 cat "$tmp"/link |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4697 fi |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4698 rm -f "$tmp"/link |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
4699 |
5572
54000928a33d
Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents:
5527
diff
changeset
|
4700 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
4701 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
|
4702 if test "$makefile_am" = Makefile.am; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4703 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
|
4704 else |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4705 echo " - \"include $makefile_name\" from within \"$sourcebase/Makefile.am\"," |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4706 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4707 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4708 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
|
4709 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4710 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
|
4711 if test "$makefile_am" = Makefile.am; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4712 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
|
4713 else |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4714 echo " - \"include $makefile_name\" from within \"$testsbase/Makefile.am\"," |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4715 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4716 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
|
4717 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
|
4718 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
|
4719 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
|
4720 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
|
4721 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
|
4722 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
|
4723 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
|
4724 echo " - mention \"${val}\" in ${var} in ${dir}Makefile.am," |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4725 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
|
4726 done |
6176 | 4727 echo " - invoke ${macro_prefix}_EARLY in $configure_ac, right after AC_PROG_CC," |
4728 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
|
4729 } |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4730 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4731 # func_create_testdir testdir modules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
4732 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
4733 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
4734 # - modcache true or false, from --cache-modules/--no-cache-modules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
4735 # - auxdir directory relative to destdir where to place build aux files |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4736 # - inctests true if tests should be included, blank otherwise |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4737 # - incobsolete true if obsolete modules among dependencies should be |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4738 # included, blank otherwise |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4739 # - excl_cxx_tests true if C++ interoperability tests should be excluded, |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4740 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4741 # - excl_longrunning_tests true if long-runnings tests should be excluded, |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4742 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4743 # - excl_privileged_tests true if tests that require root privileges should be |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4744 # excluded, blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4745 # - excl_unportable_tests true if tests that fail on some platforms should be |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4746 # excluded, blank otherwise |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4747 # - avoidlist list of modules to avoid |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4748 # - libtool true if --libtool was given, false if --no-libtool was |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4749 # given, blank otherwise |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4750 # - symbolic true if files should be symlinked, copied otherwise |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4751 # - lsymbolic true if files from local_gnulib_dir should be symlinked, |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
4752 # copied otherwise |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4753 func_create_testdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4754 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4755 testdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4756 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
|
4757 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
|
4758 # 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
|
4759 # Except config-h, which breaks all modules which use HAVE_CONFIG_H. |
7533
029a26ecb19a
Don't include ftruncate and mountlist by default.
Bruno Haible <bruno@clisp.org>
parents:
7530
diff
changeset
|
4760 # Except ftruncate, mountlist, which abort the configuration on mingw. FIXME. |
12923
cb00143b4bf6
Exclude lib-ignore module.
Bruno Haible <bruno@clisp.org>
parents:
12917
diff
changeset
|
4761 # Except lib-ignore, which leads to link errors when Sun C++ is used. FIXME. |
7484
57fe575409ae
--create-testdir without module names now means to use nearly all modules.
Bruno Haible <bruno@clisp.org>
parents:
7421
diff
changeset
|
4762 modules=`func_all_modules` |
12923
cb00143b4bf6
Exclude lib-ignore module.
Bruno Haible <bruno@clisp.org>
parents:
12917
diff
changeset
|
4763 modules=`for m in $modules; do case $m in config-h | ftruncate | mountlist | lib-ignore) ;; *) 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
|
4764 fi |
13419
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
4765 specified_modules="$modules" |
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
4766 |
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
4767 # Canonicalize the list of specified modules. |
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
4768 specified_modules=`for m in $specified_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
|
4769 |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
4770 # Unlike in func_import, here we want to include all kinds of tests for the |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
4771 # directly specified modules, but not for dependencies. |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
4772 inc_all_direct_tests=true |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
4773 inc_all_indirect_tests="$inc_all_tests" |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4774 |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4775 # 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
|
4776 # its dependencies. |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
4777 saved_inctests="$inctests" |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
4778 # 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
|
4779 # $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
|
4780 # 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
|
4781 inctests="" |
13419
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
4782 for requested_module in $specified_modules; do |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4783 requested_license=`func_get_license "$requested_module"` |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4784 if test "$requested_license" != GPL; then |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4785 # 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
|
4786 # 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
|
4787 # 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
|
4788 # on a GPL module. |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4789 modules="$requested_module" |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4790 func_modules_transitive_closure |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4791 for module in $modules; do |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4792 license=`func_get_license "$module"` |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4793 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4794 'GPLed build tool') ;; |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4795 'public domain' | 'unlimited' | 'unmodifiable license text') ;; |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4796 *) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4797 case "$requested_license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4798 GPLv2+) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4799 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4800 GPLv2+ | LGPLv2+) ;; |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
4801 *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4802 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4803 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4804 LGPL) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4805 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4806 LGPL | LGPLv2+) ;; |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
4807 *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4808 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4809 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4810 LGPLv2+) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4811 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4812 LGPLv2+) ;; |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
4813 *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4814 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4815 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4816 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
4817 ;; |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4818 esac |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4819 done |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4820 fi |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4821 done |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
4822 inctests="$saved_inctests" |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
4823 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4824 # Subdirectory names. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4825 sourcebase=gllib |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4826 m4base=glm4 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4827 pobase= |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
4828 docbase=gldoc |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4829 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
|
4830 macro_prefix=gl |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4831 po_domain= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4832 vc_files= |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4833 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4834 # Determine final module list. |
13419
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
4835 modules="$specified_modules" |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
4836 func_modules_transitive_closure |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4837 if test $verbose -ge 0; then |
13420
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
4838 func_show_module_list |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4839 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4840 |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
4841 # 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
|
4842 func_modules_add_dummy |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
4843 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4844 # Show banner notice of every module. |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4845 func_modules_notice |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4846 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4847 # Determine final file list. |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
4848 func_modules_to_filelist |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4849 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4850 echo "File list:" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4851 echo "$files" | sed -e 's/^/ /' |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4852 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4853 |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4854 rewritten='%REWRITTEN%' |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
4855 sed_rewrite_files="\ |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4856 s,^build-aux/,$rewritten$auxdir/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4857 s,^doc/,$rewritten$docbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4858 s,^lib/,$rewritten$sourcebase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4859 s,^m4/,$rewritten$m4base/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4860 s,^tests/,$rewritten$testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4861 s,^top/,$rewritten, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4862 s,^$rewritten,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4863 |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4864 # Create directories. |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4865 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
|
4866 | sed -e "$sed_rewrite_files" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4867 | sed -n -e 's,^\(.*\)/[^/]*,\1,p' \ |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4868 | LC_ALL=C sort -u \ |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4869 > "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4870 { # Rearrange file descriptors. Needed because "while ... done < ..." |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4871 # 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
|
4872 exec 5<&0 < "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4873 while read d; do |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4874 mkdir -p "$testdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4875 done |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4876 exec 0<&5 5<&- |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4877 } |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4878 |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4879 # Copy files or make symbolic links. |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4880 delimiter=' ' |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
4881 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
|
4882 | 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
|
4883 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
4884 > "$tmp"/files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4885 { # 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
|
4886 # 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
|
4887 exec 5<&0 < "$tmp"/files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4888 while read g f; do |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4889 func_lookup_file "$f" |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4890 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
|
4891 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
|
4892 else |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4893 ln "$lookedup_file" "$testdir/$g" 2>/dev/null || |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
4894 if { test -n "$symbolic" \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
4895 || { test -n "$lsymbolic" \ |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
4896 && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; }; then |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
4897 func_ln "$lookedup_file" "$testdir/$g" |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
4898 else |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4899 cp -p "$lookedup_file" "$testdir/$g" |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4900 fi |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
4901 fi |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4902 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
4903 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
4904 } |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4905 |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
4906 # 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
|
4907 for_test=true |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
4908 |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4909 # 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
|
4910 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
|
4911 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4912 # Create $sourcebase/Makefile.am. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4913 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
|
4914 destfile="$sourcebase/Makefile.am" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4915 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
|
4916 any_uses_subdirs="$uses_subdirs" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4917 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4918 # Create $m4base/Makefile.am. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4919 mkdir -p "$testdir/$m4base" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4920 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4921 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4922 echo "EXTRA_DIST =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4923 for f in $files; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4924 case "$f" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4925 m4/* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4926 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4927 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4928 done |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4929 ) > "$testdir/$m4base/Makefile.am" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4930 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4931 subdirs="$sourcebase $m4base" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4932 subdirs_with_configure_ac="" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4933 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
4934 if false && test -f "$testdir"/$m4base/gettext.m4; then |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4935 # Avoid stupid error message from automake: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4936 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4937 mkdir -p "$testdir/po" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4938 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4939 ) > "$testdir/po/Makefile.am" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
4940 func_append subdirs " po" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4941 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4942 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4943 if test -n "$inctests"; then |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4944 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
|
4945 # 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
|
4946 saved_auxdir="$auxdir" |
12417 | 4947 auxdir=`echo "$testsbase/" | sed -e 's%[^/][^/]*//*%../%g'`"$auxdir" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
4948 # 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
|
4949 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
|
4950 destfile="$testsbase/Makefile.am" |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4951 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
|
4952 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
|
4953 # Create $testsbase/configure.ac. |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4954 (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
|
4955 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
|
4956 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4957 echo "AM_INIT_AUTOMAKE" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4958 echo |
11931
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
4959 echo "AC_CONFIG_HEADERS([config.h])" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4960 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4961 echo "AC_PROG_CC" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4962 echo "AC_PROG_INSTALL" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4963 echo "AC_PROG_MAKE_SET" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4964 echo "AC_PROG_RANLIB" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4965 echo |
12109
b56c1bd3de46
Conditionally emit AM_PROG_CC_C_O invocation to tests/configure.ac.
Bruno Haible <bruno@clisp.org>
parents:
12055
diff
changeset
|
4966 if test -n "$uses_subdirs"; then |
b56c1bd3de46
Conditionally emit AM_PROG_CC_C_O invocation to tests/configure.ac.
Bruno Haible <bruno@clisp.org>
parents:
12055
diff
changeset
|
4967 echo "AM_PROG_CC_C_O" |
b56c1bd3de46
Conditionally emit AM_PROG_CC_C_O invocation to tests/configure.ac.
Bruno Haible <bruno@clisp.org>
parents:
12055
diff
changeset
|
4968 echo |
b56c1bd3de46
Conditionally emit AM_PROG_CC_C_O invocation to tests/configure.ac.
Bruno Haible <bruno@clisp.org>
parents:
12055
diff
changeset
|
4969 fi |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4970 for module in $modules; do |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4971 func_verify_module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4972 if test -n "$module"; then |
10854
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
4973 case $module in |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
4974 gnumakefile | maintainer-makefile) |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
4975 # These modules are meant to be used only in the top-level directory. |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
4976 ;; |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
4977 *) |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
4978 func_get_autoconf_early_snippet "$module" |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
4979 ;; |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
4980 esac |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4981 fi |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4982 done \ |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
4983 | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)\])/\1/' |
7077 | 4984 if test "$libtool" = true; then |
12978
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
4985 echo "LT_INIT([win32-dll])" |
12982
4bf217bee1d8
Fix problem with automake's definition of CXXLINK.
Bruno Haible <bruno@clisp.org>
parents:
12979
diff
changeset
|
4986 echo "LT_LANG([C++])" |
7077 | 4987 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4988 echo "gl_cond_libtool=true" |
7077 | 4989 else |
6418
e0a8b9b05999
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6414
diff
changeset
|
4990 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4991 echo "gl_cond_libtool=false" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4992 echo "gl_libdeps=" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
4993 echo "gl_ltlibdeps=" |
6414
46d47c8fe734
* gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents:
6389
diff
changeset
|
4994 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
4995 # 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
|
4996 # 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
|
4997 # at the top level: |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
4998 # 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
|
4999 # 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
|
5000 # 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
|
5001 # expansion total). |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
5002 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
|
5003 sed_replace_build_aux=' |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5004 :a |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5005 /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
|
5006 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| |
9009 | 5007 ba |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5008 }' |
13105
6d950d2ec11e
gnulib-tool: Provide the value of --m4-base to modules.
Bruno Haible <bruno@clisp.org>
parents:
13090
diff
changeset
|
5009 echo "gl_m4_base='../$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
|
5010 func_emit_initmacro_start $macro_prefix |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5011 # 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
|
5012 # 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
|
5013 # those of the tests. |
7647
c26d75cebcfa
Fix --create-testdir --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
7646
diff
changeset
|
5014 echo "gl_source_base='../$sourcebase'" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5015 for module in $modules; do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5016 func_verify_nontests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5017 if test -n "$module"; then |
10854
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5018 case $module in |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5019 gnumakefile | maintainer-makefile) |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5020 # These modules are meant to be used only in the top-level directory. |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5021 ;; |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5022 *) |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5023 func_get_autoconf_snippet "$module" \ |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5024 | sed -e "$sed_replace_build_aux" |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5025 ;; |
4e7233d13083
Don't use modules gnumakefile and maintainer-makefile in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
10744
diff
changeset
|
5026 esac |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5027 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5028 done |
7647
c26d75cebcfa
Fix --create-testdir --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
7646
diff
changeset
|
5029 echo "gl_source_base='.'" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5030 for module in $modules; do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5031 func_verify_tests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5032 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
|
5033 func_get_autoconf_snippet "$module" \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5034 | sed -e "$sed_replace_build_aux" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5035 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5036 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
|
5037 func_emit_initmacro_end $macro_prefix |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5038 # _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
|
5039 # 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
|
5040 if test "$libtool" != true; then |
9086
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
5041 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
|
5042 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5043 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5044 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5045 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5046 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
5047 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
|
5048 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
|
5049 echo |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
5050 echo "gl_INIT" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5051 echo |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
5052 # 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
|
5053 # 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
|
5054 echo "AH_TOP([#include \"../config.h\"])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5055 echo |
11931
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
5056 echo "AC_CONFIG_FILES([Makefile])" |
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
5057 echo "AC_OUTPUT" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
5058 ) > "$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
|
5059 auxdir="$saved_auxdir" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
5060 func_append subdirs " $testsbase" |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
5061 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
|
5062 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5063 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5064 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5065 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5066 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5067 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5068 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5069 echo "SUBDIRS = $subdirs" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5070 echo |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
5071 echo "ACLOCAL_AMFLAGS = -I $m4base" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5072 ) > "$testdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5073 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5074 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5075 (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
|
5076 echo "AC_INIT([dummy], [0])" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5077 if test "$auxdir" != "."; then |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5078 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5079 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5080 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5081 echo |
11931
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
5082 echo "AC_CONFIG_HEADERS([config.h])" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5083 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5084 echo "AC_PROG_CC" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5085 echo "AC_PROG_INSTALL" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5086 echo "AC_PROG_MAKE_SET" |
7106
b9fff044578d
Apply last patch also to --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7105
diff
changeset
|
5087 echo |
7777
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
5088 echo "# For autobuild." |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
5089 echo "AC_CANONICAL_BUILD" |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
5090 echo "AC_CANONICAL_HOST" |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
5091 echo |
7106
b9fff044578d
Apply last patch also to --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7105
diff
changeset
|
5092 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
|
5093 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
|
5094 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
|
5095 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
|
5096 echo |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5097 echo "AC_PROG_RANLIB" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5098 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
|
5099 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
|
5100 echo "AM_PROG_CC_C_O" |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
5101 echo |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
5102 fi |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5103 for module in $modules; do |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5104 func_verify_nontests_module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5105 if test -n "$module"; then |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5106 func_get_autoconf_early_snippet "$module" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5107 fi |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5108 done \ |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5109 | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)\])/\1/' |
7077 | 5110 if test "$libtool" = true; then |
12978
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
5111 echo "LT_INIT([win32-dll])" |
12982
4bf217bee1d8
Fix problem with automake's definition of CXXLINK.
Bruno Haible <bruno@clisp.org>
parents:
12979
diff
changeset
|
5112 echo "LT_LANG([C++])" |
7077 | 5113 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5114 echo "gl_cond_libtool=true" |
7077 | 5115 else |
6418
e0a8b9b05999
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6414
diff
changeset
|
5116 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5117 echo "gl_cond_libtool=false" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5118 echo "gl_libdeps=" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5119 echo "gl_ltlibdeps=" |
6414
46d47c8fe734
* gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents:
6389
diff
changeset
|
5120 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
5121 # 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
|
5122 # 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
|
5123 # at the top level: |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
5124 # 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
|
5125 # 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
|
5126 # 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
|
5127 # expansion total). |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
5128 echo "AC_DEFUN([gl_INIT], [" |
6556 | 5129 if test "$auxdir" != "build-aux"; then |
5130 sed_replace_build_aux=' | |
5131 :a | |
5132 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ | |
5133 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| | |
5134 ba | |
5135 }' | |
5136 else | |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
5137 sed_replace_build_aux="$sed_noop" |
6556 | 5138 fi |
13105
6d950d2ec11e
gnulib-tool: Provide the value of --m4-base to modules.
Bruno Haible <bruno@clisp.org>
parents:
13090
diff
changeset
|
5139 echo "gl_m4_base='$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
|
5140 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
|
5141 echo "gl_source_base='$sourcebase'" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5142 for module in $modules; do |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5143 func_verify_nontests_module |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5144 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
|
5145 func_get_autoconf_snippet "$module" \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5146 | sed -e "$sed_replace_build_aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5147 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5148 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
|
5149 func_emit_initmacro_end $macro_prefix |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5150 # _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
|
5151 # 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
|
5152 if test "$libtool" != true; then |
9086
110e60d88fad
(func_import): Avoid duplication of --avoid statements
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
9025
diff
changeset
|
5153 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
|
5154 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5155 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5156 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5157 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5158 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
5159 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
|
5160 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
|
5161 echo |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
5162 echo "gl_INIT" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5163 echo |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5164 if test -n "$subdirs_with_configure_ac"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5165 echo "AC_CONFIG_SUBDIRS(["`echo $subdirs_with_configure_ac`"])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5166 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5167 makefiles="Makefile" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5168 for d in $subdirs; do |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5169 # 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
|
5170 # 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
|
5171 case " $subdirs_with_configure_ac " in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5172 *" $d "*) ;; |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
5173 *) func_append makefiles " $d/Makefile" ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5174 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5175 done |
11931
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
5176 echo "AC_CONFIG_FILES([$makefiles])" |
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
5177 echo "AC_OUTPUT" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5178 ) > "$testdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5179 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5180 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5181 (cd "$testdir" |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
5182 # 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
|
5183 # 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
|
5184 if test -f $m4base/gettext.m4; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5185 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
|
5186 for f in $m4base/*.m4~; do |
10969
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
5187 if test -f $f; then |
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
5188 mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 |
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
5189 fi |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
5190 done |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
5191 fi |
12978
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
5192 if test "$libtool" = true; then |
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
5193 func_execute_command ${LIBTOOLIZE} --copy || func_exit 1 |
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
5194 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5195 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
|
5196 if ! test -d build-aux; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5197 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
|
5198 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5199 func_execute_command ${AUTOCONF} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5200 func_execute_command ${AUTOHEADER} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5201 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
|
5202 ) || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5203 if test -n "$inctests"; then |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5204 # Create autogenerated files. |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5205 (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
|
5206 # 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
|
5207 # 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
|
5208 if test -f ../$m4base/gettext.m4; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5209 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
|
5210 for f in ../$m4base/*.m4~; do |
10969
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
5211 if test -f $f; then |
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
5212 mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1 |
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
5213 fi |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5214 done |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5215 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5216 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
|
5217 if ! test -d ../build-aux; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5218 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
|
5219 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5220 func_execute_command ${AUTOCONF} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5221 func_execute_command ${AUTOHEADER} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5222 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
|
5223 ) || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5224 fi |
7866
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
5225 # 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
|
5226 # distributed (such as getdate.c). |
13107
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5227 sed_remove_make_variables='s,[$]([A-Za-z0-9_]*),,g' |
8410
bf7fdc3211a4
Avoiding the "./configure && make && make distclean" did not work most of the
Bruno Haible <bruno@clisp.org>
parents:
8356
diff
changeset
|
5228 # 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
|
5229 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
|
5230 | 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
|
5231 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
|
5232 # 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
|
5233 # 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
|
5234 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
|
5235 | 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
|
5236 | sed -e "$sed_remove_make_variables"` |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
5237 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
|
5238 case "$cleaned_files" in |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
5239 *" "$file" "*) ;; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
5240 *) echo $file ;; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
5241 esac; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
5242 done` |
13107
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5243 tests_distributed_built_sources= |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5244 if test -n "$inctests"; then |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5245 # Likewise for built files in the $testsbase directory. |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5246 tests_cleaned_files=`sed -e "$sed_remove_backslash_newline" < "$testdir/$testsbase/Makefile.am" \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5247 | sed -n -e 's,^CLEANFILES[ ]*+=\([^#]*\).*$,\1,p' -e 's,^MOSTLYCLEANFILES[ ]*+=\([^#]*\).*$,\1,p'` |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5248 tests_cleaned_files=`for file in $tests_cleaned_files; do echo " $file "; done` |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5249 tests_built_sources=`sed -e "$sed_remove_backslash_newline" < "$testdir/$testsbase/Makefile.am" \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5250 | sed -n -e 's,^BUILT_SOURCES[ ]*+=\([^#]*\).*$,\1,p' \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5251 | sed -e "$sed_remove_make_variables"` |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5252 tests_distributed_built_sources=`for file in $tests_built_sources; do |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5253 case "$tests_cleaned_files" in |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5254 *" "$file" "*) ;; |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5255 *) echo $file ;; |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5256 esac; |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5257 done` |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5258 fi |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5259 if test -n "$distributed_built_sources" || test -n "$tests_distributed_built_sources"; then |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5260 (cd "$testdir" |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5261 ./configure || func_exit 1 |
13107
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5262 if test -n "$distributed_built_sources"; then |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5263 cd "$sourcebase" |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5264 echo 'built_sources: $(BUILT_SOURCES)' >> Makefile |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5265 $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5266 built_sources \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5267 || func_exit 1 |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5268 cd .. |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5269 fi |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5270 if test -n "$tests_distributed_built_sources"; then |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5271 cd "$testsbase" |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5272 echo 'built_sources: $(BUILT_SOURCES)' >> Makefile |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5273 $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5274 built_sources \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5275 || func_exit 1 |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5276 cd .. |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5277 fi |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5278 $MAKE AUTOCONF="${AUTOCONF}" AUTOHEADER="${AUTOHEADER}" ACLOCAL="${ACLOCAL}" AUTOMAKE="${AUTOMAKE}" AUTORECONF="${AUTORECONF}" AUTOPOINT="${AUTOPOINT}" LIBTOOLIZE="${LIBTOOLIZE}" \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5279 distclean \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
5280 || func_exit 1 |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5281 ) || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5282 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5283 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5284 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5285 # func_create_megatestdir megatestdir allmodules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5286 # Input: |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
5287 # - local_gnulib_dir from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
5288 # - modcache true or false, from --cache-modules/--no-cache-modules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5289 # - 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
|
5290 func_create_megatestdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5291 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5292 megatestdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5293 allmodules="$2" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5294 if test -z "$allmodules"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5295 allmodules=`func_all_modules` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5296 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5297 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5298 megasubdirs= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5299 # First, all modules one by one. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5300 for onemodule in $allmodules; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5301 func_create_testdir "$megatestdir/$onemodule" $onemodule |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
5302 func_append megasubdirs "$onemodule " |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5303 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5304 # 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
|
5305 # Except config-h, which breaks all modules which use HAVE_CONFIG_H. |
11737
351c1d4b1ca6
Undo last gnulib-tool commit: maintainer-makefile is fixed.
Bruno Haible <bruno@clisp.org>
parents:
11734
diff
changeset
|
5306 allmodules=`for m in $allmodules; do if test $m != config-h; then echo $m; fi; done` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5307 func_create_testdir "$megatestdir/ALL" "$allmodules" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
5308 func_append megasubdirs "ALL" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5309 |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5310 # Create autobuild. |
9377
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
5311 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
|
5312 vc_witness="$gnulib_dir/CVS/Entries"; \ |
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
5313 else \ |
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
5314 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
|
5315 fi; \ |
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
5316 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
|
5317 | sed -e 's,January,01,' -e 's,Jan,01,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5318 -e 's,February,02,' -e 's,Feb,02,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5319 -e 's,March,03,' -e 's,Mar,03,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5320 -e 's,April,04,' -e 's,Apr,04,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5321 -e 's,May,05,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5322 -e 's,June,06,' -e 's,Jun,06,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5323 -e 's,July,07,' -e 's,Jul,07,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5324 -e 's,August,08,' -e 's,Aug,08,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5325 -e 's,September,09,' -e 's,Sep,09,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5326 -e 's,October,10,' -e 's,Oct,10,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5327 -e 's,November,11,' -e 's,Nov,11,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5328 -e 's,December,12,' -e 's,Dec,12,' \ |
9022
44509698ba9d
* gnulib-tool: Fix indentation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9010
diff
changeset
|
5329 -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
|
5330 -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
|
5331 (echo '#!/bin/sh' |
6840759b4ce2
Start the autobuild script with /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
8416
diff
changeset
|
5332 echo "CVSDATE=$cvsdate" |
11403
ec75c090b646
gnulib-tool: use $MAKE not make in generated files
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11261
diff
changeset
|
5333 echo ": \${MAKE=make}" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5334 echo "test -d logs || mkdir logs" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5335 echo "for module in $megasubdirs; do" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5336 echo " echo \"Working on module \$module...\"" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5337 echo " safemodule=\`echo \$module | sed -e 's|/|-|g'\`" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5338 echo " (echo \"To: gnulib@autobuild.josefsson.org\"" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5339 echo " echo" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5340 echo " set -x" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5341 echo " : autobuild project... \$module" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5342 echo " : autobuild revision... cvs-\$CVSDATE-000000" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5343 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
|
5344 echo " : autobuild hostname... \`hostname\`" |
11403
ec75c090b646
gnulib-tool: use $MAKE not make in generated files
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11261
diff
changeset
|
5345 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
|
5346 echo " echo rc=\$?" |
8419
d5e85ac6458c
Avoid using sed -e "", not supported by AIX sed.
Bruno Haible <bruno@clisp.org>
parents:
8418
diff
changeset
|
5347 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
|
5348 echo "done" |
8672
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
5349 ) > "$megatestdir/do-autobuild" |
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
5350 chmod a+x "$megatestdir/do-autobuild" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5351 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5352 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5353 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5354 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5355 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5356 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5357 echo "SUBDIRS = $megasubdirs" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
5358 echo |
8672
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
5359 echo "EXTRA_DIST = do-autobuild" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5360 ) > "$megatestdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5361 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5362 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5363 (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
|
5364 echo "AC_INIT([dummy], [0])" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5365 if test "$auxdir" != "."; then |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5366 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5367 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5368 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5369 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5370 echo "AC_PROG_MAKE_SET" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5371 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5372 echo "AC_CONFIG_SUBDIRS([$megasubdirs])" |
11931
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
5373 echo "AC_CONFIG_FILES([Makefile])" |
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
5374 echo "AC_OUTPUT" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5375 ) > "$megatestdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5376 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5377 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5378 (cd "$megatestdir" |
6547
1a65fb7ddbbb
Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents:
6546
diff
changeset
|
5379 # 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
|
5380 # 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
|
5381 # 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
|
5382 func_execute_command ${ACLOCAL} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5383 func_execute_command mkdir build-aux |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5384 func_execute_command ${AUTOCONF} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
5385 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
|
5386 ) || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5387 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5388 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5389 case $mode in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5390 "" ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5391 func_fatal_error "no mode specified" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5392 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5393 list ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5394 func_all_modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5395 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5396 |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5397 find ) |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5398 # sed expression that converts a literal to a basic regular expression. |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5399 # Needs to handle . [ \ * ^ $. |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5400 sed_literal_to_basic_regex='s/\\/\\\\/g |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5401 s/\[/\\[/g |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5402 s/\^/\\^/g |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5403 s/\([.*$]\)/[\1]/g' |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5404 for filename |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5405 do |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5406 if test -f "$gnulib_dir/$filename" \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5407 || { test -n "$local_gnulib_dir" && test -f "$local_gnulib_dir/$filename"; }; then |
12877
2e190fad4cfe
Tweak last commit: Reduce the candidate list.
Bruno Haible <bruno@clisp.org>
parents:
12876
diff
changeset
|
5408 filename_anywhere_regex=`echo "$filename" | sed -e "$sed_literal_to_basic_regex"` |
2e190fad4cfe
Tweak last commit: Reduce the candidate list.
Bruno Haible <bruno@clisp.org>
parents:
12876
diff
changeset
|
5409 filename_line_regex='^'"$filename_anywhere_regex"'$' |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5410 module_candidates=` |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5411 { |
12877
2e190fad4cfe
Tweak last commit: Reduce the candidate list.
Bruno Haible <bruno@clisp.org>
parents:
12876
diff
changeset
|
5412 (cd "$gnulib_dir" && find modules -type f -print | xargs -n 100 grep -l "$filename_line_regex" /dev/null | sed -e 's,^modules/,,') |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5413 if test -n "$local_gnulib_dir" && test -d "$local_gnulib_dir/modules"; then |
12877
2e190fad4cfe
Tweak last commit: Reduce the candidate list.
Bruno Haible <bruno@clisp.org>
parents:
12876
diff
changeset
|
5414 (cd "$local_gnulib_dir" && find modules -type f -print | xargs -n 100 grep -l "$filename_anywhere_regex" /dev/null | sed -e 's,^modules/,,' -e 's,\.diff$,,') |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5415 fi |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5416 } \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5417 | func_sanitize_modulelist \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5418 | LC_ALL=C sort -u |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5419 ` |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5420 for module in $module_candidates; do |
12877
2e190fad4cfe
Tweak last commit: Reduce the candidate list.
Bruno Haible <bruno@clisp.org>
parents:
12876
diff
changeset
|
5421 if func_get_filelist $module | grep "$filename_line_regex" > /dev/null; then |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5422 echo $module |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5423 fi |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5424 done |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5425 else |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5426 func_warning "file $filename does not exist" |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5427 fi |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5428 done |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5429 ;; |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
5430 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
5431 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
|
5432 |
5343 | 5433 # Where to import. |
5434 if test -z "$destdir"; then | |
5435 destdir=. | |
5436 fi | |
5437 test -d "$destdir" \ | |
5438 || 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
|
5439 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5440 # 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
|
5441 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
|
5442 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
|
5443 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5444 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
|
5445 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
|
5446 else |
12021
d625e819e6ea
Add advice to an error message.
Bruno Haible <bruno@clisp.org>
parents:
11931
diff
changeset
|
5447 func_fatal_error "cannot find $destdir/configure.ac - make sure you run gnulib-tool from within your package's directory" |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5448 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5449 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5450 |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5451 # Analyze configure.ac. |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5452 guessed_auxdir="." |
7077 | 5453 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
|
5454 my_sed_traces=' |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5455 s,#.*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5456 s,^dnl .*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5457 s, dnl .*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5458 /AC_CONFIG_AUX_DIR/ { |
10987 | 5459 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
|
5460 } |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5461 /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
|
5462 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
|
5463 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5464 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
|
5465 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5466 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
|
5467 auxdir="$guessed_auxdir" |
5343 | 5468 fi |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
5469 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5470 # 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
|
5471 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
|
5472 # 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
|
5473 # Any number of additional modules can be given. |
6204
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
5474 if test ! -f "$destdir/$m4base"/gnulib-cache.m4; then |
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
5475 # First use of gnulib in the given m4base. |
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
5476 test -n "$supplied_libname" || supplied_libname=true |
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
5477 test -n "$sourcebase" || sourcebase="lib" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
5478 test -n "$docbase" || docbase="doc" |
6262
bef30dac846f
Provide a default for --tests-base.
Bruno Haible <bruno@clisp.org>
parents:
6250
diff
changeset
|
5479 test -n "$testsbase" || testsbase="tests" |
6204
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
5480 test -n "$macro_prefix" || macro_prefix="gl" |
104bcb14d247
Provide defaults where needed.
Bruno Haible <bruno@clisp.org>
parents:
6199
diff
changeset
|
5481 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5482 func_import "$*" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5483 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5484 # 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
|
5485 # 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
|
5486 # 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
|
5487 # "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
|
5488 m4dirs= |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5489 m4dirs_count=0 |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5490 if test -f "$destdir"/Makefile.am; then |
12417 | 5491 aclocal_amflags=`sed -n -e '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
|
5492 m4dir_is_next= |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5493 for arg in $aclocal_amflags; do |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5494 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
|
5495 # 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
|
5496 case "$arg" in |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5497 /*) ;; |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5498 *) |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5499 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
|
5500 func_append m4dirs " $arg" |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5501 m4dirs_count=`expr $m4dirs_count + 1` |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5502 fi |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5503 ;; |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5504 esac |
8040
3905dae579b6
* gnulib-tool (func_emit_lib_Makefile_am, func_add_or_update)
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7981
diff
changeset
|
5505 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
|
5506 else |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5507 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
|
5508 m4dir_is_next=yes |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5509 else |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5510 m4dir_is_next= |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5511 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5512 fi |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5513 done |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5514 else |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5515 # 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
|
5516 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
|
5517 sedexpr1='s,^m4_include(\[\(.*\)])$,\1,p' |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5518 sedexpr2='s,^[^/]*$,.,' |
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5519 sedexpr3='s,/[^/]*$,,' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5520 m4dirs=`sed -n -e "$sedexpr1" aclocal.m4 | sed -e "$sedexpr2" -e "$sedexpr3" | LC_ALL=C sort -u` |
13632
09362ffa0085
gnulib-tool: Avoid error when run in a package without Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
13625
diff
changeset
|
5521 m4dirs=`for arg in $m4dirs; do if test -f "$destdir/$arg"/gnulib-cache.m4; then echo $arg; fi; done` |
12288
cbae19b6a9f8
gnulib-tool: correctly detect absence of m4 directories
Robert Millan <rmh.grub@aybabtu.com>
parents:
12109
diff
changeset
|
5522 m4dirs_count=`printf %s "$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
|
5523 fi |
7072
a1e9235fc6ff
Support projects without a top-level Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
7071
diff
changeset
|
5524 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5525 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
|
5526 # 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
|
5527 # 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
|
5528 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
|
5529 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
|
5530 m4base="m4" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
5531 test -n "$docbase" || docbase="doc" |
6262
bef30dac846f
Provide a default for --tests-base.
Bruno Haible <bruno@clisp.org>
parents:
6250
diff
changeset
|
5532 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
|
5533 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
|
5534 func_import "$*" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5535 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5536 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
|
5537 # 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
|
5538 # 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
|
5539 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
|
5540 func_import "$*" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5541 done |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5542 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5543 # 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
|
5544 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
|
5545 # 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
|
5546 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
|
5547 # 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
|
5548 # such as |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5549 # local_gnulib_dir, incobsolete, inc_cxx_tests, |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5550 # inc_longrunning_tests, inc_privileged_tests, |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5551 # inc_unportable_tests, inc_all_tests, avoidlist, sourcebase, |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5552 # m4base, pobase, docbase, testsbase, inctests, libname, lgpl, |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
5553 # makefile_name, 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
|
5554 # 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
|
5555 (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
|
5556 done |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5557 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5558 # Really ambiguous. |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5559 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
|
5560 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5561 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5562 fi |
6178 | 5563 fi |
5343 | 5564 ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5565 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5566 create-testdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5567 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5568 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5569 fi |
4126
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
5570 mkdir "$destdir" |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
5571 test -d "$destdir" \ |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
5572 || func_fatal_error "could not create destination directory" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5573 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5574 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5575 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5576 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5577 create-megatestdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5578 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5579 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5580 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5581 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
|
5582 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5583 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5584 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5585 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5586 test ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5587 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5588 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
|
5589 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5590 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5591 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5592 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5593 cd build |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
5594 ../configure || func_exit 1 |
11404
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
5595 $MAKE || func_exit 1 |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
5596 $MAKE check || func_exit 1 |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
5597 $MAKE distclean || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5598 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5599 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5600 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5601 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
|
5602 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5603 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5604 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5605 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5606 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5607 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5608 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5609 megatest ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5610 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5611 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
|
5612 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5613 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5614 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5615 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5616 cd build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5617 ../configure |
11404
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
5618 $MAKE |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
5619 $MAKE check |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
5620 $MAKE distclean |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5621 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5622 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5623 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5624 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
|
5625 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5626 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5627 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5628 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5629 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5630 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5631 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5632 extract-description ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5633 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5634 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5635 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5636 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5637 func_get_description "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5638 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5639 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5640 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5641 |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5642 extract-comment ) |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5643 for module |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5644 do |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5645 func_verify_module |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5646 if test -n "$module"; then |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5647 func_get_comment "$module" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5648 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5649 done |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5650 ;; |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
5651 |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5652 extract-status ) |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5653 for module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5654 do |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5655 func_verify_module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5656 if test -n "$module"; then |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5657 func_get_status "$module" |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5658 fi |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5659 done |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5660 ;; |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
5661 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5662 extract-notice ) |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5663 for module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5664 do |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5665 func_verify_module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5666 if test -n "$module"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5667 func_get_notice "$module" |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5668 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5669 done |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5670 ;; |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
5671 |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5672 extract-applicability ) |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5673 for module |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5674 do |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5675 func_verify_module |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5676 if test -n "$module"; then |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5677 func_get_applicability "$module" |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5678 fi |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5679 done |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5680 ;; |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
5681 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5682 extract-filelist ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5683 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5684 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5685 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5686 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5687 func_get_filelist "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5688 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5689 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5690 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5691 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5692 extract-dependencies ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5693 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5694 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5695 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5696 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5697 func_get_dependencies "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5698 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5699 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5700 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5701 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5702 extract-autoconf-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5703 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5704 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5705 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5706 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5707 func_get_autoconf_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5708 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5709 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5710 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5711 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5712 extract-automake-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5713 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5714 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5715 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5716 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5717 func_get_automake_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5718 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5719 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5720 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5721 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5722 extract-include-directive ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5723 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5724 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5725 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5726 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5727 func_get_include_directive "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5728 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5729 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5730 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5731 |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5732 extract-link-directive ) |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5733 for module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5734 do |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5735 func_verify_module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5736 if test -n "$module"; then |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5737 func_get_link_directive "$module" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5738 fi |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5739 done |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5740 ;; |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5741 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5742 extract-license ) |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5743 for module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5744 do |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5745 func_verify_module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5746 if test -n "$module"; then |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5747 func_get_license "$module" |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5748 fi |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5749 done |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5750 ;; |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
5751 |
4197 | 5752 extract-maintainer ) |
5753 for module | |
5754 do | |
5755 func_verify_module | |
5756 if test -n "$module"; then | |
5757 func_get_maintainer "$module" | |
5758 fi | |
5759 done | |
5760 ;; | |
5761 | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5762 extract-tests-module ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5763 for module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5764 do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5765 func_verify_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5766 if test -n "$module"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5767 func_get_tests_module "$module" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5768 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5769 done |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5770 ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
5771 |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5772 copy-file ) |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5773 # Verify the number of arguments. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5774 if test $# -lt 1 || test $# -gt 2; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5775 func_fatal_error "invalid number of arguments for --$mode" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5776 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5777 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5778 # The first argument is the file to be copied. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5779 f="$1" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5780 # Verify the file exists. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5781 func_lookup_file "$f" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5782 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5783 # The second argument is the destination; either a directory ot a file. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5784 # It defaults to the current directory. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5785 dest="$2" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5786 test -n "$dest" || dest='.' |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5787 test -n "$sourcebase" || sourcebase="lib" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5788 test -n "$m4base" || m4base="m4" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5789 test -n "$docbase" || docbase="doc" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5790 test -n "$testsbase" || testsbase="tests" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5791 test -n "$auxdir" || auxdir="build-aux" |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
5792 rewritten='%REWRITTEN%' |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5793 sed_rewrite_files="\ |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
5794 s,^build-aux/,$rewritten$auxdir/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
5795 s,^doc/,$rewritten$docbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
5796 s,^lib/,$rewritten$sourcebase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
5797 s,^m4/,$rewritten$m4base/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
5798 s,^tests/,$rewritten$testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
5799 s,^top/,$rewritten, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
5800 s,^$rewritten,," |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5801 if test -d "$dest"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5802 destdir="$dest" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5803 g=`echo "$f" | sed -e "$sed_rewrite_files"` |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5804 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5805 destdir=`dirname "$dest"` |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5806 g=`basename "$dest"` |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5807 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5808 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5809 # Create the directory for destfile. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5810 d=`dirname "$destdir/$g"` |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5811 if $doit; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5812 if test -n "$d" && test ! -d "$d"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5813 mkdir -p "$d" || func_fatal_error "failed" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5814 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5815 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5816 # Copy the file. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5817 func_dest_tmpfilename "$g" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5818 cp "$lookedup_file" "$tmpfile" || func_fatal_error "failed" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5819 already_present=true |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5820 if test -f "$destdir/$g"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5821 # The file already exists. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5822 func_update_file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5823 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5824 # Install the file. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5825 # Don't protest if the file should be there but isn't: it happens |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5826 # frequently that developers don't put autogenerated files into CVS. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5827 func_add_file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5828 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5829 rm -f "$tmpfile" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5830 ;; |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5831 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5832 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5833 func_fatal_error "unknown operation mode --$mode" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5834 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5835 |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
5836 rm -rf "$tmp" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
5837 # 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
|
5838 # 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
|
5839 # 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
|
5840 # 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
|
5841 # 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
|
5842 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
|
5843 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
|
5844 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5845 exit 0 |
7241
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
5846 |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
5847 # Local Variables: |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
5848 # indent-tabs-mode: nil |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
5849 # 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
|
5850 # End: |