Mercurial > gnulib
annotate gnulib-tool @ 40057:b06060465f09
maint: Run 'make update-copyright'
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 01 Jan 2019 00:25:11 +0100 |
parents | eb64273b66c2 |
children | 203657b01911 |
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 # |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
39944
diff
changeset
|
3 # Copyright (C) 2002-2019 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 |
19190 | 16 # along with this program. If not, see <https://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 |
39944 | 28 # You can set AUTOCONFPATH to empty if autoconf 2.63 is already in your PATH. |
4112
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 ) |
39944 | 32 # AUTOCONFBINDIR=/arch/x86-linux/gnu-inst-autoconf/2.63/bin |
5250
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 |
39943 | 37 # You can set AUTOMAKEPATH to empty if automake 1.11 is already in your PATH. |
6547
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 |
19439
8bfc20b57265
maint: shorten https://lists.gnu.org/archive/html/... links
Jim Meyering <meyering@fb.com>
parents:
19271
diff
changeset
|
85 # <https://lists.gnu.org/r/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 |
14385
ed68f818ecca
gnulib-tool: remove use of bold display in help screen
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
14323
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] |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
130 gnulib-tool --add-import [module1 ... moduleN] |
14385
ed68f818ecca
gnulib-tool: remove use of bold display in help screen
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
14323
diff
changeset
|
131 gnulib-tool --remove-import [module1 ... moduleN] |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
132 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
|
133 gnulib-tool --create-testdir --dir=directory [module1 ... moduleN] |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
134 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN] |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
135 gnulib-tool --test --dir=directory module1 ... moduleN |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
136 gnulib-tool --megatest --dir=directory [module1 ... moduleN] |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
137 gnulib-tool --extract-description module |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
138 gnulib-tool --extract-comment module |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
139 gnulib-tool --extract-status module |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
140 gnulib-tool --extract-notice module |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
141 gnulib-tool --extract-applicability module |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
142 gnulib-tool --extract-filelist module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
143 gnulib-tool --extract-dependencies module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
144 gnulib-tool --extract-autoconf-snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
145 gnulib-tool --extract-automake-snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
146 gnulib-tool --extract-include-directive module |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
147 gnulib-tool --extract-link-directive module |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
148 gnulib-tool --extract-license module |
4197 | 149 gnulib-tool --extract-maintainer module |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
150 gnulib-tool --extract-tests-module module |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
151 gnulib-tool --copy-file file [destination] |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
152 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
153 Operation modes: |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
154 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
155 --list print the available module names |
14385
ed68f818ecca
gnulib-tool: remove use of bold display in help screen
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
14323
diff
changeset
|
156 --find find the modules which contain the specified file |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
157 --import import the given modules into the current package |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
158 --add-import augment the list of imports from gnulib into the |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
159 current package, by adding the given 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
|
160 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
|
161 package from the current gnulib |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
162 --remove-import reduce the list of imports from gnulib into the |
14385
ed68f818ecca
gnulib-tool: remove use of bold display in help screen
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
14323
diff
changeset
|
163 current package, by removing the given 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
|
164 --update update the current package, restore files omitted |
13636
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
165 from version control |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
166 --create-testdir create a scratch package with the given modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
167 --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
|
168 one by one and all together |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
169 --test test the combination of the given modules |
4197 | 170 (recommended to use CC=\"gcc -Wall\" here) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
171 --megatest test the given modules one by one and all together |
4197 | 172 (recommended to use CC=\"gcc -Wall\" here) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
173 --extract-description extract the description |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
174 --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
|
175 --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
|
176 --extract-notice extract the notice or banner |
13069
5a91813baecc
Addendum to 2010-02-07 commit.
Bruno Haible <bruno@clisp.org>
parents:
13067
diff
changeset
|
177 --extract-applicability extract the applicability |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
178 --extract-filelist extract the list of files |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
179 --extract-dependencies extract the dependencies |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
180 --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
|
181 --extract-automake-snippet extract the snippet for library makefile |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
182 --extract-include-directive extract the #include directive |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
183 --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
|
184 --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
|
185 under lib/ |
4197 | 186 --extract-maintainer report the maintainer(s) inside gnulib |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
187 --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
|
188 --copy-file copy a file that is not part of any module |
16377
c06c4d94d8a4
gnulib-tool: Improve usage message.
Bruno Haible <bruno@clisp.org>
parents:
16370
diff
changeset
|
189 --help Show this help text. |
c06c4d94d8a4
gnulib-tool: Improve usage message.
Bruno Haible <bruno@clisp.org>
parents:
16370
diff
changeset
|
190 --version Show version and authorship information. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
191 |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
192 General options: |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
193 |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
194 --dir=DIRECTORY Specify the target directory. |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
195 For --import, this specifies where your |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
196 configure.ac can be found. Defaults to current |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
197 directory. |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
198 --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
|
199 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
|
200 --cache-modules Enable module caching optimization. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
201 --no-cache-modules Disable module caching optimization. |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
202 --verbose Increase verbosity. May be repeated. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
203 --quiet Decrease verbosity. May be repeated. |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
204 |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
205 Options for --import, --add/remove-import, --update: |
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
206 |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
207 --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
|
208 |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
209 Options for --import, --add/remove-import: |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
210 |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
211 --with-tests Include unit tests for the included modules. |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
212 |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
213 Options for --create-[mega]testdir, --[mega]test: |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
214 |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
215 --without-tests Don't include unit tests for the included modules. |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
216 |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
217 Options for --import, --add/remove-import, |
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
218 --create-[mega]testdir, --[mega]test: |
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
219 |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
220 --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
|
221 dependencies. By default, dependencies to obsolete |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
222 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
|
223 --with-c++-tests Include even unit tests for C++ interoperability. |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
224 --without-c++-tests Exclude unit tests for C++ interoperability. |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
225 --with-longrunning-tests |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
226 Include even unit tests that are long-runners. |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
227 --without-longrunning-tests |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
228 Exclude unit tests that are long-runners. |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
229 --with-privileged-tests |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
230 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
|
231 privileges. |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
232 --without-privileged-tests |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
233 Exclude unit tests that require root privileges. |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
234 --with-unportable-tests |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
235 Include even unit tests that fail on some platforms. |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
236 --without-unportable-tests |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
237 Exclude unit tests that fail on some platforms. |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
238 --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
|
239 --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
|
240 have code that provides equivalent functionality. |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
241 This option can be repeated. |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
242 --conditional-dependencies |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
243 Support conditional dependencies (may save configure |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
244 time and object code). |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
245 --no-conditional-dependencies |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
246 Don't use conditional dependencies. |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
247 --libtool Use libtool rules. |
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
248 --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
|
249 |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
250 Options for --import, --add/remove-import: |
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
251 |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
252 --lib=LIBRARY Specify the library name. Defaults to 'libgnu'. |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
253 --source-base=DIRECTORY |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
254 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
|
255 placed (default \"lib\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
256 --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
|
257 placed (default \"m4\"). |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
258 --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
|
259 placed (default \"po\"). |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
260 --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
|
261 placed (default \"doc\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
262 --tests-base=DIRECTORY |
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
263 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
|
264 placed (default \"tests\"). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
265 --aux-dir=DIRECTORY Directory relative to --dir where auxiliary build |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
266 tools are placed (default comes from configure.ac). |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
267 --gnu-make Output for GNU Make instead of for the default |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
268 Automake |
18501
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
269 --lgpl[=2|=3orGPLv2|=3] |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
270 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
|
271 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
|
272 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
|
273 the default is currently LGPLv3. |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
274 --makefile-name=NAME Name of makefile in the source-base and tests-base |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
275 directories (default \"Makefile.am\", or |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
276 \"Makefile.in\" if --gnu-make). |
7068
ec1cfcfd352a
Revert the --help output reordering.
Bruno Haible <bruno@clisp.org>
parents:
7067
diff
changeset
|
277 --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
|
278 'gl_INIT'. Default is 'gl'. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
279 --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
|
280 the package name. A suffix '-gnulib' is appended. |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
281 --witness-c-macro=NAME Specify the C macro that is defined when the |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
282 sources in this directory are compiled or used. |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
283 --vc-files Update version control related files. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
284 --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
|
285 (.gitignore and/or .cvsignore). |
7069
0fb5ef99e00f
Split the --help output into several paragraphs.
Bruno Haible <bruno@clisp.org>
parents:
7068
diff
changeset
|
286 |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
287 Options for --create-[mega]testdir, --[mega]test: |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
288 |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
289 --single-configure Generate a single configure file, not a separate |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
290 configure file for the tests directory. |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
291 |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
292 Options for --import, --add/remove-import, --update, |
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
293 --create-[mega]testdir, --[mega]test: |
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
294 |
6966 | 295 -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
|
296 --local-symlink Make symbolic links instead of copying files, only |
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
297 for files from the local override directory. |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
298 -h, --hardlink Make hard links instead of copying files. |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
299 --local-hardlink Make hard links instead of copying files, only |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
300 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
|
301 |
13705
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
302 Options for --import, --add/remove-import, --update: |
ed2bd36db406
gnulib-tool: Fix --help output.
Bruno Haible <bruno@clisp.org>
parents:
13660
diff
changeset
|
303 |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
304 -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
|
305 don't replace copyright notices. |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
306 -H, --more-hardlinks Make hard links instead of copying files, and |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
307 don't replace copyright notices. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
308 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
309 Report bugs to <bug-gnulib@gnu.org>." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
310 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
311 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
312 # func_version |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
313 # outputs to stdout the --version message. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
314 func_version () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
315 { |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
316 func_gnulib_dir |
9805
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
317 if test -d "$gnulib_dir"/.git \ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
318 && (git --version) >/dev/null 2>/dev/null \ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
319 && (date --version) >/dev/null 2>/dev/null; then |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
320 # gnulib checked out from git. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
321 sed_extract_first_date='/^Date/{ |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
322 s/^Date:[ ]*//p |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
323 q |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
324 }' |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
325 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
|
326 # 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
|
327 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
|
328 date=`echo "$date" | sed -e "$sed_year_before_time"` |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
329 # Use GNU date to compute the time in GMT. |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
330 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
|
331 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
|
332 else |
17378
1d9362a18c34
Assume gnulib is checked out from Git, not CVS
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
17269
diff
changeset
|
333 # gnulib copy without versioning information. |
1d9362a18c34
Assume gnulib is checked out from Git, not CVS
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
17269
diff
changeset
|
334 date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog` |
9805
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
335 version= |
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
336 fi |
12417 | 337 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
|
338 echo "\ |
9805
d3af04de9f0b
Tweak "gnulib --version" output.
Bruno Haible <bruno@clisp.org>
parents:
9804
diff
changeset
|
339 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
|
340 Copyright (C) $year Free Software Foundation, Inc. |
19190 | 341 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
342 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
|
343 There is NO WARRANTY, to the extent permitted by law. |
16802
b21cba808f11
gnulib-tool: Fix list of authors.
Bruno Haible <bruno@clisp.org>
parents:
16714
diff
changeset
|
344 " |
b21cba808f11
gnulib-tool: Fix list of authors.
Bruno Haible <bruno@clisp.org>
parents:
16714
diff
changeset
|
345 printf "Written by %s, %s, and %s.\n" "Bruno Haible" "Paul Eggert" "Simon Josefsson" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
346 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
347 |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
348 # func_emit_copyright_notice |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
349 # 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
|
350 func_emit_copyright_notice () |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
351 { |
12417 | 352 sed -n -e '/Copyright/ { |
353 p | |
354 q | |
355 }' < "$self_abspathname" | |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
356 echo "#" |
15790
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
357 echo "# This file is free software; you can redistribute it and/or modify" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
358 echo "# it under the terms of the GNU General Public License as published by" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
359 echo "# the Free Software Foundation; either version 3 of the License, or" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
360 echo "# (at your option) any later version." |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
361 echo "#" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
362 echo "# This file is distributed in the hope that it will be useful," |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
363 echo "# but WITHOUT ANY WARRANTY; without even the implied warranty of" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
364 echo "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
365 echo "# GNU General Public License for more details." |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
366 echo "#" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
367 echo "# You should have received a copy of the GNU General Public License" |
19190 | 368 echo "# along with this file. If not, see <https://www.gnu.org/licenses/>." |
15790
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
369 echo "#" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
370 echo "# As a special exception to the GNU General Public License," |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
371 echo "# this file may be distributed as part of a program that" |
ccb791a4a8a7
gnulib: use more-standard license notice wording
Paul Eggert <eggert@cs.ucla.edu>
parents:
15482
diff
changeset
|
372 echo "# contains a configuration script generated by Autoconf, under" |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
373 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
|
374 echo "#" |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
375 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
|
376 } |
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
377 |
7332
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
378 # func_exit STATUS |
10453 | 379 # exits with a given status. |
380 # This function needs to be used, rather than 'exit', when a 'trap' handler is | |
381 # 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
|
382 func_exit () |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
383 { |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
384 (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
|
385 } |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
386 |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
387 # func_gnulib_dir |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
388 # 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
|
389 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
390 # - 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
|
391 # Sets variables |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
392 # - 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
|
393 # - 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
|
394 func_gnulib_dir () |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
395 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
396 case "$progname" in |
17812
f84b5489521b
gnulib-tool: recognize x:* as an absolute path
KO Myung-Hun <komh78@gmail.com>
parents:
17754
diff
changeset
|
397 /* | ?:*) self_abspathname="$progname" ;; |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
398 */*) self_abspathname=`pwd`/"$progname" ;; |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
399 *) |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
400 # Look in $PATH. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
401 # 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
|
402 # We use IFS=: instead of |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
403 # 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
|
404 # 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
|
405 # 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
|
406 # 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
|
407 # 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
|
408 # - /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
|
409 # 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
|
410 # - /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
|
411 # 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
|
412 # - 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
|
413 # 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
|
414 # 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
|
415 # 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
|
416 self_abspathname= |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
417 if test "$PATH_SEPARATOR" = ";"; then |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
418 # 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
|
419 pathx=".;$PATH" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
420 else |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
421 # 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
|
422 pathx="$PATH" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
423 case :$PATH: in |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
424 *::*) |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
425 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
|
426 ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
427 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
428 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
429 save_IFS="$IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
430 IFS="$PATH_SEPARATOR" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
431 for d in $pathx; do |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
432 IFS="$save_IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
433 test -z "$d" && d=. |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
434 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
|
435 self_abspathname="$d/$progname" |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
436 break |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
437 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
438 done |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
439 IFS="$save_IFS" |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
440 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
|
441 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
|
442 fi |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
443 ;; |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
444 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
445 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
|
446 # Resolve symbolic link. |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
447 linkval=`func_readlink "$self_abspathname"` |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
448 test -n "$linkval" || break |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
449 case "$linkval" in |
17812
f84b5489521b
gnulib-tool: recognize x:* as an absolute path
KO Myung-Hun <komh78@gmail.com>
parents:
17754
diff
changeset
|
450 /* | ?:* ) self_abspathname="$linkval" ;; |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
451 * ) 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
|
452 esac |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
453 done |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
454 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
|
455 } |
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
456 |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
457 # func_tmpdir |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
458 # creates a temporary directory. |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
459 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
460 # - 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
|
461 # Sets variable |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
462 # - 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
|
463 func_tmpdir () |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
464 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
465 # 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
|
466 # 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
|
467 # /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
|
468 : ${TMPDIR=/tmp} |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
469 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
470 # 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
|
471 # 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
|
472 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
|
473 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
|
474 } || |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
475 { |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
476 # 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
|
477 # 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
|
478 # 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
|
479 # 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
|
480 # directory. |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
481 tmp=$TMPDIR/gl$$-$RANDOM |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
482 (umask 077 && mkdir "$tmp") |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
483 } || |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
484 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
485 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
|
486 func_exit 1 |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
487 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
488 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
489 |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
490 # func_append var value |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
491 # 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
|
492 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
|
493 # 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
|
494 # 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
|
495 func_append () |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
496 { |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
497 eval "$1+=\"\$2\"" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
498 } |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
499 fast_func_append=true |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
500 else |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
501 func_append () |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
502 { |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
503 eval "$1=\"\$$1\$2\"" |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
504 } |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
505 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
|
506 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
507 |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
508 # 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
|
509 # 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
|
510 # 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
|
511 # 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
|
512 # 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
|
513 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
|
514 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
|
515 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
516 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
|
517 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
518 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
|
519 else |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
520 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
|
521 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
522 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
|
523 prefix="$2" |
11037
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
524 case "$prefix" in |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
525 *.*) |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
526 sed_escape_dots='s/\([.]\)/\\\1/g' |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
527 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
|
528 ;; |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
529 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
|
530 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
|
531 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
|
532 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
533 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
|
534 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
535 |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
536 # Determine whether we should use ':' or ';' as PATH_SEPARATOR. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
537 func_determine_path_separator () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
538 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
539 if test "${PATH_SEPARATOR+set}" != set; then |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
540 # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
541 # contains only /bin. Note that ksh looks also at the FPATH variable, |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
542 # so we have to set that as well for the test. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
543 PATH_SEPARATOR=: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
544 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
545 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
546 || PATH_SEPARATOR=';' |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
547 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
548 fi |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
549 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
550 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
551 # func_path_prepend pathvar directory |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
552 # puts directory before pathvar, delimiting directories by PATH_SEPARATOR. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
553 # Newly added directory into pathvar has the highest priority. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
554 func_path_prepend () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
555 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
556 if eval "test -n \"\$$1\""; then |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
557 eval "$1=\$2\$PATH_SEPARATOR\$$1" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
558 else |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
559 eval "$1=\$2" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
560 fi |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
561 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
562 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
563 # func_path_append pathvar directory |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
564 # Similar to func_path_prepend except that the newest directory has the lowest |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
565 # priority. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
566 func_path_append () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
567 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
568 if eval "test -n \"\$$1\""; then |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
569 func_append "$1" "$PATH_SEPARATOR$2" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
570 else |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
571 eval "$1=\$2" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
572 fi |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
573 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
574 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
575 # func_path_foreach_inner |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
576 # helper for func_path_foreach because we need new 'args' array |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
577 # Input: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
578 # - fpf_dir directory from local_gnulib_path |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
579 # - fpf_cb callback to be run for fpf_dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
580 func_path_foreach_inner () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
581 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
582 set %start% "$@" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
583 for _fpf_arg |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
584 do |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
585 case $_fpf_arg in |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
586 %start%) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
587 set dummy |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
588 ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
589 %dir%) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
590 set "$@" "$fpf_dir" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
591 ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
592 *) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
593 set "$@" "$_fpf_arg" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
594 ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
595 esac |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
596 done |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
597 shift |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
598 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
599 "$fpf_cb" "$@" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
600 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
601 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
602 # func_path_foreach path method args |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
603 # Execute method for each directory in path. The method will be called |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
604 # like `method args` while any argument '%dir%' within args will be replaced |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
605 # with processed directory from path. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
606 func_path_foreach () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
607 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
608 fpf_save_IFS=$IFS |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
609 fpf_dirs=$1 ; shift |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
610 fpf_cb=$1 ; shift |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
611 fpf_rc=false |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
612 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
613 IFS=$PATH_SEPARATOR |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
614 for fpf_dir in $fpf_dirs |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
615 do |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
616 func_path_foreach_inner "$@" && fpf_rc=: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
617 done |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
618 IFS=$fpf_save_IFS |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
619 $fpf_rc |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
620 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
621 |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
622 # 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
|
623 # 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
|
624 # 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
|
625 # 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
|
626 # 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
|
627 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
|
628 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
|
629 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
630 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
|
631 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
632 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
|
633 else |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
634 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
|
635 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
636 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
|
637 suffix="$2" |
11037
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
638 case "$suffix" in |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
639 *.*) |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
640 sed_escape_dots='s/\([.]\)/\\\1/g' |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
641 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
|
642 ;; |
d94dc78c3947
Improve func_remove_prefix, func_remove_suffix.
Bruno Haible <bruno@clisp.org>
parents:
10993
diff
changeset
|
643 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
|
644 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
|
645 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
|
646 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
647 fast_func_remove_suffix=false |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
648 fi |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
649 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
650 # func_fatal_error message |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
651 # 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
|
652 # Input: |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
653 # - progname name of this program |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
654 func_fatal_error () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
655 { |
10501
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
656 echo "$progname: *** $1" 1>&2 |
4e04aaeb17f9
Fix previous patch, and tweak references to $0.
Eric Blake <ebb9@byu.net>
parents:
10495
diff
changeset
|
657 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
|
658 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
659 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
660 |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
661 # func_warning message |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
662 # Outputs to stderr a warning message, |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
663 func_warning () |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
664 { |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
665 echo "gnulib-tool: warning: $1" 1>&2 |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
666 } |
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
667 |
6248
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
668 # func_readlink SYMLINK |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
669 # outputs the target of the given symlink. |
16925
eb8ffcf6fd24
Do use readlink if available
Bernd Jendrissek <bernd.jendrissek@gmail.com>
parents:
16808
diff
changeset
|
670 if (type readlink) > /dev/null 2>&1; then |
6248
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
671 func_readlink () |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
672 { |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
673 # Use the readlink program from GNU coreutils. |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
674 readlink "$1" |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
675 } |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
676 else |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
677 func_readlink () |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
678 { |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
679 # 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
|
680 # 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
|
681 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
|
682 } |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
683 fi |
ba937772eda4
Portability fix: readlink is not portable.
Bruno Haible <bruno@clisp.org>
parents:
6247
diff
changeset
|
684 |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
685 # func_relativize DIR1 DIR2 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
686 # 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
|
687 # Input: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
688 # - 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
|
689 # - 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
|
690 # Output: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
691 # - 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
|
692 func_relativize () |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
693 { |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
694 dir0=`pwd` |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
695 dir1="$1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
696 dir2="$2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
697 sed_first='s,^\([^/]*\)/.*$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
698 sed_rest='s,^[^/]*/*,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
699 sed_last='s,^.*/\([^/]*\)$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
700 sed_butlast='s,/*[^/]*$,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
701 while test -n "$dir1"; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
702 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
|
703 if test "$first" != "."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
704 if test "$first" = ".."; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
705 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
|
706 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
|
707 else |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
708 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
|
709 if test "$first2" = "$first"; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
710 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
|
711 else |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
712 dir2="../$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
713 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
714 dir0="$dir0"/"$first" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
715 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
716 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
717 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
|
718 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
719 reldir="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
720 } |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
721 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
722 # func_relconcat DIR1 DIR2 |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
723 # 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
|
724 # Input: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
725 # - 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
|
726 # - 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
|
727 # Output: |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
728 # - 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
|
729 func_relconcat () |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
730 { |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
731 dir1="$1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
732 dir2="$2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
733 sed_first='s,^\([^/]*\)/.*$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
734 sed_rest='s,^[^/]*/*,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
735 sed_last='s,^.*/\([^/]*\)$,\1,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
736 sed_butlast='s,/*[^/]*$,,' |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
737 while true; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
738 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
|
739 if test "$first" = "."; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
740 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
|
741 if test -z "$dir2"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
742 relconcat="$dir1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
743 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
744 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
745 else |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
746 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
|
747 while test "$last" = "."; do |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
748 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
|
749 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
|
750 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
751 if test -z "$dir1"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
752 relconcat="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
753 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
754 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
755 if test "$first" = ".."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
756 if test "$last" = ".."; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
757 relconcat="$dir1/$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
758 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
759 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
760 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
|
761 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
|
762 if test -z "$dir1"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
763 relconcat="$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
764 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
765 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
766 if test -z "$dir2"; then |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
767 relconcat="$dir1" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
768 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
769 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
770 else |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
771 relconcat="$dir1/$dir2" |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
772 break |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
773 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
774 fi |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
775 done |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
776 } |
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
777 |
18214
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
778 # func_ln_s SRC DEST |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
779 # Like ln -s, except use cp -p if ln -s fails. |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
780 func_ln_s () |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
781 { |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
782 ln -s "$1" "$2" || { |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
783 echo "$progname: ln -s failed; falling back on cp -p" >&2 |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
784 |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
785 case "$1" in |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
786 /* | ?:*) # SRC is absolute. |
18951
232f131e1d0f
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
Bruno Haible <bruno@clisp.org>
parents:
18937
diff
changeset
|
787 cp_src="$1" ;; |
18214
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
788 *) # SRC is relative to the directory of DEST. |
18951
232f131e1d0f
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
Bruno Haible <bruno@clisp.org>
parents:
18937
diff
changeset
|
789 case "$2" in |
232f131e1d0f
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
Bruno Haible <bruno@clisp.org>
parents:
18937
diff
changeset
|
790 */*) cp_src="${2%/*}/$1" ;; |
232f131e1d0f
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
Bruno Haible <bruno@clisp.org>
parents:
18937
diff
changeset
|
791 *) cp_src="$1" ;; |
232f131e1d0f
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
Bruno Haible <bruno@clisp.org>
parents:
18937
diff
changeset
|
792 esac |
232f131e1d0f
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
Bruno Haible <bruno@clisp.org>
parents:
18937
diff
changeset
|
793 ;; |
18214
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
794 esac |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
795 |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
796 cp -p "$cp_src" "$2" |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
797 } |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
798 } |
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
799 |
18952
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
800 # func_symlink_target SRC DEST |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
801 # Determines LINK_TARGET such that "ln -s LINK_TARGET DEST" will create a |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
802 # symbolic link DEST that points to SRC. |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
803 # Output: |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
804 # - link_target link target, relative to the directory of DEST |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
805 func_symlink_target () |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
806 { |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
807 case "$1" in |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
808 /* | ?:*) |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
809 link_target="$1" ;; |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
810 *) # SRC is relative. |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
811 case "$2" in |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
812 /* | ?:*) |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
813 link_target="`pwd`/$1" ;; |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
814 *) # DEST is relative too. |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
815 ln_destdir=`echo "$2" | sed -e 's,[^/]*$,,'` |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
816 test -n "$ln_destdir" || ln_destdir="." |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
817 func_relativize "$ln_destdir" "$1" |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
818 link_target="$reldir" |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
819 ;; |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
820 esac |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
821 ;; |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
822 esac |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
823 } |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
824 |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
825 # func_symlink SRC DEST |
18214
582ba937cae1
gnulib-tool: don't assume ln -s works
Paul Eggert <eggert@cs.ucla.edu>
parents:
18189
diff
changeset
|
826 # Like func_ln_s, except that SRC is given relative to the current directory (or |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
827 # absolute), not given relative to the directory of DEST. |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
828 func_symlink () |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
829 { |
18952
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
830 func_symlink_target "$1" "$2" |
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
831 func_ln_s "$link_target" "$2" |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
832 } |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
833 |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
834 # func_symlink_if_changed SRC DEST |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
835 # Like func_symlink, but avoids munging timestamps if the link is correct. |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
836 # SRC is given relative to the current directory (or absolute). |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
837 func_symlink_if_changed () |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
838 { |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
839 if test $# -ne 2; then |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
840 echo "usage: func_symlink_if_changed SRC DEST" >&2 |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
841 fi |
18952
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
842 func_symlink_target "$1" "$2" |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
843 ln_target=`func_readlink "$2"` |
18952
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
844 if test -h "$2" && test "$link_target" = "$ln_target"; then |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
845 : |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
846 else |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
847 rm -f "$2" |
18952
2f7ab9aaa825
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible <bruno@clisp.org>
parents:
18951
diff
changeset
|
848 func_ln_s "$link_target" "$2" |
7642
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
849 fi |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
850 } |
0878abcc59c9
Fix the symlinks installed by the --symlink option.
Bruno Haible <bruno@clisp.org>
parents:
7641
diff
changeset
|
851 |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
852 # func_hardlink SRC DEST |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
853 # Like ln, except use cp -p if ln fails. |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
854 # SRC is given relative to the current directory (or absolute). |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
855 func_hardlink () |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
856 { |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
857 ln "$1" "$2" || { |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
858 echo "$progname: ln failed; falling back on cp -p" >&2 |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
859 cp -p "$1" "$2" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
860 } |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
861 } |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
862 |
12882 | 863 # 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
|
864 # 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
|
865 # 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
|
866 # 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
|
867 # |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
868 # Test cases for problem 1: |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
869 # 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
|
870 # 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
|
871 # 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
|
872 # 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
|
873 # "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
|
874 # 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
|
875 # |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
876 # 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
|
877 # 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
|
878 # 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
|
879 # - 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
|
880 # 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
|
881 # 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
|
882 # - 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
|
883 # - 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
|
884 # 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
|
885 # - 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
|
886 # We try the following workarounds: |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
887 # - 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
|
888 # - 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
|
889 # - 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
|
890 # - 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
|
891 # - 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
|
892 # - 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
|
893 # - 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
|
894 # - 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
|
895 # the ksh workaround. |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
896 # - 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
|
897 # 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
|
898 # 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
|
899 # |
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
900 # 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
|
901 # the 'printf' built-in. See |
19439
8bfc20b57265
maint: shorten https://lists.gnu.org/archive/html/... links
Jim Meyering <meyering@fb.com>
parents:
19271
diff
changeset
|
902 # <https://lists.gnu.org/r/bug-bash/2008-12/msg00050.html> |
8bfc20b57265
maint: shorten https://lists.gnu.org/archive/html/... links
Jim Meyering <meyering@fb.com>
parents:
19271
diff
changeset
|
903 # <https://lists.gnu.org/r/bug-gnulib/2010-02/msg00154.html> |
12881
c6e9c683bc41
Really work around around "broken pipe" error message from bash 3.2.
Bruno Haible <bruno@clisp.org>
parents:
12877
diff
changeset
|
904 # 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
|
905 have_echo= |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
906 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
|
907 have_echo=yes # Lucky! |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
908 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
909 # Try the workarounds. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
910 # 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
|
911 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
912 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
913 && test -n "$CONFIG_SHELL" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
914 && 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
|
915 && $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
|
916 exec $CONFIG_SHELL "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
917 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
918 fi |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
919 # 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
|
920 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
921 && test -n "$BASH_VERSION" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
922 && (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
|
923 shopt -o xpg_echo |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
924 have_echo=yes |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
925 fi |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
926 # 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
|
927 # 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
|
928 # (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
|
929 # 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
|
930 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
|
931 || 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
|
932 } \ |
9006
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
933 && test -n "$BASH_VERSION"; then \ |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
934 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
|
935 # '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
|
936 echo () |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
937 { |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
938 cat <<EOF |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
939 $* |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
940 EOF |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
941 } |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
942 else |
9007 | 943 # '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
|
944 echo () |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
945 { |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
946 printf '%s\n' "$*" |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
947 } |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
948 fi |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
949 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
|
950 have_echo=yes |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
951 fi |
0df4abf0cce4
Add better support for bash versions < 2.04.
Bruno Haible <bruno@clisp.org>
parents:
9005
diff
changeset
|
952 fi |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
953 # For zsh: turn sh-emulation on. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
954 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
955 && test -n "$ZSH_VERSION" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
956 && (emulate sh) >/dev/null 2>&1; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
957 emulate sh |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
958 fi |
9008
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
959 # 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
|
960 if test -z "$have_echo" \ |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
961 && (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
|
962 # A 'print' command exists. |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
963 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
|
964 : |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
965 else |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
966 # 'print' is a shell built-in. |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
967 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
|
968 # '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
|
969 alias echo='print -r' |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
970 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
971 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
972 fi |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
973 if test -z "$have_echo" \ |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
974 && 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
|
975 have_echo=yes |
78f53a569f31
Make use of ksh's 'print' built-in.
Bruno Haible <bruno@clisp.org>
parents:
9007
diff
changeset
|
976 fi |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
977 # 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
|
978 # The ksh manual page says: |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
979 # "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
|
980 # 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
|
981 # 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
|
982 # 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
|
983 # 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
|
984 # command. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
985 if test -z "$have_echo"; then |
13658
a597697ae97c
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible <bruno@clisp.org>
parents:
13650
diff
changeset
|
986 bsd_echo () |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
987 { |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
988 cat <<EOF |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
989 $* |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
990 EOF |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
991 } |
13658
a597697ae97c
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible <bruno@clisp.org>
parents:
13650
diff
changeset
|
992 if (alias echo=bsd_echo) 2>/dev/null; then |
a597697ae97c
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible <bruno@clisp.org>
parents:
13650
diff
changeset
|
993 alias echo=bsd_echo 2>/dev/null |
a597697ae97c
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible <bruno@clisp.org>
parents:
13650
diff
changeset
|
994 fi |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
995 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
996 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
997 && echo '\t' | grep t > /dev/null; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
998 have_echo=yes |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
999 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1000 if test -z "$have_echo"; then |
13658
a597697ae97c
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible <bruno@clisp.org>
parents:
13650
diff
changeset
|
1001 if (alias echo=bsd_echo) 2>/dev/null; then |
a597697ae97c
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible <bruno@clisp.org>
parents:
13650
diff
changeset
|
1002 unalias echo 2>/dev/null |
a597697ae97c
gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
Bruno Haible <bruno@clisp.org>
parents:
13650
diff
changeset
|
1003 fi |
9003
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1004 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1005 # 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
|
1006 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1007 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1008 && test -f /bin/ksh; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1009 exec /bin/ksh "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1010 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1011 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1012 # Otherwise: respawn using /bin/sh. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1013 if test -z "$have_echo" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1014 && test "X$1" != "X--no-reexec" \ |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1015 && test -f /bin/sh; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1016 exec /bin/sh "$0" --no-reexec "$@" |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1017 exit 127 |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1018 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1019 if test -z "$have_echo"; then |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1020 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
|
1021 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1022 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
|
1023 : # Works fine now. |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1024 else |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1025 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
|
1026 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1027 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
|
1028 shift |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1029 fi |
952d16aa4c29
Ensure a POSIX:2001 compliant 'echo' command.
Bruno Haible <bruno@clisp.org>
parents:
9001
diff
changeset
|
1030 |
17530
c9e3d7edb7cf
gnulib-tool: protect against CDPATH
Jim Meyering <meyering@fb.com>
parents:
17385
diff
changeset
|
1031 # Unset CDPATH. Otherwise, output from 'cd dir' can surprise callers. |
c9e3d7edb7cf
gnulib-tool: protect against CDPATH
Jim Meyering <meyering@fb.com>
parents:
17385
diff
changeset
|
1032 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH |
c9e3d7edb7cf
gnulib-tool: protect against CDPATH
Jim Meyering <meyering@fb.com>
parents:
17385
diff
changeset
|
1033 |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1034 # Determine the path separator early because the following option parsing code |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1035 # requires that. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1036 func_determine_path_separator |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1037 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1038 # Command-line option processing. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1039 # Removes the OPTIONS from the arguments. Sets the variables: |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1040 # - mode one of: list, find, import, add-import, remove-import, |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1041 # update, create-testdir, create-megatestdir, test, megatest, |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1042 # copy-file |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1043 # - destdir from --dir |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1044 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1045 # - 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
|
1046 # - 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
|
1047 # - libname, supplied_libname from --lib |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1048 # - sourcebase from --source-base |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1049 # - m4base from --m4-base |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1050 # - pobase from --po-base |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1051 # - docbase from --doc-base |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1052 # - testsbase from --tests-base |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1053 # - auxdir from --aux-dir |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1054 # - inctests true if --with-tests was given, false if --without-tests |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1055 # was given, blank otherwise |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1056 # - 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
|
1057 # - 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
|
1058 # - 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
|
1059 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1060 # - 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
|
1061 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1062 # - 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
|
1063 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1064 # - 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
|
1065 # - 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
|
1066 # - 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
|
1067 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1068 # - 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
|
1069 # otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1070 # - 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
|
1071 # otherwise |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
1072 # - single_configure true if --single-configure was given, false otherwise |
5981 | 1073 # - avoidlist list of modules to avoid, from --avoid |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
1074 # - cond_dependencies true if --conditional-dependencies was given, false if |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
1075 # --no-conditional-dependencies was given, blank otherwise |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1076 # - lgpl yes or a number if --lgpl was given, blank otherwise |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
1077 # - gnu_make true if --gnu-make was given, false otherwise |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1078 # - makefile_name from --makefile-name |
7077 | 1079 # - libtool true if --libtool was given, false if --no-libtool was |
1080 # given, blank otherwise | |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1081 # - macro_prefix from --macro-prefix |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1082 # - po_domain from --po-domain |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1083 # - witness_c_macro from --witness-c-macro |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1084 # - 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
|
1085 # given, blank otherwise |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1086 # - autoconf_minversion minimum supported autoconf version |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
1087 # - doit : if actions shall be executed, false if only to be printed |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1088 # - copymode symlink if --symlink or --more-symlinks was given, |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1089 # hardlink if --hardlink or --more-hardlinks was given, |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1090 # blank otherwise |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1091 # - lcopymode symlink if --local-symlink was given, |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1092 # hardlink if --local-hardlink was given, |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1093 # blank otherwise |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1094 # - do_copyrights blank if --more-symlinks or --more-hardlinks was given, |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1095 # true otherwise |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1096 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1097 mode= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1098 destdir= |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1099 local_gnulib_path= |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1100 modcache=true |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1101 verbose=0 |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1102 libname=libgnu |
5344
c2f5677fc6ed
Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents:
5343
diff
changeset
|
1103 supplied_libname= |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1104 sourcebase= |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1105 m4base= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1106 pobase= |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1107 docbase= |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1108 testsbase= |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1109 auxdir= |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1110 inctests= |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1111 incobsolete= |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1112 inc_cxx_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1113 inc_longrunning_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1114 inc_privileged_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1115 inc_unportable_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1116 inc_all_tests= |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1117 excl_cxx_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1118 excl_longrunning_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1119 excl_privileged_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1120 excl_unportable_tests= |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
1121 single_configure=false |
5981 | 1122 avoidlist= |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
1123 cond_dependencies= |
5981 | 1124 lgpl= |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
1125 gnu_make=false |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1126 makefile_name= |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1127 libtool= |
6176 | 1128 macro_prefix= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1129 po_domain= |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1130 witness_c_macro= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1131 vc_files= |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
1132 doit=: |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1133 copymode= |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1134 lcopymode= |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1135 do_copyrights=true |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1136 |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1137 supplied_opts="$@" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1138 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1139 while test $# -gt 0; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1140 case "$1" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1141 --list | --lis ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1142 mode=list |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1143 shift ;; |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1144 --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
|
1145 mode=find |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1146 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1147 --import | --impor | --impo | --imp | --im | --i ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1148 mode=import |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1149 shift ;; |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1150 --add-import | --add-impor | --add-impo | --add-imp | --add-im | --add-i | --add- | --add | --ad ) |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1151 mode=add-import |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1152 shift ;; |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1153 --remove-import | --remove-impor | --remove-impo | --remove-imp | --remove-im | --remove-i | --remove- | --remove | --remov | --remo | --rem | --re | --r ) |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1154 mode=remove-import |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1155 shift ;; |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1156 --update | --updat | --upda | --upd | --up | --u ) |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1157 mode=update |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1158 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1159 --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
|
1160 mode=create-testdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1161 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1162 --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
|
1163 mode=create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1164 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1165 --test | --tes | --te | --t ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1166 mode=test |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1167 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1168 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1169 mode=megatest |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1170 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1171 --extract-* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1172 mode=`echo "X$1" | sed -e 's/^X--//'` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1173 shift ;; |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
1174 --copy-file | --copy-fil | --copy-fi | --copy-f | --copy- | --copy | --cop ) |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
1175 mode=copy-file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
1176 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1177 --dir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1178 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1179 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1180 func_fatal_error "missing argument for --dir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1181 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1182 destdir=$1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1183 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1184 --dir=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1185 destdir=`echo "X$1" | sed -e 's/^X--dir=//'` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1186 shift ;; |
7215 | 1187 --local-dir ) |
1188 shift | |
1189 if test $# = 0; then | |
1190 func_fatal_error "missing argument for --local-dir" | |
1191 fi | |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1192 func_path_prepend local_gnulib_path "$1" |
7215 | 1193 shift ;; |
1194 --local-dir=* ) | |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1195 local_dir=`echo "X$1" | sed -e 's/^X--local-dir=//'` |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1196 func_path_prepend local_gnulib_path "$local_dir" |
7215 | 1197 shift ;; |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1198 --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
|
1199 modcache=true |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1200 shift ;; |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1201 --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
|
1202 modcache=false |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1203 shift ;; |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1204 --verbose | --verbos | --verbo | --verb ) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1205 verbose=`expr $verbose + 1` |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1206 shift ;; |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1207 --quiet | --quie | --qui | --qu | --q ) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1208 verbose=`expr $verbose - 1` |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1209 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1210 --lib ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1211 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1212 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1213 func_fatal_error "missing argument for --lib" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1214 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1215 libname=$1 |
5343 | 1216 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1217 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1218 --lib=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1219 libname=`echo "X$1" | sed -e 's/^X--lib=//'` |
5343 | 1220 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1221 shift ;; |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1222 --source-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1223 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1224 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1225 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
|
1226 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1227 sourcebase=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1228 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1229 --source-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1230 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
|
1231 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1232 --m4-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1233 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1234 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1235 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
|
1236 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1237 m4base=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1238 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1239 --m4-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1240 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
|
1241 shift ;; |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1242 --po-base ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1243 shift |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1244 if test $# = 0; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1245 func_fatal_error "missing argument for --po-base" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1246 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1247 pobase=$1 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1248 shift ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1249 --po-base=* ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1250 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
|
1251 shift ;; |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1252 --doc-base ) |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1253 shift |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1254 if test $# = 0; then |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1255 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
|
1256 fi |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1257 docbase=$1 |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1258 shift ;; |
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1259 --doc-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1260 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
|
1261 shift ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1262 --tests-base ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1263 shift |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1264 if test $# = 0; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1265 func_fatal_error "missing argument for --tests-base" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1266 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1267 testsbase=$1 |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1268 shift ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1269 --tests-base=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1270 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
|
1271 shift ;; |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1272 --aux-dir ) |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1273 shift |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1274 if test $# = 0; then |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1275 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
|
1276 fi |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1277 auxdir=$1 |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1278 shift ;; |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1279 --aux-dir=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1280 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
|
1281 shift ;; |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1282 --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
|
1283 inctests=true |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1284 shift ;; |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1285 --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
|
1286 incobsolete=true |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1287 shift ;; |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1288 --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
|
1289 inc_cxx_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1290 shift ;; |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1291 --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
|
1292 inc_longrunning_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1293 shift ;; |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1294 --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
|
1295 inc_privileged_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1296 shift ;; |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1297 --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
|
1298 inc_unportable_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1299 shift ;; |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1300 --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
|
1301 inc_all_tests=true |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
1302 shift ;; |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1303 --without-tests | --without-test | --without-tes | --without-te | --without-t) |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1304 inctests=false |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1305 shift ;; |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1306 --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
|
1307 excl_cxx_tests=true |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1308 shift ;; |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1309 --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
|
1310 excl_longrunning_tests=true |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1311 shift ;; |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1312 --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
|
1313 excl_privileged_tests=true |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1314 shift ;; |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1315 --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
|
1316 excl_unportable_tests=true |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1317 shift ;; |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
1318 --single-configure | --single-configur | --single-configu | --single-config | --single-confi | --single-conf | --single-con | --single-con | --single-co | --single-c | --single- | --single | --singl | --sing | --sin | --si) |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
1319 single_configure=true |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
1320 shift ;; |
5981 | 1321 --avoid ) |
1322 shift | |
1323 if test $# = 0; then | |
1324 func_fatal_error "missing argument for --avoid" | |
1325 fi | |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
1326 func_append avoidlist " $1" |
5981 | 1327 shift ;; |
1328 --avoid=* ) | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1329 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
|
1330 func_append avoidlist " $arg" |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
1331 shift ;; |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
1332 --conditional-dependencies | --conditional-dependencie | --conditional-dependenci | --conditional-dependenc | --conditional-dependen | --conditional-depende | --conditional-depend | --conditional-depen | --conditional-depe | --conditional-dep | --conditional-de | --conditional-d | --conditional- | --conditional | --conditiona | --condition | --conditio | --conditi | --condit | --condi | --cond | --con) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
1333 cond_dependencies=true |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
1334 shift ;; |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
1335 --no-conditional-dependencies | --no-conditional-dependencie | --no-conditional-dependenci | --no-conditional-dependenc | --no-conditional-dependen | --no-conditional-depende | --no-conditional-depend | --no-conditional-depen | --no-conditional-depe | --no-conditional-dep | --no-conditional-de | --no-conditional-d | --no-conditional- | --no-conditional | --no-conditiona | --no-condition | --no-conditio | --no-conditi | --no-condit | --no-condi | --no-cond | --no-con | --no-co) |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
1336 cond_dependencies=false |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
1337 shift ;; |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
1338 --lgpl ) |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1339 lgpl=yes |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1340 shift ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1341 --lgpl=* ) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1342 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
|
1343 case "$arg" in |
18501
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
1344 2 | 3orGPLv2 | 3) ;; |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1345 *) 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
|
1346 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
1347 lgpl=$arg |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
1348 shift ;; |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
1349 --gnu-make ) |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
1350 gnu_make=true |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
1351 shift ;; |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1352 --makefile-name ) |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1353 shift |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1354 if test $# = 0; then |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1355 func_fatal_error "missing argument for --makefile-name" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1356 fi |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1357 makefile_name="$1" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1358 shift ;; |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
1359 --makefile-name=* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1360 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
|
1361 shift ;; |
5981 | 1362 --libtool ) |
1363 libtool=true | |
1364 shift ;; | |
7077 | 1365 --no-libtool ) |
1366 libtool=false | |
1367 shift ;; | |
6176 | 1368 --macro-prefix ) |
1369 shift | |
1370 if test $# = 0; then | |
1371 func_fatal_error "missing argument for --macro-prefix" | |
1372 fi | |
1373 macro_prefix="$1" | |
1374 shift ;; | |
1375 --macro-prefix=* ) | |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1376 macro_prefix=`echo "X$1" | sed -e 's/^X--macro-prefix=//'` |
6176 | 1377 shift ;; |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1378 --po-domain ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1379 shift |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1380 if test $# = 0; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1381 func_fatal_error "missing argument for --po-domain" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1382 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1383 po_domain="$1" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1384 shift ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1385 --po-domain=* ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1386 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
|
1387 shift ;; |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1388 --witness-c-macro ) |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1389 shift |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1390 if test $# = 0; then |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1391 func_fatal_error "missing argument for --witness-c-macro" |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1392 fi |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1393 witness_c_macro="$1" |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1394 shift ;; |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1395 --witness-c-macro=* ) |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1396 witness_c_macro=`echo "X$1" | sed -e 's/^X--witness-c-macro=//'` |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1397 shift ;; |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1398 --vc-files ) |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1399 vc_files=true |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1400 shift ;; |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1401 --no-vc-files ) |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1402 vc_files=false |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
1403 shift ;; |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1404 --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch ) |
17065
e7db46543239
gnulib-tool: Remove no-op option --no-changelog.
Bruno Haible <bruno@clisp.org>
parents:
17047
diff
changeset
|
1405 # A no-op for backward compatibility. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1406 shift ;; |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1407 --dry-run ) |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
1408 doit=false |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1409 shift ;; |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1410 -s | --symbolic | --symboli | --symbol | --symbo | --symb | --symlink | --symlin | --symli | --syml | --sym | --sy ) |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1411 copymode=symlink |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1412 shift ;; |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
1413 --local-symlink | --local-symlin | --local-symli | --local-syml | --local-sym | --local-sy | --local-s ) |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1414 lcopymode=symlink |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1415 shift ;; |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1416 -h | --hardlink | --hardlin | --hardli | --hardl | --hard | --har | --ha ) |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1417 copymode=hardlink |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
1418 shift ;; |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1419 --local-hardlink | --local-hardlin | --local-hardli | --local-hardl | --local-hard | --local-har | --local-ha | --local-h ) |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1420 lcopymode=hardlink |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1421 shift ;; |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1422 -S | --more-symlinks | --more-symlink | --more-symlin | --more-symli | --more-syml | --more-sym | --more-sy | --more-s ) |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1423 copymode=symlink |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1424 do_copyrights= |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
1425 shift ;; |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1426 -H | --more-hardlinks | --more-hardlink | --more-hardlin | --more-hardli | --more-hardl | --more-hard | --more-har | --more-ha | --more-h ) |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1427 copymode=hardlink |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1428 do_copyrights= |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1429 shift ;; |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
1430 --help | --hel | --he ) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1431 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
|
1432 func_exit $? ;; |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
1433 --version | --versio | --versi | --vers ) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1434 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
|
1435 func_exit $? ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1436 -- ) |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1437 # Stop option processing |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1438 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1439 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1440 -* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1441 echo "gnulib-tool: unknown option $1" 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1442 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
|
1443 func_exit 1 ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1444 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1445 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1446 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1447 done |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1448 |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1449 if case "$mode" in import | add-import | remove-import) true;; *) false;; esac; then |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1450 if test -n "$excl_cxx_tests" || test -n "$excl_longrunning_tests" \ |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
1451 || test -n "$excl_privileged_tests" || test -n "$excl_unportable_tests" \ |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
1452 || test "$single_configure" != false; then |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1453 echo "gnulib-tool: invalid options for '$mode' mode" 1>&2 |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1454 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
|
1455 func_exit 1 |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1456 fi |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1457 fi |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1458 if test "$mode" = update; then |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1459 if test $# != 0; then |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1460 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
|
1461 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1462 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
|
1463 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
|
1464 func_exit 1 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1465 fi |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1466 if test -n "$local_gnulib_path" || test -n "$supplied_libname" \ |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1467 || 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
|
1468 || test -n "$docbase" || test -n "$testsbase" || test -n "$auxdir" \ |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1469 || 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
|
1470 || 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
|
1471 || 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
|
1472 || test -n "$inc_all_tests" \ |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
1473 || 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
|
1474 || 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
|
1475 || test -n "$avoidlist" || test -n "$lgpl" || test -n "$makefile_name" \ |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
1476 || test -n "$macro_prefix" || test -n "$po_domain" \ |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
1477 || test -n "$witness_c_macro" || test -n "$vc_files"; then |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1478 echo "gnulib-tool: invalid options for 'update' mode" 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1479 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1480 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
|
1481 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
|
1482 func_exit 1 |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1483 fi |
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1484 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1485 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
|
1486 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
|
1487 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
|
1488 func_exit 1 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1489 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1490 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
|
1491 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
|
1492 fi |
39737
bf73bd094dbd
gnulib-tool: minor tweaks for --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
1493 case $mode,$gnu_make in |
bf73bd094dbd
gnulib-tool: minor tweaks for --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
1494 *test*,true) |
bf73bd094dbd
gnulib-tool: minor tweaks for --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
1495 echo "gnulib-tool: --gnu-make not supported when including tests" |
bf73bd094dbd
gnulib-tool: minor tweaks for --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
1496 func_exit 1;; |
bf73bd094dbd
gnulib-tool: minor tweaks for --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
1497 esac |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1498 # Canonicalize the inctests variable. |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1499 case "$mode" in |
17004
1a403c75d360
gnulib-tool: Fix handling of inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16932
diff
changeset
|
1500 import | add-import | remove-import | update) |
16931
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1501 if test -z "$inctests"; then |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1502 inctests=false |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1503 fi |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1504 ;; |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1505 create-testdir | create-megatestdir | test | megatest) |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1506 if test -z "$inctests"; then |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1507 inctests=true |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1508 fi |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1509 ;; |
9c0df43d88f4
gnulib-tool: --create-[mega]testdir, --[mega]test implies --with-tests.
Bruno Haible <bruno@clisp.org>
parents:
16925
diff
changeset
|
1510 esac |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
1511 # Now the only possible values of "$inctests" are true and false |
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
1512 # (or blank but then it is irrelevant). |
6443
1a35941d29ab
Implement the --update option.
Bruno Haible <bruno@clisp.org>
parents:
6425
diff
changeset
|
1513 |
7071
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1514 # 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
|
1515 # configure.ac. |
39944 | 1516 DEFAULT_AUTOCONF_MINVERSION="2.63" |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1517 autoconf_minversion= |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1518 configure_ac= |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1519 if case "$mode" in import | add-import | remove-import | update) true;; *) false;; esac \ |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1520 && test -n "$destdir"; then |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1521 if test -f "$destdir"/configure.ac; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1522 configure_ac="$destdir/configure.ac" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1523 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1524 if test -f "$destdir"/configure.in; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1525 configure_ac="$destdir/configure.in" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1526 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1527 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1528 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1529 if test -f configure.ac; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1530 configure_ac="configure.ac" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1531 else |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1532 if test -f configure.in; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1533 configure_ac="configure.in" |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1534 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1535 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1536 fi |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1537 if test -n "$configure_ac"; then |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1538 # Use sed, not autoconf --trace, to look for the AC_PREREQ invocation, |
13636
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
1539 # because when some m4 files are omitted from a version control repository, |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1540 # "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
|
1541 # 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
|
1542 # autom4te: m4 failed with exit status: 1 |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1543 prereqs= |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1544 my_sed_traces=' |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1545 s,#.*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1546 s,^dnl .*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1547 s, dnl .*$,, |
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1548 /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
|
1549 s,^.*AC_PREREQ([[ ]*\([^])]*\).*$,\1,p |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1550 }' |
7767
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1551 prereqs=`sed -n -e "$my_sed_traces" < "$configure_ac"` |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1552 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
|
1553 autoconf_minversion=` |
0339d0fb77b2
* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7754
diff
changeset
|
1554 for version in $prereqs; do echo $version; done | |
12417 | 1555 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
|
1556 ` |
7078
a060dfddc867
Improve autoconf_minversion detection.
Bruno Haible <bruno@clisp.org>
parents:
7077
diff
changeset
|
1557 fi |
7071
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1558 fi |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1559 if test -z "$autoconf_minversion"; then |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1560 autoconf_minversion=$DEFAULT_AUTOCONF_MINVERSION |
71c5caf223fc
Remove the --assume-autoconf option.
Bruno Haible <bruno@clisp.org>
parents:
7070
diff
changeset
|
1561 fi |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1562 case "$autoconf_minversion" in |
39944 | 1563 1.* | 2.[0-5]* | 2.6[0-2]*) |
1564 func_fatal_error "minimum supported autoconf version is 2.63. 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
|
1565 esac |
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
1566 |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1567 # 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
|
1568 # 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
|
1569 sed_trimtrailingslashes='s,\([^/]\)//*$,\1,' |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1570 old_local_gnulib_path=$local_gnulib_path |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1571 save_IFS=$IFS |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1572 IFS=: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1573 local_gnulib_path= |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1574 for dir in $old_local_gnulib_path |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1575 do |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1576 case "$dir" in |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1577 */ ) dir=`echo "$dir" | sed -e "$sed_trimtrailingslashes"` ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1578 esac |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1579 func_path_append local_gnulib_path "$dir" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1580 done |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1581 IFS=$save_IFS |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1582 case "$sourcebase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1583 */ ) 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
|
1584 esac |
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1585 case "$m4base" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1586 */ ) 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
|
1587 esac |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1588 case "$pobase" in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1589 */ ) pobase=`echo "$pobase" | sed -e "$sed_trimtrailingslashes"` ;; |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
1590 esac |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
1591 case "$docbase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1592 */ ) 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
|
1593 esac |
6264
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1594 case "$testsbase" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1595 */ ) 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
|
1596 esac |
eaa3b6787ec9
Ignore trailing slashes in --m4-base value etc.
Bruno Haible <bruno@clisp.org>
parents:
6263
diff
changeset
|
1597 case "$auxdir" in |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1598 */ ) 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
|
1599 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1600 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1601 |
9793
f899dba61804
Fix 'gnulib-tool --version' output to work with git.
Eric Blake <ebb9@byu.net>
parents:
9541
diff
changeset
|
1602 func_gnulib_dir |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1603 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
|
1604 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
|
1605 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
|
1606 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
|
1607 fi |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1608 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
|
1609 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
|
1610 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
|
1611 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
|
1612 done |
dd6e80d0c89e
* gnulib-tool (func_exit): New function, to allow to pass the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7327
diff
changeset
|
1613 signal=0 |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1614 |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1615 # Note: The 'eval' silences stderr output in dash. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1616 if (declare -A x && { x[f/2]='foo'; x[f/3]='bar'; eval test '${x[f/2]}' = foo; }) 2>/dev/null; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1617 # Zsh 4 and Bash 4 have associative arrays. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1618 have_associative=true |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1619 else |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1620 # For other shells, use 'eval' with computed shell variable names. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1621 have_associative=false |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1622 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
1623 |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1624 # func_lookup_local_file_cb dir file |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1625 # return true and set func_lookup_local_file_result if the file 'dir/file' |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1626 # exists |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1627 func_lookup_local_file_cb () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1628 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1629 test -n "$func_lookup_local_file_result" && return 1 # already found? |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1630 test -f "$1/$2" || return 1 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1631 func_lookup_local_file_result=$1/$2 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1632 : |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1633 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1634 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1635 # func_lookup_local_file file |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1636 # looks up a file in $local_gnulib_path. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1637 # Input: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1638 # - local_gnulib_path from --local-dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1639 # Output: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1640 # - func_lookup_local_file_result name of the file, valid only when the |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1641 # function succeeded. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1642 func_lookup_local_file () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1643 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1644 func_lookup_local_file_result= |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1645 func_path_foreach "$local_gnulib_path" func_lookup_local_file_cb %dir% "$1" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1646 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1647 |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1648 # func_lookup_file file |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1649 # looks up a file in $local_gnulib_path or $gnulib_dir, or combines it through |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1650 # 'patch'. |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1651 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1652 # - local_gnulib_path from --local-dir |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1653 # Output: |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1654 # - 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
|
1655 # - 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
|
1656 func_lookup_file () |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1657 { |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1658 lkfile="$1" |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1659 if func_lookup_local_file "$lkfile"; then |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1660 lookedup_file=$func_lookup_local_file_result |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1661 lookedup_tmp= |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1662 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1663 if test -f "$gnulib_dir/$lkfile"; then |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1664 if func_lookup_local_file "$lkfile.diff"; then |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1665 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
|
1666 rm -f "$tmp/$lkbase" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1667 cp "$gnulib_dir/$lkfile" "$tmp/$lkbase" |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1668 patch -s "$tmp/$lkbase" < "$func_lookup_local_file_result" >&2 \ |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1669 || func_fatal_error "patch file $func_lookup_local_file_result didn't apply cleanly" |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1670 lookedup_file="$tmp/$lkbase" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1671 lookedup_tmp=true |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1672 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1673 lookedup_file="$gnulib_dir/$lkfile" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1674 lookedup_tmp= |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1675 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1676 else |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1677 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
|
1678 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1679 fi |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1680 } |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
1681 |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1682 # func_sanitize_modulelist |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1683 # 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
|
1684 # 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
|
1685 # 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
|
1686 func_sanitize_modulelist () |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1687 { |
17378
1d9362a18c34
Assume gnulib is checked out from Git, not CVS
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
17269
diff
changeset
|
1688 sed -e '/^ChangeLog$/d' -e '/\/ChangeLog$/d' \ |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1689 -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
|
1690 -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
|
1691 -e '/^TEMPLATE$/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1692 -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
|
1693 -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
|
1694 -e '/^\..*/d' \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1695 -e '/~$/d' |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1696 } |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1697 |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1698 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1699 # func_modules_in_dir dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1700 # outputs all module files in dir to standard output. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1701 func_modules_in_dir () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1702 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1703 (test -d "$1" && cd "$1" && find modules -type f -print) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1704 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1705 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1706 # func_all_modules |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1707 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1708 # - local_gnulib_path from --local-dir |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1709 func_all_modules () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1710 { |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1711 # 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
|
1712 # 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
|
1713 # --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
|
1714 { |
7805
2ee7433618fe
Add support for subdirectories of the 'modules/' directory.
Bruno Haible <bruno@clisp.org>
parents:
7788
diff
changeset
|
1715 (cd "$gnulib_dir" && find modules -type f -print | sed -e 's,^modules/,,') |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1716 func_path_foreach "$local_gnulib_path" func_modules_in_dir %dir% | 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
|
1717 } \ |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
1718 | func_sanitize_modulelist \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
1719 | sed -e '/-tests$/d' \ |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
1720 | LC_ALL=C sort -u |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1721 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1722 |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1723 # func_exists_local_module dir module |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1724 # returns true if module exists in dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1725 func_exists_local_module () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1726 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1727 test -d "$1/modules" && test -f "$1/modules/$2"; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1728 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1729 |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1730 # 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
|
1731 # 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
|
1732 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1733 # - local_gnulib_path from --local-dir |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1734 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
|
1735 { |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1736 { test -f "$gnulib_dir/modules/$1" \ |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1737 || func_path_foreach "$local_gnulib_path" func_exists_local_module %dir% "$1" ; } \ |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1738 && 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
|
1739 && 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
|
1740 && 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
|
1741 && 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
|
1742 && 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
|
1743 && 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
|
1744 } |
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1745 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1746 # func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1747 # verifies a module name |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1748 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1749 # - local_gnulib_path from --local-dir |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1750 # - module module name argument |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1751 func_verify_module () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1752 { |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
1753 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
|
1754 # OK, $module is a correct module name. |
7212 | 1755 # Verify that building the module description with 'patch' succeeds. |
1756 func_lookup_file "modules/$module" | |
7168
56632b3512af
Make it work also with Solaris /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
7142
diff
changeset
|
1757 else |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
1758 func_warning "module $module doesn't exist" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1759 module= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1760 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1761 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1762 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1763 # func_verify_nontests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1764 # verifies a module name, excluding tests modules |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1765 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1766 # - local_gnulib_path from --local-dir |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1767 # - module module name argument |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1768 func_verify_nontests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1769 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1770 case "$module" in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1771 *-tests ) module= ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1772 * ) func_verify_module ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1773 esac |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1774 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1775 |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1776 # func_verify_tests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1777 # 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
|
1778 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
1779 # - local_gnulib_path from --local-dir |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
1780 # - module module name argument |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1781 func_verify_tests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1782 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1783 case "$module" in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1784 *-tests ) func_verify_module ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1785 * ) module= ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1786 esac |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1787 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1788 |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1789 # 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
|
1790 # module description. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1791 # 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
|
1792 # 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
|
1793 # 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
|
1794 # field. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1795 # 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
|
1796 # 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
|
1797 sed_extract_prog=':[ ]*$/ { |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1798 :a |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1799 n |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1800 s/^Description:[ ]*$// |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1801 s/^Comment:[ ]*$// |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1802 s/^Status:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1803 s/^Notice:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1804 s/^Applicability:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1805 s/^Files:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1806 s/^Depends-on:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1807 s/^configure\.ac-early:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1808 s/^configure\.ac:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1809 s/^Makefile\.am:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1810 s/^Include:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1811 s/^Link:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1812 s/^License:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1813 s/^Maintainer:[ ]*$// |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1814 tb |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1815 p |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1816 ba |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1817 :b |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1818 }' |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
1819 |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1820 # 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
|
1821 # variable name, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1822 # 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
|
1823 sed_extract_field_header=' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1824 s/^Description:[ ]*$/description/ |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
1825 s/^Comment:[ ]*$/comment/ |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1826 s/^Status:[ ]*$/status/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1827 s/^Notice:[ ]*$/notice/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1828 s/^Applicability:[ ]*$/applicability/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1829 s/^Files:[ ]*$/files/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1830 s/^Depends-on:[ ]*$/dependson/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1831 s/^configure\.ac-early:[ ]*$/configureac_early/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1832 s/^configure\.ac:[ ]*$/configureac/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1833 s/^Makefile\.am:[ ]*$/makefile/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1834 s/^Include:[ ]*$/include/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1835 s/^Link:[ ]*$/link/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1836 s/^License:[ ]*$/license/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1837 s/^Maintainer:[ ]*$/maintainer/' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1838 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1839 if $modcache; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1840 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1841 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1842 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1843 # Declare the associative arrays. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1844 declare -A modcache_cached |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1845 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
|
1846 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
|
1847 eval "$declare_script" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1848 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1849 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1850 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1851 # func_cache_var module |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1852 # computes the cache variable name corresponding to $module. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1853 # 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
|
1854 # 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
|
1855 # to protect against this case. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1856 # Output: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1857 # - cachevar a shell variable name |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1858 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
|
1859 # 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
|
1860 # ${param//pattern/replacement} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1861 # as a shorthand for |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1862 # `echo "$param" | sed -e "s/pattern/replacement/g"`. |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
1863 # Note: The 'eval' is necessary for dash and NetBSD /bin/sh. |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
1864 eval 'func_cache_var () |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1865 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1866 cachevar=c_${1//[!a-zA-Z0-9_]/_} |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
1867 }' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1868 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1869 func_cache_var () |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1870 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1871 case $1 in |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1872 *[!a-zA-Z0-9_]*) |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1873 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
|
1874 *) |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1875 cachevar=c_$1 ;; |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1876 esac |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1877 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1878 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1879 |
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 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1882 # func_init_sed_convert_to_cache_statements |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1883 # Input: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1884 # - modcachevar_assignment |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1885 # Output: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1886 # - sed_convert_to_cache_statements |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1887 func_init_sed_convert_to_cache_statements () |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1888 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1889 # '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
|
1890 # 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
|
1891 # This script turns |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1892 # Description: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1893 # Some module's description |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1894 # |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1895 # Files: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1896 # lib/file.h |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1897 # into: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1898 # modcache_description[$1]=\ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1899 # 'Some module'"'"'s description |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1900 # ' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1901 # modcache_files[$1]=\ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1902 # 'lib/file.h' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1903 # or: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1904 # c_MODULE_description_set=set; c_MODULE_description=\ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1905 # 'Some module'"'"'s description |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1906 # ' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1907 # c_MODULE_files_set=set; c_MODULE_files=\ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1908 # 'lib/file.h' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1909 # The script consists of two parts: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1910 # 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
|
1911 # 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
|
1912 # 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
|
1913 sed_convert_to_cache_statements=" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1914 :llla |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1915 # 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
|
1916 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1917 # 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
|
1918 t llla1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1919 :llla1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1920 ${sed_extract_field_header} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1921 t lllb |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1922 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1923 # No field header. Ignore the line. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1924 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1925 # Read the next line. Upon EOF, just exit. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1926 n |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1927 b llla |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1928 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1929 :lllb |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1930 # The current line contains a field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1931 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1932 # Turn it into the beginning of an assignment. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1933 s/^\\(.*\\)\$/${modcachevar_assignment}\\\\/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1934 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1935 # 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
|
1936 # 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
|
1937 h |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1938 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1939 # Read the next line. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1940 # 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
|
1941 n |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1942 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1943 # 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
|
1944 t lllb1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1945 :lllb1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1946 ${sed_extract_field_header} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1947 # 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
|
1948 t lllb |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1949 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1950 # Not a field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1951 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1952 # 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
|
1953 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1954 p |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1955 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1956 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1957 # Transform single quotes. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1958 s/'/'\"'\"'/g |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1959 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1960 # Prepend a single quote. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1961 s/^/'/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1962 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1963 :lllc |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1964 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1965 # Move it to the hold space. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1966 h |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1967 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1968 # Read the next line. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1969 # Upon EOF, branch. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1970 \${ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1971 b llle |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1972 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1973 n |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1974 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1975 # 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
|
1976 t lllc1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1977 :lllc1 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1978 ${sed_extract_field_header} |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1979 t llld |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1980 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1981 # 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
|
1982 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1983 p |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1984 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1985 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1986 # Transform single quotes. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1987 s/'/'\"'\"'/g |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1988 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1989 b lllc |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1990 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1991 :llld |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1992 # A field header. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1993 # 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
|
1994 # to end the assignment. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1995 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1996 s/\$/'/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1997 p |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1998 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
1999 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2000 b lllb |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2001 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2002 :llle |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2003 # EOF seen. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2004 # 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
|
2005 # to end the assignment. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2006 x |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2007 s/\$/'/ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2008 p |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2009 # Exit. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2010 n |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2011 " |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2012 if ! $sed_comments; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2013 # Remove comments. |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2014 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
|
2015 | sed -e 's/^ *//' -e 's/^#.*//'` |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2016 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2017 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2018 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2019 if $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2020 # 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
|
2021 modcachevar_assignment='modcache_\1[$1]=' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2022 func_init_sed_convert_to_cache_statements |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2023 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2024 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2025 # func_cache_lookup_module module |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2026 # |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2027 # 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
|
2028 # 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
|
2029 # 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
|
2030 # Parameters: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2031 # - module non-empty string |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2032 # Output if $have_associative: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2033 # - modcache_cached[$module] set to yes |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2034 # - modcache_description[$module] == |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2035 # - 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
|
2036 # - ... / final newline, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2037 # - 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
|
2038 # Output if ! $have_associative: |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2039 # - cachevar a shell variable name |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2040 # - ${cachevar}_cached set to $module |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2041 # - ${cachevar}_description == |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2042 # - ${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
|
2043 # - ... / final newline, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2044 # - ${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
|
2045 # - ${cachevar}_description_set == |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2046 # - ${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
|
2047 # - ... / is non-empty, |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2048 # - ${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
|
2049 func_cache_lookup_module () |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2050 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2051 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2052 eval 'cached=${modcache_cached[$1]}' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2053 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2054 func_cache_var "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2055 eval "cached=\"\$${cachevar}_cached\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2056 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2057 if test -z "$cached"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2058 # 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
|
2059 func_lookup_file "modules/$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2060 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2061 eval 'modcache_cached[$1]=yes' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2062 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2063 eval "${cachevar}_cached=\"\$1\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2064 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2065 if ! $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2066 # 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
|
2067 modcachevar_assignment="${cachevar}"'_\1_set=set; '"${cachevar}"'_\1=' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2068 func_init_sed_convert_to_cache_statements |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2069 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2070 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
|
2071 eval "$cache_statements" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2072 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2073 if ! $have_associative; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2074 if test "$1" != "$cached"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2075 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
|
2076 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2077 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2078 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2079 } |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2080 |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2081 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2082 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2083 # func_get_description module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2084 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2085 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2086 # - 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
|
2087 func_get_description () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2088 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2089 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2090 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2091 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
|
2092 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2093 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2094 # 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
|
2095 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2096 if eval 'test -n "${modcache_description[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2097 eval 'echo "${modcache_description[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2098 fi |
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 eval "field_set=\"\$${cachevar}_description_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2101 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2102 eval "field_value=\"\$${cachevar}_description\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2103 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2104 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2105 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2106 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2107 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2108 |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2109 # func_get_comment module |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2110 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2111 # - local_gnulib_path from --local-dir |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2112 # - 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
|
2113 func_get_comment () |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2114 { |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2115 if ! $modcache; then |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2116 func_lookup_file "modules/$1" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2117 sed -n -e "/^Comment$sed_extract_prog" < "$lookedup_file" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2118 else |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2119 func_cache_lookup_module "$1" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2120 # 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
|
2121 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2122 if eval 'test -n "${modcache_comment[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2123 eval 'echo "${modcache_comment[$1]}"' |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2124 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2125 else |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2126 eval "field_set=\"\$${cachevar}_comment_set\"" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2127 if test -n "$field_set"; then |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2128 eval "field_value=\"\$${cachevar}_comment\"" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2129 echo "${field_value}" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2130 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2131 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2132 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2133 } |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
2134 |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
2135 # func_get_status module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
2136 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2137 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2138 # - 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
|
2139 func_get_status () |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
2140 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2141 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2142 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2143 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
|
2144 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2145 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2146 # 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
|
2147 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2148 if eval 'test -n "${modcache_status[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2149 eval 'echo "${modcache_status[$1]}"' |
12857
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 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2152 eval "field_set=\"\$${cachevar}_status_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2153 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2154 eval "field_value=\"\$${cachevar}_status\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2155 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2156 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2157 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2158 fi |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
2159 } |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
2160 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2161 # func_get_notice module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2162 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2163 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2164 # - 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
|
2165 func_get_notice () |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2166 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2167 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2168 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2169 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
|
2170 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2171 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2172 # 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
|
2173 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2174 if eval 'test -n "${modcache_notice[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2175 eval 'echo "${modcache_notice[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2176 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2177 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2178 eval "field_set=\"\$${cachevar}_notice_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2179 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2180 eval "field_value=\"\$${cachevar}_notice\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2181 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2182 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2183 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2184 fi |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2185 } |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
2186 |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
2187 # func_get_applicability module |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
2188 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2189 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2190 # - 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
|
2191 # 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
|
2192 func_get_applicability () |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
2193 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2194 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2195 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2196 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
|
2197 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2198 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2199 # 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
|
2200 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2201 eval 'my_applicability="${modcache_applicability[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2202 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2203 eval "my_applicability=\"\$${cachevar}_applicability\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2204 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2205 fi |
12854
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
2206 if test -n "$my_applicability"; then |
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
2207 echo $my_applicability |
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
2208 else |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
2209 # 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
|
2210 case $1 in |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2211 *-tests) echo "tests";; |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2212 *) echo "main";; |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
2213 esac |
12854
a57c17c10b63
gnulib-tool: cache module metainformation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12819
diff
changeset
|
2214 fi |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
2215 } |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
2216 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2217 # func_get_filelist module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2218 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2219 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2220 # - 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
|
2221 func_get_filelist () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2222 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2223 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2224 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2225 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
|
2226 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2227 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2228 # 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
|
2229 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2230 if eval 'test -n "${modcache_files[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2231 eval 'echo "${modcache_files[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2232 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2233 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2234 eval "field_set=\"\$${cachevar}_files_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2235 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2236 eval "field_value=\"\$${cachevar}_files\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2237 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2238 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2239 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2240 fi |
11094
5e937a2f5647
Backport improved autoconf semantics of AC_DEFUN_ONCE.
Eric Blake <ebb9@byu.net>
parents:
11065
diff
changeset
|
2241 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
|
2242 echo m4/gnulib-common.m4 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2243 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2244 |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2245 # 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
|
2246 # 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
|
2247 # 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
|
2248 # 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
|
2249 # 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
|
2250 # 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
|
2251 # 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
|
2252 # 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
|
2253 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
|
2254 { |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2255 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
|
2256 || { $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
|
2257 && { 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
|
2258 && { 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
|
2259 }; then |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2260 ffflist= |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2261 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
|
2262 # 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
|
2263 # 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
|
2264 case "$fff" in |
12743
3d337755e12c
gnulib-tool: fix filelist for AIX, HP-UX ksh.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12741
diff
changeset
|
2265 $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
|
2266 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
|
2267 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
|
2268 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2269 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
|
2270 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
|
2271 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2272 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
|
2273 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
|
2274 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
|
2275 else |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2276 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
|
2277 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2278 ;; |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2279 esac |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2280 done |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2281 else |
10993
996a5b3859fe
gnulib-tool: fix sed-based filtering
Jim Meyering <meyering@redhat.com>
parents:
10989
diff
changeset
|
2282 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
|
2283 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
|
2284 case "$fff" in |
12743
3d337755e12c
gnulib-tool: fix filelist for AIX, HP-UX ksh.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12741
diff
changeset
|
2285 $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
|
2286 esac |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2287 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
|
2288 fi |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2289 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
|
2290 } |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2291 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2292 # func_get_dependencies module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2293 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2294 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2295 # - 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
|
2296 func_get_dependencies () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2297 { |
13081
012563ccbd85
gnulib-tool: Allow 'foo-tests' module even if there is no module 'foo'.
Bruno Haible <bruno@clisp.org>
parents:
13080
diff
changeset
|
2298 # ${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
|
2299 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
|
2300 *-tests) |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2301 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
|
2302 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
|
2303 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
|
2304 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
|
2305 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
|
2306 ;; |
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2307 esac |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2308 # Then the explicit dependencies listed in the module description. |
14908
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2309 { if ! $modcache; then |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2310 func_lookup_file "modules/$1" |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2311 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
|
2312 else |
14908
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2313 func_cache_lookup_module "$1" |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2314 # Output the field's value, including the final newline (if any). |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2315 if $have_associative; then |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2316 if eval 'test -n "${modcache_dependson[$1]+set}"'; then |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2317 eval 'echo "${modcache_dependson[$1]}"' |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2318 fi |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2319 else |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2320 eval "field_set=\"\$${cachevar}_dependson_set\"" |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2321 if test -n "$field_set"; then |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2322 eval "field_value=\"\$${cachevar}_dependson\"" |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2323 echo "${field_value}" |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2324 fi |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2325 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2326 fi |
14908
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2327 } \ |
2b58e21ecf3c
gnulib-tool: Allow comments in the 'Depends-on' section.
Bruno Haible <bruno@clisp.org>
parents:
14894
diff
changeset
|
2328 | sed -e '/^#/d' |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2329 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2330 |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2331 # func_get_autoconf_early_snippet module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2332 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2333 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2334 # - 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
|
2335 func_get_autoconf_early_snippet () |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2336 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2337 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2338 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2339 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
|
2340 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2341 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2342 # 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
|
2343 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2344 if eval 'test -n "${modcache_configureac_early[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2345 eval 'echo "${modcache_configureac_early[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2346 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2347 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2348 eval "field_set=\"\$${cachevar}_configureac_early_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2349 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2350 eval "field_value=\"\$${cachevar}_configureac_early\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2351 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2352 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2353 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2354 fi |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2355 } |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
2356 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2357 # func_get_autoconf_snippet module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2358 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2359 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2360 # - 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
|
2361 func_get_autoconf_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2362 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2363 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2364 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2365 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
|
2366 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2367 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2368 # 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
|
2369 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2370 if eval 'test -n "${modcache_configureac[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2371 eval 'echo "${modcache_configureac[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2372 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2373 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2374 eval "field_set=\"\$${cachevar}_configureac_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2375 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2376 eval "field_value=\"\$${cachevar}_configureac\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2377 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2378 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2379 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2380 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2381 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2382 |
18000
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2383 # Concatenate lines with trailing slash. |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2384 # $1 is an optional filter to restrict the |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2385 # concatenation to groups starting with that expression |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2386 combine_lines() { |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2387 sed -e "/$1.*"'\\$/{ |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2388 :a |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2389 N |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2390 s/\\\n/ / |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2391 s/\\$/\\/ |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2392 ta |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2393 }' |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2394 } |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2395 |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2396 # func_get_automake_snippet_conditional module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2397 # returns the part of the Makefile.am snippet that can be put inside Automake |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2398 # conditionals. |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2399 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2400 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2401 # - modcache true or false, from --cache-modules/--no-cache-modules |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2402 func_get_automake_snippet_conditional () |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2403 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2404 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2405 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2406 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
|
2407 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2408 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2409 # 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
|
2410 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2411 if eval 'test -n "${modcache_makefile[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2412 eval 'echo "${modcache_makefile[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2413 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2414 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2415 eval "field_set=\"\$${cachevar}_makefile_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2416 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2417 eval "field_value=\"\$${cachevar}_makefile\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2418 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2419 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2420 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2421 fi |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2422 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2423 |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2424 # func_get_automake_snippet_unconditional module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2425 # returns the part of the Makefile.am snippet that must stay outside of |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2426 # Automake conditionals. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2427 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2428 # - local_gnulib_path from --local-dir |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2429 # - modcache true or false, from --cache-modules/--no-cache-modules |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2430 func_get_automake_snippet_unconditional () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2431 { |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2432 case "$1" in |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2433 *-tests) |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2434 # *-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
|
2435 # Synthesize an EXTRA_DIST augmentation. |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2436 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
|
2437 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
|
2438 extra_files="$tests_files" |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2439 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
|
2440 echo "EXTRA_DIST +=" $extra_files |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2441 echo |
afba4e078ebc
Synthesize an EXTRA_DIST augmentation also for tests modules.
Bruno Haible <bruno@clisp.org>
parents:
9275
diff
changeset
|
2442 fi |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2443 ;; |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2444 *) |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2445 # Synthesize an EXTRA_DIST augmentation. |
7754
ed8105720327
* modules/absolute-header: New module.
Eric Blake <ebb9@byu.net>
parents:
7752
diff
changeset
|
2446 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
|
2447 already_mentioned_files=` \ |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2448 { if ! $modcache; then |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2449 func_lookup_file "modules/$1" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2450 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
|
2451 else |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2452 func_cache_lookup_module "$1" |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2453 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2454 if eval 'test -n "${modcache_makefile[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2455 eval 'echo "${modcache_makefile[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2456 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2457 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2458 eval 'field_set="$'"${cachevar}"'_makefile_set"' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2459 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2460 eval 'field_value="$'"${cachevar}"'_makefile"' |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2461 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2462 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2463 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2464 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2465 } \ |
18000
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
2466 | combine_lines \ |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2467 | 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
|
2468 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
|
2469 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
|
2470 # 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
|
2471 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
|
2472 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
|
2473 | 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
|
2474 if test -n "$extra_files"; then |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2475 echo "EXTRA_DIST +=" $extra_files |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2476 echo |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2477 fi |
7640
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
2478 # Synthesize also an EXTRA_lib_SOURCES augmentation. |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
2479 # 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
|
2480 # dependency rules. |
a4d97c9b97de
Synthesize also an EXTRA_lib_SOURCES augmentation.
Bruno Haible <bruno@clisp.org>
parents:
7638
diff
changeset
|
2481 # 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
|
2482 # 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
|
2483 # (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
|
2484 # 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
|
2485 # 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
|
2486 # 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
|
2487 # 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
|
2488 # 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
|
2489 case "$1" in |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2490 relocatable-prog-wrapper) ;; |
13759
38b745d4e6a4
gnulib-tool: Fixes for --create-testdir with --libtool.
Bruno Haible <bruno@clisp.org>
parents:
13752
diff
changeset
|
2491 pt_chown) ;; |
8356
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2492 *) |
10989
8b11d1d206e0
Speed up gnulib-tool by doing more string processing through shell built-ins.
Bruno Haible <bruno@clisp.org>
parents:
10987
diff
changeset
|
2493 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
|
2494 if test -n "$extra_files"; then |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2495 echo "EXTRA_lib_SOURCES +=" $extra_files |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2496 echo |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2497 fi |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2498 ;; |
72f47158c694
Special handling for the 'relocatable-prog-wrapper' module.
Bruno Haible <bruno@clisp.org>
parents:
8079
diff
changeset
|
2499 esac |
9107
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
2500 # 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
|
2501 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
|
2502 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
|
2503 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
|
2504 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
|
2505 echo |
2878e8c70604
Ensure that also files under build-aux/ are distributed.
Bruno Haible <bruno@clisp.org>
parents:
9096
diff
changeset
|
2506 fi |
7497
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2507 ;; |
6a764f23e302
gnulib-tool now synthesizes the EXTRA_DIST line.
Bruno Haible <bruno@clisp.org>
parents:
7486
diff
changeset
|
2508 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2509 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2510 |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2511 # func_get_automake_snippet module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2512 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2513 # - local_gnulib_path from --local-dir |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2514 # - modcache true or false, from --cache-modules/--no-cache-modules |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2515 func_get_automake_snippet () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2516 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2517 func_get_automake_snippet_conditional "$1" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2518 func_get_automake_snippet_unconditional "$1" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2519 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2520 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2521 # func_get_include_directive module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2522 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2523 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2524 # - 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
|
2525 func_get_include_directive () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2526 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2527 { |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2528 if ! $modcache; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2529 func_lookup_file "modules/$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2530 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
|
2531 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2532 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2533 # 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
|
2534 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2535 if eval 'test -n "${modcache_include[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2536 eval 'echo "${modcache_include[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2537 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2538 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2539 eval "field_set=\"\$${cachevar}_include_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2540 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2541 eval "field_value=\"\$${cachevar}_include\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2542 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2543 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2544 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2545 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2546 } | sed -e 's/^\(["<]\)/#include \1/' |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2547 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
2548 |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2549 # func_get_link_directive module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2550 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2551 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2552 # - 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
|
2553 func_get_link_directive () |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2554 { |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2555 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2556 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2557 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
|
2558 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2559 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2560 # 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
|
2561 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2562 if eval 'test -n "${modcache_link[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2563 eval 'echo "${modcache_link[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2564 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2565 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2566 eval "field_set=\"\$${cachevar}_link_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2567 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2568 eval "field_value=\"\$${cachevar}_link\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2569 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2570 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2571 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2572 fi |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2573 } |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
2574 |
16153
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2575 # func_get_license_raw module |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2576 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2577 # - local_gnulib_path from --local-dir |
16153
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2578 # - modcache true or false, from --cache-modules/--no-cache-modules |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2579 func_get_license_raw () |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2580 { |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2581 if ! $modcache; then |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2582 func_lookup_file "modules/$1" |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2583 sed -n -e "/^License$sed_extract_prog" < "$lookedup_file" |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2584 else |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2585 func_cache_lookup_module "$1" |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2586 # Output the field's value, including the final newline (if any). |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2587 if $have_associative; then |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2588 if eval 'test -n "${modcache_license[$1]+set}"'; then |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2589 eval 'echo "${modcache_license[$1]}"' |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2590 fi |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2591 else |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2592 eval "field_set=\"\$${cachevar}_license_set\"" |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2593 if test -n "$field_set"; then |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2594 eval "field_value=\"\$${cachevar}_license\"" |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2595 echo "${field_value}" |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2596 fi |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2597 fi |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2598 fi |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2599 } |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2600 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2601 # func_get_license module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2602 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2603 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2604 # - 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
|
2605 func_get_license () |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2606 { |
16153
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2607 # Warn if the License field is missing. |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2608 case "$1" in |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2609 *-tests ) ;; |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2610 * ) |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2611 license=`func_get_license_raw "$1"` |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2612 if test -z "$license"; then |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2613 func_warning "module $1 lacks a License" |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2614 fi |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2615 ;; |
04717ea7c365
gnulib-tool: Verify that the License field is present and non-empty.
Bruno Haible <bruno@clisp.org>
parents:
16122
diff
changeset
|
2616 esac |
18474
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2617 case "$1" in |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2618 parse-datetime ) |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2619 # These modules are under a weaker license only for the purpose of some |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2620 # users who hand-edit it and don't use gnulib-tool. For the regular |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2621 # gnulib users they are under a stricter license. |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2622 echo "GPL" |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2623 ;; |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2624 * ) |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2625 { |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2626 func_get_license_raw "$1" |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2627 # The default is GPL. |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2628 echo "GPL" |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2629 } | sed -e 's,^ *$,,' | sed -e 1q |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2630 ;; |
1745af1e1b1d
Avoid gnulib-tool warnings about the dependencies of 'parse-datetime'.
Bruno Haible <bruno@clisp.org>
parents:
18471
diff
changeset
|
2631 esac |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2632 } |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
2633 |
4197 | 2634 # func_get_maintainer module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2635 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2636 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2637 # - modcache true or false, from --cache-modules/--no-cache-modules |
4197 | 2638 func_get_maintainer () |
2639 { | |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2640 if ! $modcache; then |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2641 func_lookup_file "modules/$1" |
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2642 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
|
2643 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2644 func_cache_lookup_module "$1" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2645 # 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
|
2646 if $have_associative; then |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2647 if eval 'test -n "${modcache_maintainer[$1]+set}"'; then |
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
2648 eval 'echo "${modcache_maintainer[$1]}"' |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2649 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2650 else |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2651 eval "field_set=\"\$${cachevar}_maintainer_set\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2652 if test -n "$field_set"; then |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2653 eval "field_value=\"\$${cachevar}_maintainer\"" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2654 echo "${field_value}" |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2655 fi |
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2656 fi |
12855
e4098d9b46fa
gnulib-tool: Make caching optional.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12854
diff
changeset
|
2657 fi |
4197 | 2658 } |
2659 | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2660 # func_get_tests_module module |
7214
eb43edab28c3
Small fix after --local-dir introduction.
Bruno Haible <bruno@clisp.org>
parents:
7213
diff
changeset
|
2661 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2662 # - local_gnulib_path from --local-dir |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2663 func_get_tests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2664 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2665 # 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
|
2666 if test -f "$gnulib_dir/modules/$1"-tests \ |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2667 || func_path_foreach "$local_gnulib_path" func_exists_local_module %dir% "$1-tests"; then |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2668 echo "$1"-tests |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2669 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2670 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2671 |
5981 | 2672 # func_acceptable module |
2673 # tests whether a module is acceptable. | |
2674 # Input: | |
2675 # - avoidlist list of modules to avoid | |
2676 func_acceptable () | |
2677 { | |
2678 for avoid in $avoidlist; do | |
2679 if test "$avoid" = "$1"; then | |
2680 return 1 | |
2681 fi | |
2682 done | |
2683 return 0 | |
2684 } | |
2685 | |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2686 # sed expression to keep the first 32 characters of each line. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2687 sed_first_32_chars='s/^\(................................\).*/\1/' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2688 |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2689 # func_module_shellfunc_name module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2690 # computes the shell function name that will contain the m4 macros for the module. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2691 # Input: |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2692 # - macro_prefix prefix to use |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2693 # Output: |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2694 # - shellfunc shell function name |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2695 func_module_shellfunc_name () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2696 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2697 case $1 in |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2698 *[!a-zA-Z0-9_]*) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2699 shellfunc=func_${macro_prefix}_gnulib_m4code_`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2700 *) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2701 shellfunc=func_${macro_prefix}_gnulib_m4code_$1 ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2702 esac |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2703 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2704 |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2705 # func_module_shellvar_name module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2706 # computes the shell variable name the will be set to true once the m4 macros |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2707 # for the module have been executed. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2708 # Output: |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2709 # - shellvar shell variable name |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2710 func_module_shellvar_name () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2711 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2712 case $1 in |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2713 *[!a-zA-Z0-9_]*) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2714 shellvar=${macro_prefix}_gnulib_enabled_`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2715 *) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2716 shellvar=${macro_prefix}_gnulib_enabled_$1 ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2717 esac |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2718 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2719 |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2720 # func_module_conditional_name module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2721 # computes the automake conditional name for the module. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2722 # Output: |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2723 # - conditional name of automake conditional |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2724 func_module_conditional_name () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2725 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2726 case $1 in |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2727 *[!a-zA-Z0-9_]*) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2728 conditional=${macro_prefix}_GNULIB_ENABLED_`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2729 *) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2730 conditional=${macro_prefix}_GNULIB_ENABLED_$1 ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2731 esac |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2732 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2733 |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2734 # func_uncond_add_module B |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2735 # notes the presence of B as an unconditional module. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2736 # |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2737 # func_conddep_add_module A B cond |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2738 # notes the presence of a conditional dependency from module A to module B, |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2739 # subject to the condition that A is enabled and cond is true. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2740 # |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2741 # func_cond_module_p B |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2742 # tests whether module B is conditional. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2743 # |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2744 # func_cond_module_condition A B |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2745 # returns the condition when B should be enabled as a dependency of A, once the |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2746 # m4 code for A has been executed. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2747 # Output: - condition |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2748 # |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2749 if $have_associative; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2750 declare -A conddep_isuncond |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2751 declare -A conddep_dependers |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2752 declare -A conddep_condition |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2753 func_uncond_add_module () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2754 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2755 eval 'conddep_isuncond[$1]=true' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2756 eval 'unset conddep_dependers[$1]' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2757 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2758 func_conddep_add_module () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2759 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2760 eval 'isuncond="${conddep_isuncond[$2]}"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2761 if test -z "$isuncond"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2762 # No unconditional dependency to B known at this point. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2763 eval 'conddep_dependers[$2]="${conddep_dependers[$2]} $1"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2764 eval 'conddep_condition[$1---$2]="$3"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2765 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2766 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2767 func_cond_module_p () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2768 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2769 eval 'previous_dependers="${conddep_dependers[$1]}"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2770 test -n "$previous_dependers" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2771 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2772 func_cond_module_condition () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2773 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2774 eval 'condition="${conddep_condition[$1---$2]}"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2775 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2776 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2777 func_uncond_add_module () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2778 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2779 case $1 in |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2780 *[!a-zA-Z0-9_]*) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2781 suffix=`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2782 *) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2783 suffix=$1 ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2784 esac |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2785 eval 'conddep_isuncond_'"$suffix"'=true' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2786 eval 'unset conddep_dependers_'"$suffix" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2787 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2788 func_conddep_add_module () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2789 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2790 case $2 in |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2791 *[!a-zA-Z0-9_]*) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2792 suffix=`echo "$2" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2793 *) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2794 suffix=$2 ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2795 esac |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2796 eval 'isuncond="${conddep_isuncond_'"$suffix"'}"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2797 if test -z "$isuncond"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2798 eval 'conddep_dependers_'"$suffix"'="${conddep_dependers_'"$suffix"'} $1"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2799 suffix=`echo "$1---$2" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2800 eval 'conddep_condition_'"$suffix"'="$3"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2801 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2802 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2803 func_cond_module_p () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2804 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2805 case $1 in |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2806 *[!a-zA-Z0-9_]*) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2807 suffix=`echo "$1" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2808 *) |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2809 suffix=$1 ;; |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2810 esac |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2811 eval 'previous_dependers="${conddep_dependers_'"$suffix"'}"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2812 test -n "$previous_dependers" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2813 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2814 func_cond_module_condition () |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2815 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2816 suffix=`echo "$1---$2" | md5sum | LC_ALL=C sed -e "$sed_first_32_chars"` |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2817 eval 'condition="${conddep_condition_'"$suffix"'}"' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2818 } |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2819 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2820 |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2821 sed_dependencies_without_conditions='s/ *\[.*//' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2822 |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2823 # func_modules_transitive_closure |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2824 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
2825 # - local_gnulib_path from --local-dir |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
2826 # - gnu_make true if --gnu-make was given, false otherwise |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
2827 # - 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
|
2828 # - modules list of specified modules |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
2829 # - inctests true if tests should be included, false otherwise |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
2830 # - incobsolete true if obsolete modules among dependencies should be |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
2831 # included, blank otherwise |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2832 # - 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
|
2833 # blank otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2834 # - 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
|
2835 # blank otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2836 # - 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
|
2837 # included, blank otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
2838 # - 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
|
2839 # 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
|
2840 # - 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
|
2841 # 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
|
2842 # included, blank otherwise |
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2843 # - 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
|
2844 # 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
|
2845 # included, blank otherwise |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2846 # - 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
|
2847 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2848 # - 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
|
2849 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2850 # - 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
|
2851 # excluded, blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
2852 # - 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
|
2853 # excluded, blank otherwise |
5981 | 2854 # - avoidlist list of modules to avoid |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2855 # - cond_dependencies true if conditional dependencies shall be supported, |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2856 # blank otherwise |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2857 # - 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
|
2858 # Output: |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2859 # - modules list of modules, including dependencies |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2860 # - conddep_dependers, conddep_condition information about conditionally |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2861 # enabled modules |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2862 func_modules_transitive_closure () |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2863 { |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2864 sed_escape_dependency='s|\([/.]\)|\\\1|g' |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2865 # 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
|
2866 # 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
|
2867 # 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
|
2868 # 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
|
2869 # to process it again. |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2870 handledmodules= |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2871 inmodules="$modules" |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2872 outmodules= |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
2873 fmtc_inc_all_tests="$inc_all_direct_tests" |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
2874 if test "$cond_dependencies" = true; then |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2875 for module in $inmodules; do |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2876 func_verify_module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2877 if test -n "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2878 if func_acceptable $module; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2879 func_uncond_add_module $module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2880 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2881 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2882 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2883 fi |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2884 while test -n "$inmodules"; do |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2885 inmodules_this_round="$inmodules" |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2886 inmodules= # Accumulator, queue for next round |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2887 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
|
2888 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2889 if test -n "$module"; then |
5981 | 2890 if func_acceptable $module; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
2891 func_append outmodules " $module" |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
2892 if test "$cond_dependencies" = true; then |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
2893 if ! $gnu_make \ |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
2894 && func_get_automake_snippet_conditional $module \ |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
2895 | grep '^if ' > /dev/null; then |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2896 # A module whose Makefile.am snippet contains a reference to an |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2897 # automake conditional. If we were to use it conditionally, we |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2898 # would get an error |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2899 # configure: error: conditional "..." was never defined. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2900 # because automake 1.11.1 does not handle nested conditionals |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2901 # correctly. As a workaround, make the module unconditional. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2902 func_uncond_add_module $module |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2903 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2904 if func_cond_module_p $module; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2905 conditional=true |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2906 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2907 conditional=false |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2908 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2909 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2910 deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"` |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2911 # 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
|
2912 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
|
2913 if test -n "$duplicated_deps"; then |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
2914 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
|
2915 fi |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
2916 if $inctests; then |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2917 testsmodule=`func_get_tests_module $module` |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2918 if test -n "$testsmodule"; then |
13299
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2919 deps="$deps $testsmodule" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2920 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
2921 fi |
13299
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2922 for dep in $deps; do |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2923 # 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
|
2924 inc=true |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2925 for word in `func_get_status $dep`; do |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2926 case "$word" in |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2927 obsolete) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2928 test -n "$incobsolete" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2929 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2930 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2931 c++-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2932 test -z "$excl_cxx_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2933 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2934 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
|
2935 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2936 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2937 longrunning-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2938 test -z "$excl_longrunning_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2939 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2940 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
|
2941 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2942 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2943 privileged-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2944 test -z "$excl_privileged_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2945 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2946 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
|
2947 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2948 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2949 unportable-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2950 test -z "$excl_unportable_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2951 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2952 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
|
2953 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2954 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2955 *-test) |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2956 test -n "$fmtc_inc_all_tests" \ |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2957 || inc=false |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2958 ;; |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2959 esac |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2960 done |
15854
d3633bf8b61d
gnulib-tool: Improve last commit.
Bruno Haible <bruno@clisp.org>
parents:
15853
diff
changeset
|
2961 if $inc && func_acceptable "$dep"; then |
13299
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2962 func_append inmodules " $dep" |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
2963 if test "$cond_dependencies" = true; then |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2964 escaped_dep=`echo "$dep" | sed -e "$sed_escape_dependency"` |
14806
e551e9a7ef38
gnulib-tool: fix portability problem with MacOS sed
Paul Eggert <eggert@cs.ucla.edu>
parents:
14682
diff
changeset
|
2965 sed_extract_condition1='/^ *'"$escaped_dep"' *$/{ |
e551e9a7ef38
gnulib-tool: fix portability problem with MacOS sed
Paul Eggert <eggert@cs.ucla.edu>
parents:
14682
diff
changeset
|
2966 s/^.*$/true/p |
e551e9a7ef38
gnulib-tool: fix portability problem with MacOS sed
Paul Eggert <eggert@cs.ucla.edu>
parents:
14682
diff
changeset
|
2967 }' |
e551e9a7ef38
gnulib-tool: fix portability problem with MacOS sed
Paul Eggert <eggert@cs.ucla.edu>
parents:
14682
diff
changeset
|
2968 sed_extract_condition2='/^ *'"$escaped_dep"' *\[.*\] *$/{ |
e551e9a7ef38
gnulib-tool: fix portability problem with MacOS sed
Paul Eggert <eggert@cs.ucla.edu>
parents:
14682
diff
changeset
|
2969 s/^ *'"$escaped_dep"' *\[\(.*\)\] *$/\1/p |
e551e9a7ef38
gnulib-tool: fix portability problem with MacOS sed
Paul Eggert <eggert@cs.ucla.edu>
parents:
14682
diff
changeset
|
2970 }' |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2971 condition=`func_get_dependencies $module | sed -n -e "$sed_extract_condition1" -e "$sed_extract_condition2"` |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2972 if test "$condition" = true; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2973 condition= |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2974 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2975 if test -n "$condition"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2976 func_conddep_add_module "$module" "$dep" "$condition" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2977 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2978 if $conditional; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2979 func_conddep_add_module "$module" "$dep" true |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2980 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2981 func_uncond_add_module "$dep" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2982 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2983 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
2984 fi |
13299
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2985 fi |
b50c33cca624
Fix regression from 2010-04-25.
Bruno Haible <bruno@clisp.org>
parents:
13264
diff
changeset
|
2986 done |
5981 | 2987 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2988 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
2989 done |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2990 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
|
2991 # Remove $handledmodules from $inmodules. |
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2992 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
|
2993 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
|
2994 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
|
2995 done |
7320
9349ee4e633c
Speed up func_modules_transitive_closure.
Bruno Haible <bruno@clisp.org>
parents:
7319
diff
changeset
|
2996 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
|
2997 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
|
2998 } |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
2999 |
13420
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3000 # func_show_module_list |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3001 # Input: |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3002 # - 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
|
3003 # - 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
|
3004 # - tmp pathname of a temporary directory |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3005 func_show_module_list () |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3006 { |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3007 if case "$TERM" in |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3008 xterm*) test -t 1;; |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3009 *) false;; |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3010 esac; then |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3011 # Assume xterm compatible escape sequences. |
17964
5a6167820a2c
gnulib-tool: output bold attribute more portably
Mats Erik Andersson <gnu@gisladisker.se>
parents:
17888
diff
changeset
|
3012 bold_on=`printf '\033[1m'` |
5a6167820a2c
gnulib-tool: output bold attribute more portably
Mats Erik Andersson <gnu@gisladisker.se>
parents:
17888
diff
changeset
|
3013 bold_off=`printf '\033[0m'` |
13420
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3014 else |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3015 bold_on= |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3016 bold_off= |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3017 fi |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3018 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
|
3019 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
|
3020 echo "$modules" | sed -e '/^$/d' \ |
14625
1a2352cb014f
Change gnulib-tool to support NetBSD's join
J.T. Conklin <jtc@acorntoolworks.com>
parents:
14385
diff
changeset
|
3021 | LC_ALL=C join -t '|' -a2 "$tmp"/specified-modules - \ |
13420
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3022 | 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
|
3023 } |
2291a2f3d56c
gnulib-tool: Display specified modules and dependencies differently.
Bruno Haible <bruno@clisp.org>
parents:
13419
diff
changeset
|
3024 |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3025 # func_modules_transitive_closure_separately |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3026 # Determine main module list and tests-related module list separately. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3027 # The main module list is the transitive closure of the specified modules, |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3028 # ignoring tests modules. Its lib/* sources go into $sourcebase/. If --lgpl |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3029 # is specified, it will consist only of LGPLed source. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3030 # The tests-related module list is the transitive closure of the specified |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3031 # modules, including tests modules, minus the main module list excluding |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3032 # modules of applicability 'all'. Its lib/* sources (brought in through |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3033 # dependencies of *-tests modules) go into $testsbase/. It may contain GPLed |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3034 # source, even if --lgpl is specified. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3035 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3036 # - local_gnulib_path from --local-dir |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3037 # - modcache true or false, from --cache-modules/--no-cache-modules |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3038 # - specified_modules list of specified modules |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
3039 # - inctests true if tests should be included, false otherwise |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3040 # - incobsolete true if obsolete modules among dependencies should be |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3041 # included, blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3042 # - inc_cxx_tests true if C++ interoperability tests should be included, |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3043 # blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3044 # - inc_longrunning_tests true if long-runnings tests should be included, |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3045 # blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3046 # - inc_privileged_tests true if tests that require root privileges should be |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3047 # included, blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3048 # - inc_unportable_tests true if tests that fail on some platforms should be |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3049 # included, blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3050 # - inc_all_direct_tests true if all kinds of problematic unit tests among |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3051 # the unit tests of the specified modules should be |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3052 # included, blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3053 # - inc_all_indirect_tests true if all kinds of problematic unit tests among |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3054 # the unit tests of the dependencies should be |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3055 # included, blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3056 # - excl_cxx_tests true if C++ interoperability tests should be excluded, |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3057 # blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3058 # - excl_longrunning_tests true if long-runnings tests should be excluded, |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3059 # blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3060 # - excl_privileged_tests true if tests that require root privileges should be |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3061 # excluded, blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3062 # - excl_unportable_tests true if tests that fail on some platforms should be |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3063 # excluded, blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3064 # - avoidlist list of modules to avoid |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3065 # - cond_dependencies true if conditional dependencies shall be supported, |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3066 # blank otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3067 # - tmp pathname of a temporary directory |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3068 # Output: |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3069 # - main_modules list of modules, including dependencies |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3070 # - testsrelated_modules list of tests-related modules, including dependencies |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3071 # - conddep_dependers, conddep_condition information about conditionally |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3072 # enabled modules |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3073 func_modules_transitive_closure_separately () |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3074 { |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3075 # Determine main module list. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3076 saved_inctests="$inctests" |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
3077 inctests=false |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3078 modules="$specified_modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3079 func_modules_transitive_closure |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3080 main_modules="$modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3081 inctests="$saved_inctests" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3082 if test $verbose -ge 1; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3083 echo "Main module list:" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3084 echo "$main_modules" | sed -e 's/^/ /' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3085 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3086 # Determine tests-related module list. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3087 echo "$final_modules" | LC_ALL=C sort -u > "$tmp"/final-modules |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3088 testsrelated_modules=`for module in $main_modules; do |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3089 if test \`func_get_applicability $module\` = main; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3090 echo $module |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3091 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3092 done \ |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3093 | LC_ALL=C sort -u | LC_ALL=C join -v 2 - "$tmp"/final-modules` |
18741
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3094 # If testsrelated_modules consists only of modules with applicability 'all', |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3095 # set it to empty (because such modules are only helper modules for other modules). |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3096 have_nontrivial_testsrelated_modules= |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3097 for module in $testsrelated_modules; do |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3098 if test `func_get_applicability $module` != all; then |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3099 have_nontrivial_testsrelated_modules=yes |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3100 break |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3101 fi |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3102 done |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3103 if test -z "$have_nontrivial_testsrelated_modules"; then |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3104 testsrelated_modules= |
8eca26cecdfe
gnulib-tool: Don't produce a tests directory with only snippet .h files.
Bruno Haible <bruno@clisp.org>
parents:
18734
diff
changeset
|
3105 fi |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3106 if test $verbose -ge 1; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3107 echo "Tests-related module list:" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3108 echo "$testsrelated_modules" | sed -e 's/^/ /' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3109 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3110 } |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3111 |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3112 # func_determine_use_libtests |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3113 # Determines whether a $testsbase/libtests.a is needed. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3114 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3115 # - local_gnulib_path from --local-dir |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3116 # - modcache true or false, from --cache-modules/--no-cache-modules |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3117 # - testsrelated_modules list of tests-related modules, including dependencies |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3118 # Output: |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3119 # - use_libtests true if a $testsbase/libtests.a is needed, false otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3120 func_determine_use_libtests () |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3121 { |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3122 use_libtests=false |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3123 for module in $testsrelated_modules; do |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3124 func_verify_nontests_module |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3125 if test -n "$module"; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3126 all_files=`func_get_filelist $module` |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3127 # Test whether some file in $all_files lies in lib/. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3128 for f in $all_files; do |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3129 case $f in |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3130 lib/*) |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3131 use_libtests=true |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3132 break 2 |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3133 ;; |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3134 esac |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3135 done |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3136 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3137 done |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3138 } |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3139 |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3140 # func_modules_add_dummy |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3141 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3142 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3143 # - 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
|
3144 # - 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
|
3145 # Output: |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3146 # - 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
|
3147 func_modules_add_dummy () |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3148 { |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3149 # 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
|
3150 have_lib_SOURCES= |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3151 for module in $modules; do |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3152 func_verify_nontests_module |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3153 if test -n "$module"; then |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3154 # Extract the value of "lib_SOURCES += ...". |
18000
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
3155 for file in `func_get_automake_snippet "$module" | combine_lines | |
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
3156 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
|
3157 # 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
|
3158 case "$file" in |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3159 *.h) ;; |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3160 *) |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3161 have_lib_SOURCES=yes |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3162 break 2 |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3163 ;; |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3164 esac |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3165 done |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3166 fi |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3167 done |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3168 # 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
|
3169 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
|
3170 if func_acceptable "dummy"; then |
9c0fa5819ce3
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8626
diff
changeset
|
3171 func_append modules " dummy" |
9c0fa5819ce3
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8626
diff
changeset
|
3172 fi |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3173 fi |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3174 } |
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
3175 |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3176 # func_modules_add_dummy_separately |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3177 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3178 # - local_gnulib_path from --local-dir |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3179 # - modcache true or false, from --cache-modules/--no-cache-modules |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3180 # - main_modules list of modules, including dependencies |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3181 # - testsrelated_modules list of tests-related modules, including dependencies |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3182 # - use_libtests true if a $testsbase/libtests.a is needed, false otherwise |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3183 # Output: |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3184 # - main_modules list of modules, including 'dummy' if needed |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3185 # - testsrelated_modules list of tests-related modules, including 'dummy' if |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3186 # needed |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3187 func_modules_add_dummy_separately () |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3188 { |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3189 # Add the dummy module to the main module list if needed. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3190 modules="$main_modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3191 func_modules_add_dummy |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3192 main_modules="$modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3193 |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3194 # Add the dummy module to the tests-related module list if needed. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3195 if $use_libtests; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3196 modules="$testsrelated_modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3197 func_modules_add_dummy |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3198 testsrelated_modules="$modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3199 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3200 } |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3201 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3202 # func_modules_notice |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3203 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3204 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3205 # - 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
|
3206 # - 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
|
3207 # - modules list of modules, including dependencies |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3208 func_modules_notice () |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3209 { |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3210 if test $verbose -ge -1; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3211 for module in $modules; do |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3212 func_verify_module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3213 if test -n "$module"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3214 msg=`func_get_notice $module` |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3215 if test -n "$msg"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3216 echo "Notice from module $module:" |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3217 echo "$msg" | sed -e 's/^/ /' |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3218 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3219 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3220 done |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3221 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3222 } |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
3223 |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3224 # func_modules_to_filelist |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3225 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3226 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3227 # - 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
|
3228 # - 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
|
3229 # Output: |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3230 # - files list of files |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3231 func_modules_to_filelist () |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3232 { |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3233 files= |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3234 for module in $modules; do |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3235 func_verify_module |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3236 if test -n "$module"; then |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3237 fs=`func_get_filelist $module` |
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
3238 func_append files " $fs" |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3239 fi |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3240 done |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
3241 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
|
3242 } |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
3243 |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3244 # func_modules_to_filelist_separately |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3245 # Determine the final file lists. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3246 # They must be computed separately, because files in lib/* go into |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3247 # $sourcebase/ if they are in the main file list but into $testsbase/ |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3248 # if they are in the tests-related file list. Furthermore lib/dummy.c |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3249 # can be in both. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3250 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3251 # - local_gnulib_path from --local-dir |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3252 # - modcache true or false, from --cache-modules/--no-cache-modules |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3253 # - main_modules list of modules, including dependencies |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3254 # - testsrelated_modules list of tests-related modules, including dependencies |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3255 func_modules_to_filelist_separately () |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3256 { |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3257 # Determine final main file list. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3258 modules="$main_modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3259 func_modules_to_filelist |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3260 main_files="$files" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3261 # Determine final tests-related file list. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3262 modules="$testsrelated_modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3263 func_modules_to_filelist |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3264 testsrelated_files=`echo "$files" | sed -e 's,^lib/,tests=lib/,'` |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3265 # Merge both file lists. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3266 sed_remove_empty_lines='/^$/d' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3267 files=`{ echo "$main_files"; echo "$testsrelated_files"; } | sed -e "$sed_remove_empty_lines" | LC_ALL=C sort -u` |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3268 if test $verbose -ge 0; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3269 echo "File list:" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3270 sed_prettyprint_files='s,^tests=lib/\(.*\)$,lib/\1 -> tests/\1,' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3271 echo "$files" | sed -e "$sed_prettyprint_files" -e 's/^/ /' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3272 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3273 } |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3274 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3275 # func_compute_include_guard_prefix |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3276 # Determine include_guard_prefix. |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3277 # Input: |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3278 # - macro_prefix prefix of gl_LIBOBJS macros to use |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3279 # Output: |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3280 # - include_guard_prefix replacement for ${gl_include_guard_prefix} |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3281 # - sed_replace_include_guard_prefix |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3282 # sed expression for resolving ${gl_include_guard_prefix} |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3283 func_compute_include_guard_prefix () |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3284 { |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3285 if test "$macro_prefix" = gl; then |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3286 include_guard_prefix='GL' |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3287 else |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3288 include_guard_prefix='GL_'`echo "$macro_prefix" | LC_ALL=C tr '[a-z]' '[A-Z]'` |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3289 fi |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3290 sed_replace_include_guard_prefix='s/\${gl_include_guard_prefix}/'"${include_guard_prefix}"'/g' |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3291 } |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3292 |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3293 # func_execute_command command [args...] |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3294 # Executes a command. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3295 # Uses also the variables |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3296 # - verbose integer, default 0, inc/decremented by --verbose/--quiet |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3297 func_execute_command () |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3298 { |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3299 if test $verbose -ge 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3300 echo "executing $*" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3301 "$@" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3302 else |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
3303 # 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
|
3304 # Turn this output off if the command succeeds. |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3305 "$@" > "$tmp"/cmdout 2>&1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3306 cmdret=$? |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3307 if test $cmdret = 0; then |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3308 rm -f "$tmp"/cmdout |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3309 else |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3310 echo "executing $*" |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3311 cat "$tmp"/cmdout 1>&2 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3312 rm -f "$tmp"/cmdout |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3313 (exit $cmdret) |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3314 fi |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3315 fi |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3316 } |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
3317 |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3318 # func_dest_tmpfilename file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3319 # 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
|
3320 # Input: |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3321 # - destdir target directory |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3322 # - 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
|
3323 # - tmp pathname of a temporary directory |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3324 # Sets variable: |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3325 # - tmpfile absolute filename of the temporary file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3326 func_dest_tmpfilename () |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3327 { |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3328 if $doit; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3329 # 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
|
3330 # 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
|
3331 tmpfile="$destdir/$1.tmp" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3332 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3333 # 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
|
3334 # (because the directory of "$file" might not exist). |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3335 tmpfile="$tmp"/`basename "$1"`.tmp |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3336 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3337 } |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3338 |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3339 # func_is_local_file lookedup_file file |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3340 # check whether file should be instantiated from local gnulib directory |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3341 func_is_local_file () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3342 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3343 dname=$1 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3344 func_remove_suffix dname "/$2" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3345 func_path_foreach "$local_gnulib_path" test %dir% = "$dname" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3346 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3347 |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3348 # func_should_link |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3349 # determines whether the file $f should be copied, symlinked, or hardlinked. |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3350 # Input: |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3351 # - copymode copy mode for files in general |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3352 # - lcopymode copy mode for files from local_gnulib_path |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3353 # - f the original file name |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3354 # - lookedup_file name of the merged (combined) file |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3355 # Sets variable: |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3356 # - copyaction copy or symlink or hardlink |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3357 func_should_link () |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3358 { |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3359 if test -n "$lcopymode" && func_is_local_file "$lookedup_file" "$f"; then |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3360 copyaction="$lcopymode" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3361 else |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3362 if test -n "$copymode"; then |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3363 copyaction="$copymode" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3364 else |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3365 copyaction=copy |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3366 fi |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3367 fi |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3368 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3369 |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3370 # func_add_file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3371 # 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
|
3372 # is known to not exist. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3373 # Input: |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3374 # - destdir target directory |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3375 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3376 # - 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
|
3377 # - f the original file name |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3378 # - lookedup_file name of the merged (combined) file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3379 # - 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
|
3380 # - g the rewritten file name |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3381 # - tmpfile absolute filename of the temporary file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3382 # - doit : if actions shall be executed, false if only to be printed |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3383 # - copymode copy mode for files in general |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3384 # - lcopymode copy mode for files from local_gnulib_path |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3385 func_add_file () |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3386 { |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3387 if $doit; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3388 echo "Copying file $g" |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3389 func_should_link |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3390 if test "$copyaction" = symlink \ |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3391 && test -z "$lookedup_tmp" \ |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
3392 && cmp -s "$lookedup_file" "$tmpfile"; then |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3393 func_symlink_if_changed "$lookedup_file" "$destdir/$g" |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3394 else |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3395 if test "$copyaction" = hardlink \ |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3396 && test -z "$lookedup_tmp" \ |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3397 && cmp -s "$lookedup_file" "$tmpfile"; then |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3398 func_hardlink "$lookedup_file" "$destdir/$g" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3399 else |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3400 mv -f "$tmpfile" "$destdir/${g}" || func_fatal_error "failed" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3401 fi |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3402 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3403 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3404 echo "Copy file $g" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3405 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3406 } |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3407 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3408 # func_update_file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3409 # 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
|
3410 # is known to exist. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3411 # Input: |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3412 # - destdir target directory |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3413 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3414 # - 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
|
3415 # - f the original file name |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3416 # - lookedup_file name of the merged (combined) file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3417 # - 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
|
3418 # - g the rewritten file name |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3419 # - tmpfile absolute filename of the temporary file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3420 # - doit : if actions shall be executed, false if only to be printed |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3421 # - copymode copy mode for files in general |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3422 # - lcopymode copy mode for files from local_gnulib_path |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3423 # - 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
|
3424 func_update_file () |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3425 { |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
3426 if cmp -s "$destdir/$g" "$tmpfile"; then |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3427 : # The file has not changed. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3428 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3429 # Replace the file. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3430 if $doit; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3431 if test -n "$already_present"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3432 echo "Updating file $g (backup in ${g}~)" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3433 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3434 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
|
3435 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3436 mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed" |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3437 func_should_link |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3438 if test "$copyaction" = symlink \ |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3439 && test -z "$lookedup_tmp" \ |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
3440 && cmp -s "$lookedup_file" "$tmpfile"; then |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3441 func_symlink_if_changed "$lookedup_file" "$destdir/$g" |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3442 else |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3443 if test "$copyaction" = hardlink \ |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3444 && test -z "$lookedup_tmp" \ |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3445 && cmp -s "$lookedup_file" "$tmpfile"; then |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3446 func_hardlink "$lookedup_file" "$destdir/$g" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3447 else |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3448 mv -f "$tmpfile" "$destdir/${g}" || func_fatal_error "failed" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
3449 fi |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3450 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3451 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3452 if test -n "$already_present"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3453 echo "Update file $g (backup in ${g}~)" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3454 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3455 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
|
3456 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3457 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3458 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3459 } |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
3460 |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3461 # 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
|
3462 # 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
|
3463 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3464 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3465 # - 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
|
3466 # - 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
|
3467 # - libname library name |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3468 # - 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
|
3469 # - auxdir directory relative to destdir where to place build aux files |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3470 # - gnu_make true if --gnu-make was given, false otherwise |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3471 # - makefile_name from --makefile-name |
7077 | 3472 # - 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
|
3473 # - 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
|
3474 # - po_domain prefix of i18n domain to use (without -gnulib suffix) |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
3475 # - witness_c_macro from --witness-c-macro |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3476 # - 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
|
3477 # - for_test true if creating a package for testing, false otherwise |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3478 # - sed_replace_include_guard_prefix |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3479 # sed expression for resolving ${gl_include_guard_prefix} |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3480 # - 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
|
3481 # Input/Output: |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3482 # - makefile_am_edits and makefile_am_edit${edit}_{dir,var,val,dotfirst} |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3483 # 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
|
3484 # Output: |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3485 # - 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
|
3486 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
|
3487 { |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3488 |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3489 # When using GNU make, or when creating an includable Makefile.am snippet, |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3490 # augment variables with += instead of assigning them. |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3491 if $gnu_make || test -n "$makefile_name"; then |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3492 assign='+=' |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3493 else |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3494 assign='=' |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3495 fi |
7077 | 3496 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
|
3497 libext=la |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3498 perhapsLT=LT |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
3499 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
|
3500 else |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3501 libext=a |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3502 perhapsLT= |
7335 | 3503 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
|
3504 fi |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3505 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
|
3506 # 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
|
3507 # 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
|
3508 # "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
|
3509 # 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
|
3510 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
|
3511 else |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
3512 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
|
3513 fi |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
7391
diff
changeset
|
3514 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
39737
bf73bd094dbd
gnulib-tool: minor tweaks for --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
3515 $gnu_make || |
bf73bd094dbd
gnulib-tool: minor tweaks for --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
3516 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
|
3517 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
|
3518 if test -n "$actioncmd"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
3519 printf '# Reproduce by:\n%s\n' "$actioncmd" |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3520 fi |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3521 echo |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3522 uses_subdirs= |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3523 { |
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
|
3524 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
|
3525 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
|
3526 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
|
3527 { |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3528 func_get_automake_snippet_conditional "$module" | |
12917
66202bb71d56
Fix incorrect Makefile.am generation in German locale.
Bruno Haible <bruno@clisp.org>
parents:
12903
diff
changeset
|
3529 LC_ALL=C \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3530 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
|
3531 -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
|
3532 -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
|
3533 -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
|
3534 -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
|
3535 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \ |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3536 -e "$sed_transform_check_PROGRAMS" \ |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3537 -e "$sed_replace_include_guard_prefix" |
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
|
3538 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
|
3539 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
|
3540 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
|
3541 fi |
18000
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
3542 } | combine_lines "${libname}_${libext}_SOURCES" > "$tmp"/amsnippet1 |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3543 { |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3544 func_get_automake_snippet_unconditional "$module" | |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3545 LC_ALL=C sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3546 } > "$tmp"/amsnippet2 |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
3547 # Skip the contents if it's entirely empty. |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3548 if grep '[^ ]' "$tmp"/amsnippet1 "$tmp"/amsnippet2 > /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
|
3549 echo "## begin gnulib module $module" |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3550 if $gnu_make; then |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3551 echo "ifeq (,\$(OMIT_GNULIB_MODULE_$module))" |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3552 convert_to_gnu_make='s/^if \(.*\)/ifneq (,$(\1))/' |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3553 else |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3554 convert_to_gnu_make= |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3555 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
|
3556 echo |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
3557 if test "$cond_dependencies" = true; then |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3558 if func_cond_module_p "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3559 func_module_conditional_name "$module" |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3560 if $gnu_make; then |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3561 echo "ifneq (,\$($conditional))" |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3562 else |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3563 echo "if $conditional" |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3564 fi |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3565 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3566 fi |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3567 sed "$convert_to_gnu_make" "$tmp"/amsnippet1 |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
3568 if test "$cond_dependencies" = true; then |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3569 if func_cond_module_p "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3570 echo "endif" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3571 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3572 fi |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3573 sed "$convert_to_gnu_make" "$tmp"/amsnippet2 |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3574 if $gnu_make; then |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3575 echo "endif" |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3576 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
|
3577 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
|
3578 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
|
3579 fi |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
3580 rm -f "$tmp"/amsnippet1 "$tmp"/amsnippet2 |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3581 # 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
|
3582 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
|
3583 case $f in |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3584 lib/*/*.c) |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3585 uses_subdirs=yes |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3586 break |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3587 ;; |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3588 esac |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3589 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
|
3590 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
|
3591 done |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3592 } > "$tmp"/allsnippets |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3593 if test -z "$makefile_name"; then |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3594 # 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
|
3595 # 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
|
3596 subdir_options= |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3597 if test -n "$uses_subdirs"; then |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3598 subdir_options=' subdir-objects' |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3599 fi |
39943 | 3600 echo "AUTOMAKE_OPTIONS = 1.11 gnits${subdir_options}" |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3601 fi |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
3602 echo |
7246
4a748ab30907
* gnulib-tool (func_emit_lib_Makefile_am): Fix typos in
Paul Eggert <eggert@cs.ucla.edu>
parents:
7245
diff
changeset
|
3603 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
|
3604 echo "SUBDIRS =" |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3605 echo "noinst_HEADERS =" |
7701
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3606 echo "noinst_LIBRARIES =" |
7691
33b654c2cba8
Initialize also noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7660
diff
changeset
|
3607 echo "noinst_LTLIBRARIES =" |
16713
5090324ee0c8
gnulib-tool: fix imprecise comments w.r.t. an automake bug
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
16377
diff
changeset
|
3608 # Automake versions < 1.11.4 create an empty pkgdatadir at |
5090324ee0c8
gnulib-tool: fix imprecise comments w.r.t. an automake bug
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
16377
diff
changeset
|
3609 # installation time if you specify pkgdata_DATA to empty. |
5090324ee0c8
gnulib-tool: fix imprecise comments w.r.t. an automake bug
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
16377
diff
changeset
|
3610 # See automake bugs #10997 and #11030: |
19190 | 3611 # * https://debbugs.gnu.org/10997 |
3612 # * https://debbugs.gnu.org/11030 | |
16713
5090324ee0c8
gnulib-tool: fix imprecise comments w.r.t. an automake bug
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
16377
diff
changeset
|
3613 # So we need this workaround. |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3614 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
|
3615 echo "pkgdata_DATA =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3616 fi |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3617 echo "EXTRA_DIST =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3618 echo "BUILT_SOURCES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3619 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
|
3620 fi |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3621 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
|
3622 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
|
3623 echo "MOSTLYCLEANDIRS =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3624 echo "CLEANFILES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3625 echo "DISTCLEANFILES =" |
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3626 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
|
3627 fi |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3628 if $gnu_make; then |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3629 echo "# Start of GNU Make output." |
18910
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3630 |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3631 # Put autoconf output into a temporary file, so that its exit status |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3632 # can be checked from the shell. Signal any error by putting a |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3633 # syntax error into the output makefile. |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3634 ${AUTOCONF} -t 'AC_SUBST:$1 = @$1@' "$configure_ac" \ |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3635 >"$tmp"/makeout 2>"$tmp"/makeout2 && |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3636 LC_ALL=C sort -u "$tmp"/makeout || { |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3637 echo "== gnulib-tool GNU Make output failed as follows ==" |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3638 sed 's/^/# stderr: /' "$tmp"/makeout2 |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3639 } |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3640 rm -f "$tmp"/makeout "$tmp"/makeout2 |
5f711c62458f
gnulib-tool: improve GNU Make debugging
Paul Eggert <eggert@cs.ucla.edu>
parents:
18786
diff
changeset
|
3641 |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3642 echo "# End of GNU Make output." |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3643 else |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3644 echo "# No GNU Make output." |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3645 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
|
3646 # 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
|
3647 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
|
3648 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
|
3649 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
|
3650 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
|
3651 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
|
3652 eval val=\"\$makefile_am_edit${edit}_val\" |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3653 eval dotfirst=\"\$makefile_am_edit${edit}_dotfirst\" |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3654 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
|
3655 if test "${dir}Makefile.am" = "$destfile" || test "./${dir}Makefile.am" = "$destfile"; then |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3656 if test "${var}" = SUBDIRS && test -n "$dotfirst"; then |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3657 # The added subdirectory ${val} needs to be mentioned after '.'. |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3658 # Since we don't have '.' among SUBDIRS so far, add it now. |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3659 val=". ${val}" |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3660 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
|
3661 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
|
3662 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
|
3663 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3664 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3665 done |
14917
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3666 if test -n "$witness_c_macro"; then |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3667 cppflags_part1=" -D$witness_c_macro=1" |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3668 else |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3669 cppflags_part1= |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3670 fi |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3671 if $for_test; then |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3672 cppflags_part2=" -DGNULIB_STRICT_CHECKING=1" |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3673 else |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3674 cppflags_part2= |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3675 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
|
3676 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
|
3677 echo |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
3678 echo "AM_CPPFLAGS =$cppflags_part1$cppflags_part2" |
11261
f0359b41944f
Make it easier to use the 'visibility' module.
Bruno Haible <bruno@clisp.org>
parents:
11249
diff
changeset
|
3679 echo "AM_CFLAGS =" |
14917
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3680 else |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3681 if test -n "$cppflags_part1$cppflags_part2"; then |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3682 echo |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3683 echo "AM_CPPFLAGS +=$cppflags_part1$cppflags_part2" |
42a9e4eb100a
gnulib-tool: Addendum to 2011-06-08 commit.
Bruno Haible <bruno@clisp.org>
parents:
14908
diff
changeset
|
3684 fi |
7240
e9d3ace50303
Slightly change the output generated by --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7239
diff
changeset
|
3685 fi |
6750
608add4e5b80
Support for packages that use "gettextize --intl". From Claudio Fontana.
Bruno Haible <bruno@clisp.org>
parents:
6745
diff
changeset
|
3686 echo |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3687 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
|
3688 || { test -n "$makefile_name" \ |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
3689 && test -f "$sourcebase/Makefile.am" \ |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
3690 && 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
|
3691 }; then |
9b74d1d0b267
Make it easier to distribute gnulib-built libraries.
Bruno Haible <bruno@clisp.org>
parents:
11461
diff
changeset
|
3692 # 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
|
3693 # 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
|
3694 # it should not be installed. |
7701
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3695 : |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3696 else |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3697 # 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
|
3698 echo "noinst_${perhapsLT}LIBRARIES += $libname.$libext" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3699 fi |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3700 echo |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3701 echo "${libname}_${libext}_SOURCES =" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3702 # 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
|
3703 # 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
|
3704 echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3705 echo "${libname}_${libext}_DEPENDENCIES = \$(${macro_prefix}_${perhapsLT}LIBOBJS)" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3706 echo "EXTRA_${libname}_${libext}_SOURCES =" |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3707 if test "$libtool" = true; then |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3708 echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)" |
13763
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3709 echo "${libname}_${libext}_LDFLAGS += -no-undefined" |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3710 # Synthesize an ${libname}_${libext}_LDFLAGS augmentation by combining |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3711 # the link dependencies of all modules. |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3712 for module in $modules; do |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3713 func_verify_nontests_module |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3714 if test -n "$module"; then |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3715 func_get_link_directive "$module" |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3716 fi |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3717 done \ |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3718 | LC_ALL=C sed -e '/^$/d' -e 's/ when linking with libtool.*//' \ |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3719 | LC_ALL=C sort -u \ |
064af6542c0a
gnulib-tool: Synthesize appropriate _LDFLAGS for a libtool library.
Bruno Haible <bruno@clisp.org>
parents:
13759
diff
changeset
|
3720 | LC_ALL=C sed -e 's/^/'"${libname}_${libext}"'_LDFLAGS += /' |
7701
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3721 fi |
c59b96cb52c7
Fix double initialization of noinst_LTLIBRARIES.
Bruno Haible <bruno@clisp.org>
parents:
7691
diff
changeset
|
3722 echo |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3723 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3724 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
|
3725 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3726 fi |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3727 cat "$tmp"/allsnippets \ |
14273
8f6d3e05c7e2
libposix: Revert the unreviewed part of yesterday's big merge.
Bruce Korb <bkorb@gnu.org>
parents:
14271
diff
changeset
|
3728 | 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
|
3729 echo |
7086 | 3730 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
|
3731 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
|
3732 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
|
3733 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
|
3734 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
|
3735 echo " done; \\" |
03602a916a9a
Don't let the 'mostlyclean' target fail because of a nonempty directory.
Bruno Haible <bruno@clisp.org>
parents:
9009
diff
changeset
|
3736 echo " :" |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3737 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
|
3738 } |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
3739 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3740 # func_emit_po_Makevars |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
3741 # 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
|
3742 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3743 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3744 # - 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
|
3745 # - 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
|
3746 # - 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
|
3747 # - 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
|
3748 func_emit_po_Makevars () |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3749 { |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3750 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3751 func_emit_copyright_notice |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3752 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3753 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
|
3754 echo "# But here it has a '-gnulib' suffix." |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3755 echo "DOMAIN = ${po_domain}-gnulib" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3756 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3757 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
|
3758 echo "subdir = ${pobase}" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3759 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
|
3760 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3761 cat <<\EOF |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3762 # These options get passed to xgettext. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3763 XGETTEXT_OPTIONS = \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3764 --keyword=_ --flag=_:1:pass-c-format \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3765 --keyword=N_ --flag=N_:1:pass-c-format \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3766 --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
|
3767 --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
|
3768 --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
|
3769 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3770 # 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
|
3771 # $(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
|
3772 COPYRIGHT_HOLDER = Free Software Foundation, Inc. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3773 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3774 # 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
|
3775 # bugs in the untranslated strings: |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3776 # - 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
|
3777 # in the GNU gettext documentation, section 'Preparing Strings'. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3778 # - 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
|
3779 # understood. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3780 # - 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
|
3781 # money. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3782 # - Pluralisation problems. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3783 # - Incorrect English spelling. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3784 # - Incorrect formatting. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3785 # 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
|
3786 # 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
|
3787 # which the translators can contact you. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3788 MSGID_BUGS_ADDRESS = bug-gnulib@gnu.org |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3789 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3790 # 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
|
3791 # 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
|
3792 EXTRA_LOCALE_CATEGORIES = |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3793 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3794 # 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
|
3795 # 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
|
3796 # 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
|
3797 # 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
|
3798 USE_MSGCTXT = no |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3799 EOF |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3800 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3801 |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3802 # func_emit_po_POTFILES_in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3803 # 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
|
3804 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3805 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3806 # - 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
|
3807 # - 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
|
3808 # - files list of new files |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3809 func_emit_po_POTFILES_in () |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3810 { |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3811 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3812 func_emit_copyright_notice |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3813 echo |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3814 echo "# List of files which contain translatable strings." |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3815 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
|
3816 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
3817 |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
3818 # 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
|
3819 # 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
|
3820 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
3821 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
3822 # - 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
|
3823 # - modules list of modules, including dependencies |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3824 # - 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
|
3825 # - auxdir directory relative to destdir where to place build aux files |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3826 # - gnu_make true if --gnu-make was given, false otherwise |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
3827 # - makefile_name from --makefile-name |
7077 | 3828 # - 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
|
3829 # - sourcebase relative directory containing lib source code |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3830 # - m4base relative directory containing autoconf macros |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
3831 # - 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
|
3832 # - macro_prefix prefix of gl_LIBOBJS macros to use |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
3833 # - witness_c_macro from --witness-c-macro |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3834 # - for_test true if creating a package for testing, false otherwise |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3835 # - single_configure true if a single configure file should be generated, |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3836 # false for a separate configure file for the tests |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3837 # - use_libtests true if a libtests.a should be built, false otherwise |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3838 # - sed_replace_include_guard_prefix |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3839 # sed expression for resolving ${gl_include_guard_prefix} |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3840 # - 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
|
3841 # Input/Output: |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3842 # - makefile_am_edits and makefile_am_edit${edit}_{dir,var,val,dotfirst} |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3843 # 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
|
3844 # Output: |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3845 # - 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
|
3846 func_emit_tests_Makefile_am () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3847 { |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
3848 witness_macro="$1" |
7077 | 3849 if test "$libtool" = true; then |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3850 libext=la |
17047
458e7152e580
gnulib-tool: Improve coding style.
Bruno Haible <bruno@clisp.org>
parents:
17046
diff
changeset
|
3851 perhapsLT=LT |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
3852 sed_eliminate_LDFLAGS="$sed_noop" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3853 else |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3854 libext=a |
17047
458e7152e580
gnulib-tool: Improve coding style.
Bruno Haible <bruno@clisp.org>
parents:
17046
diff
changeset
|
3855 perhapsLT= |
7335 | 3856 sed_eliminate_LDFLAGS='/^lib_LDFLAGS[ ]*+=/d' |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3857 fi |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3858 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
|
3859 # 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
|
3860 # 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
|
3861 # "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
|
3862 # 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
|
3863 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
|
3864 else |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
3865 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
|
3866 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3867 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
|
3868 echo "## DO NOT EDIT! GENERATED AUTOMATICALLY!" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3869 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
|
3870 func_emit_copyright_notice |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3871 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
|
3872 uses_subdirs= |
12054
1c9a8901e75c
Fix value of uses_subdirs in tests/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
12021
diff
changeset
|
3873 { |
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
|
3874 for module in $modules; do |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3875 if $for_test && ! $single_configure; then |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3876 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
|
3877 else |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3878 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
|
3879 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
|
3880 if test -n "$module"; then |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3881 { |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
3882 func_get_automake_snippet "$module" | |
12917
66202bb71d56
Fix incorrect Makefile.am generation in German locale.
Bruno Haible <bruno@clisp.org>
parents:
12903
diff
changeset
|
3883 LC_ALL=C \ |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
3884 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
|
3885 -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
|
3886 -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
|
3887 -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
|
3888 -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
|
3889 -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \ |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3890 -e "$sed_transform_check_PROGRAMS" \ |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
3891 -e "$sed_replace_include_guard_prefix" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3892 if $use_libtests && test "$module" = 'alloca'; then |
18913
680cbae5afc0
gnulib-tool: Fix generated code when libtests contains module 'alloca'.
Bruno Haible <bruno@clisp.org>
parents:
18910
diff
changeset
|
3893 echo "libtests_a_LIBADD += @ALLOCA@" |
680cbae5afc0
gnulib-tool: Fix generated code when libtests contains module 'alloca'.
Bruno Haible <bruno@clisp.org>
parents:
18910
diff
changeset
|
3894 echo "libtests_a_DEPENDENCIES += @ALLOCA@" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3895 fi |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3896 } > "$tmp"/amsnippet |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
3897 # 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
|
3898 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
|
3899 # 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
|
3900 ofd=3 |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3901 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
|
3902 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
|
3903 ofd=4 |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3904 break |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3905 fi |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3906 done |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3907 { echo "## begin gnulib module $module" |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3908 if $gnu_make; then |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3909 echo "ifeq (,\$(OMIT_GNULIB_MODULE_$module))" |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3910 fi |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3911 echo |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3912 cat "$tmp"/amsnippet |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3913 if $gnu_make; then |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3914 echo "endif" |
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
3915 fi |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3916 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
|
3917 echo |
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3918 } >&$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
|
3919 fi |
12741
12d8c6b23748
gnulib-tool: avoid writing in the current directory.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
12559
diff
changeset
|
3920 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
|
3921 # 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
|
3922 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
|
3923 case $f in |
10985
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3924 lib/*/*.c | tests/*/*.c) |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3925 uses_subdirs=yes |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3926 break |
32537aa6364d
Terminate loops early when possible.
Bruno Haible <bruno@clisp.org>
parents:
10981
diff
changeset
|
3927 ;; |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3928 esac |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3929 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
|
3930 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
|
3931 done |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3932 } 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
|
3933 # 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
|
3934 # 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
|
3935 # 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
|
3936 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
|
3937 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
|
3938 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
|
3939 fi |
39943 | 3940 echo "AUTOMAKE_OPTIONS = 1.11 foreign${subdir_options}" |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3941 echo |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
3942 if $for_test && ! $single_configure; then |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3943 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
|
3944 echo |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3945 fi |
6533
6bc4290ca85f
Avoid an automake error regarding the 'gettext' module.
Bruno Haible <bruno@clisp.org>
parents:
6512
diff
changeset
|
3946 # 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
|
3947 # 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
|
3948 # "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
|
3949 echo "SUBDIRS = ." |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3950 echo "TESTS =" |
12295
b8c65d432a3e
Add xalloc-die self-test.
Simon Josefsson <simon@josefsson.org>
parents:
12288
diff
changeset
|
3951 echo "XFAIL_TESTS =" |
10732
a97c57b9b48e
argp: Use standard gnulib idiom for EXEEXT.
Simon Josefsson <simon@josefsson.org>
parents:
10729
diff
changeset
|
3952 echo "TESTS_ENVIRONMENT =" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3953 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
|
3954 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
|
3955 echo "check_PROGRAMS =" |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
3956 fi |
18786
f2fc38f20336
verify tests: Fix spurious failure with parallel make.
Bruno Haible <bruno@clisp.org>
parents:
18741
diff
changeset
|
3957 echo "EXTRA_PROGRAMS =" |
6548
060487c0b13c
Initialize also noinst_HEADERS to empty.
Bruno Haible <bruno@clisp.org>
parents:
6547
diff
changeset
|
3958 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
|
3959 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
|
3960 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
|
3961 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
|
3962 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
|
3963 else |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3964 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
|
3965 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
3966 fi |
16713
5090324ee0c8
gnulib-tool: fix imprecise comments w.r.t. an automake bug
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
16377
diff
changeset
|
3967 # Automake versions < 1.11.4 create an empty pkgdatadir at |
5090324ee0c8
gnulib-tool: fix imprecise comments w.r.t. an automake bug
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
16377
diff
changeset
|
3968 # installation time if you specify pkgdata_DATA to empty. |
5090324ee0c8
gnulib-tool: fix imprecise comments w.r.t. an automake bug
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
16377
diff
changeset
|
3969 # See automake bugs #10997 and #11030: |
19190 | 3970 # * https://debbugs.gnu.org/10997 |
3971 # * https://debbugs.gnu.org/11030 | |
16713
5090324ee0c8
gnulib-tool: fix imprecise comments w.r.t. an automake bug
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
16377
diff
changeset
|
3972 # So we need this workaround. |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
3973 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
|
3974 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
|
3975 fi |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3976 echo "EXTRA_DIST =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3977 echo "BUILT_SOURCES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3978 echo "SUFFIXES =" |
7079 | 3979 echo "MOSTLYCLEANFILES = core *.stackdump" |
6862 | 3980 echo "MOSTLYCLEANDIRS =" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3981 echo "CLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3982 echo "DISTCLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
3983 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
|
3984 # 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
|
3985 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
|
3986 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
|
3987 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
|
3988 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
|
3989 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
|
3990 eval val=\"\$makefile_am_edit${edit}_val\" |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3991 eval dotfirst=\"\$makefile_am_edit${edit}_dotfirst\" |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
3992 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
|
3993 if test "${dir}Makefile.am" = "$destfile" || test "./${dir}Makefile.am" = "$destfile"; then |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3994 if test "${var}" = SUBDIRS && test -n "$dotfirst"; then |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3995 # The added subdirectory ${val} needs to be mentioned after '.'. |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3996 # But we have '.' among SUBDIRS already, so do nothing. |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3997 : |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
3998 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
|
3999 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
|
4000 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
|
4001 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4002 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
4003 done |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4004 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4005 echo "AM_CPPFLAGS = \\" |
13217
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
4006 if $for_test; then |
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
4007 echo " -DGNULIB_STRICT_CHECKING=1 \\" |
885b58a1c02f
Stricter declaration checking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13111
diff
changeset
|
4008 fi |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4009 if test -n "$witness_c_macro"; then |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4010 echo " -D$witness_c_macro=1 \\" |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4011 fi |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
4012 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
|
4013 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
|
4014 fi |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4015 echo " -I. -I\$(srcdir) \\" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4016 echo " -I${testsbase_inverse} -I\$(srcdir)/${testsbase_inverse} \\" |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4017 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
|
4018 echo |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
4019 local_ldadd_before='' |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
4020 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
|
4021 if $use_libtests; then |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
4022 # 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
|
4023 # 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
|
4024 # 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
|
4025 # 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
|
4026 # 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
|
4027 # module whose dependency to 'progname' is voluntarily omitted). |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
4028 # 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
|
4029 # not matter. |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
4030 local_ldadd_before=' libtests.a' |
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
4031 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
|
4032 fi |
9540
56fe79dce87d
Remove unnecessary -l options from LDFLAGS.
Bruno Haible <bruno@clisp.org>
parents:
9523
diff
changeset
|
4033 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
|
4034 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
|
4035 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
|
4036 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
|
4037 # 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
|
4038 # 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
|
4039 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
|
4040 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
|
4041 echo "EXTRA_libtests_a_SOURCES =" |
9523
49f7561fc2d3
Allow circular dependency of separate libtests.a
Eric Blake <ebb9@byu.net>
parents:
9520
diff
changeset
|
4042 # The circular dependency in LDADD requires this. |
49f7561fc2d3
Allow circular dependency of separate libtests.a
Eric Blake <ebb9@byu.net>
parents:
9520
diff
changeset
|
4043 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
|
4044 echo |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4045 fi |
12775
03aab12b3f15
Provide EXEEXT and srcdir in TESTS_ENVIRONMENT by default.
Bruno Haible <bruno@clisp.org>
parents:
12743
diff
changeset
|
4046 # 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
|
4047 # 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
|
4048 # 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
|
4049 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
|
4050 echo |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
4051 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
|
4052 | 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
|
4053 echo "# Clean up after Solaris cc." |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4054 echo "clean-local:" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4055 echo " rm -rf SunWS_cache" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4056 echo |
7086 | 4057 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
|
4058 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
|
4059 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
|
4060 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
|
4061 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
|
4062 echo " done; \\" |
03602a916a9a
Don't let the 'mostlyclean' target fail because of a nonempty directory.
Bruno Haible <bruno@clisp.org>
parents:
9009
diff
changeset
|
4063 echo " :" |
13111
1af4e2d31f2a
gnulib-tool: Ensure that long-running tests are executed last.
Bruno Haible <bruno@clisp.org>
parents:
13110
diff
changeset
|
4064 rm -f "$tmp"/main_snippets "$tmp"/longrunning_snippets |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4065 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
4066 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4067 # 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
|
4068 # 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
|
4069 # - 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
|
4070 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
|
4071 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4072 macro_prefix_arg="$1" |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
4073 # 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
|
4074 # 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
|
4075 # 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
|
4076 # 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
|
4077 # flexibility.) |
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
4078 # 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
|
4079 # 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
|
4080 # 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
|
4081 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
|
4082 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
|
4083 # 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
|
4084 # 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
|
4085 # 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
|
4086 # 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
|
4087 # 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
|
4088 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
|
4089 # 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
|
4090 # 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
|
4091 # 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
|
4092 # 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
|
4093 # 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
|
4094 # in which to expect them. |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
4095 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
|
4096 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
|
4097 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
|
4098 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
4099 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4100 # 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
|
4101 # 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
|
4102 # - 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
|
4103 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
|
4104 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4105 macro_prefix_arg="$1" |
10066
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
4106 # 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
|
4107 # 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
|
4108 # 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
|
4109 # check is skipped. |
10067
40a8c0b4f5e0
Oops, fix small mistake in last commit.
Bruno Haible <bruno@clisp.org>
parents:
10066
diff
changeset
|
4110 echo " m4_ifval(${macro_prefix_arg}_LIBSOURCES_LIST, [" |
10261 | 4111 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
|
4112 echo " for gl_file in ]${macro_prefix_arg}_LIBSOURCES_LIST[ ; do" |
10261 | 4113 echo " if test ! -r ]m4_defn([${macro_prefix_arg}_LIBSOURCES_DIR])[/\$gl_file ; then" |
4114 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
|
4115 echo " exit 1" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
4116 echo " fi" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
4117 echo " done])dnl" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
4118 echo " m4_if(m4_sysval, [0], []," |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
4119 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
|
4120 echo " ])" |
9a2a9c43db65
Reduce number of forks required during autoconf.
Eric Blake <ebb9@byu.net>
parents:
10065
diff
changeset
|
4121 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
|
4122 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
|
4123 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
|
4124 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
|
4125 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
|
4126 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
|
4127 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
|
4128 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
|
4129 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
|
4130 echo " # Remove the extension." |
472795eea368
Remove duplicates from the gl_LIBOBJS list.
Bruno Haible <bruno@clisp.org>
parents:
7497
diff
changeset
|
4131 echo " sed_drop_objext='s/\\.o\$//;s/\\.obj\$//'" |
12417 | 4132 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
|
4133 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
|
4134 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
|
4135 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
|
4136 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
|
4137 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
|
4138 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
|
4139 echo " ])" |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
4140 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
4141 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4142 # 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
|
4143 # 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
|
4144 # - 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
|
4145 # - 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
|
4146 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
|
4147 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4148 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
|
4149 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
|
4150 echo |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
4151 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
|
4152 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
|
4153 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
|
4154 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
|
4155 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
|
4156 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
|
4157 echo |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
4158 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
|
4159 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
|
4160 echo "AC_DEFUN([${macro_prefix_arg}_REPLACE_FUNCS], [" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
4161 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
|
4162 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
|
4163 echo "])" |
7646
33bd42644eec
Override also AC_LIBSOURCES. Works around an automake error
Bruno Haible <bruno@clisp.org>
parents:
7644
diff
changeset
|
4164 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
|
4165 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
|
4166 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
|
4167 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
|
4168 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
|
4169 echo "AC_DEFUN([${macro_prefix_arg}_LIBSOURCES], [" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
4170 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
|
4171 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
|
4172 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
|
4173 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
|
4174 echo " ])" |
9237
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
4175 echo " ])" |
aeb8e2d99afa
m4 macro indentation.
Bruno Haible <bruno@linuix.haible.de>
parents:
9232
diff
changeset
|
4176 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
|
4177 } |
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
4178 |
14672 | 4179 # func_emit_autoconf_snippet indentation |
4180 # emits the autoconf snippet of a module. | |
14669
7d7930e97930
gnulib-tool: Reduce code duplication.
Bruno Haible <bruno@clisp.org>
parents:
14625
diff
changeset
|
4181 # Input: |
17042
61736e6c8fbe
gnulib-tool: Fix indentation of generated gnulib-comp.m4 file.
Bruno Haible <bruno@clisp.org>
parents:
17039
diff
changeset
|
4182 # - indentation spaces to prepend on each line |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4183 # - local_gnulib_path from --local-dir |
14669
7d7930e97930
gnulib-tool: Reduce code duplication.
Bruno Haible <bruno@clisp.org>
parents:
14625
diff
changeset
|
4184 # - modcache true or false, from --cache-modules/--no-cache-modules |
7d7930e97930
gnulib-tool: Reduce code duplication.
Bruno Haible <bruno@clisp.org>
parents:
14625
diff
changeset
|
4185 # - sed_replace_build_aux sed expression that replaces reference to build-aux |
16122
e3e8e2fc21a9
Fix conflict between two instantiations of module 'unistd'.
Bruno Haible <bruno@clisp.org>
parents:
15854
diff
changeset
|
4186 # - sed_replace_include_guard_prefix |
e3e8e2fc21a9
Fix conflict between two instantiations of module 'unistd'.
Bruno Haible <bruno@clisp.org>
parents:
15854
diff
changeset
|
4187 # sed expression for resolving ${gl_include_guard_prefix} |
14672 | 4188 # - module the module name |
4189 # - toplevel true or false. 'false' means a subordinate use of | |
4190 # gnulib-tool. | |
4191 # - disable_libtool true or false. It tells whether to disable libtool | |
4192 # handling even if it has been specified through the | |
4193 # command line options. | |
4194 # - disable_gettext true or false. It tells whether to disable AM_GNU_GETTEXT | |
4195 # invocations. | |
4196 func_emit_autoconf_snippet () | |
4197 { | |
17042
61736e6c8fbe
gnulib-tool: Fix indentation of generated gnulib-comp.m4 file.
Bruno Haible <bruno@clisp.org>
parents:
17039
diff
changeset
|
4198 indentation="$1" |
14672 | 4199 if { case $module in |
4200 gnumakefile | maintainer-makefile) | |
4201 # These modules are meant to be used only in the top-level directory. | |
4202 $toplevel ;; | |
4203 *) | |
4204 true ;; | |
4205 esac | |
4206 }; then | |
4207 func_get_autoconf_snippet "$module" \ | |
4208 | sed -e '/^$/d;' -e "s/^/$indentation/" \ | |
4209 -e "$sed_replace_build_aux" \ | |
16122
e3e8e2fc21a9
Fix conflict between two instantiations of module 'unistd'.
Bruno Haible <bruno@clisp.org>
parents:
15854
diff
changeset
|
4210 -e "$sed_replace_include_guard_prefix" \ |
14672 | 4211 | { if $disable_libtool; then |
4212 sed -e 's/\$gl_cond_libtool/false/g' \ | |
4213 -e 's/gl_libdeps/gltests_libdeps/g' \ | |
4214 -e 's/gl_ltlibdeps/gltests_ltlibdeps/g' | |
4215 else | |
4216 cat | |
4217 fi | |
4218 } \ | |
4219 | { if $disable_gettext; then | |
4220 sed -e 's/AM_GNU_GETTEXT(\[external\])/dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac./' | |
4221 else | |
17269
c9d7491e3e78
gnulib-tool: fix incompatibility with autopoint 0.18.2
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
4222 # Don't indent AM_GNU_GETTEXT_VERSION line, as that confuses |
c9d7491e3e78
gnulib-tool: fix incompatibility with autopoint 0.18.2
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
4223 # autopoint through at least GNU gettext version 0.18.2. |
c9d7491e3e78
gnulib-tool: fix incompatibility with autopoint 0.18.2
Paul Eggert <eggert@cs.ucla.edu>
parents:
17249
diff
changeset
|
4224 sed -e 's/^ *AM_GNU_GETTEXT_VERSION/AM_GNU_GETTEXT_VERSION/' |
14672 | 4225 fi |
4226 } | |
4227 if test "$module" = 'alloca' && test "$libtool" = true && ! $disable_libtool; then | |
4228 echo 'changequote(,)dnl' | |
4229 echo 'LTALLOCA=`echo "$ALLOCA" | sed -e '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' | |
4230 echo 'changequote([, ])dnl' | |
4231 echo 'AC_SUBST([LTALLOCA])' | |
4232 fi | |
4233 fi | |
4234 } | |
4235 | |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
4236 # func_emit_autoconf_snippets modules referenceable_modules verifier toplevel disable_libtool disable_gettext |
14672 | 4237 # collects and emit the autoconf snippets of a set of modules. |
4238 # Input: | |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4239 # - local_gnulib_path from --local-dir |
14672 | 4240 # - modcache true or false, from --cache-modules/--no-cache-modules |
4241 # - sed_replace_build_aux sed expression that replaces reference to build-aux | |
16122
e3e8e2fc21a9
Fix conflict between two instantiations of module 'unistd'.
Bruno Haible <bruno@clisp.org>
parents:
15854
diff
changeset
|
4242 # - sed_replace_include_guard_prefix |
e3e8e2fc21a9
Fix conflict between two instantiations of module 'unistd'.
Bruno Haible <bruno@clisp.org>
parents:
15854
diff
changeset
|
4243 # sed expression for resolving ${gl_include_guard_prefix} |
14672 | 4244 # - modules the list of modules. |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
4245 # - referenceable_modules the list of modules which may be referenced as dependencies. |
14672 | 4246 # - verifier one of func_verify_module, func_verify_nontests_module, |
4247 # func_verify_tests_module. It selects the subset of | |
4248 # $modules to consider. | |
4249 # - toplevel true or false. 'false' means a subordinate use of | |
4250 # gnulib-tool. | |
4251 # - disable_libtool true or false. It tells whether to disable libtool | |
4252 # handling even if it has been specified through the | |
4253 # command line options. | |
4254 # - disable_gettext true or false. It tells whether to disable AM_GNU_GETTEXT | |
4255 # invocations. | |
14669
7d7930e97930
gnulib-tool: Reduce code duplication.
Bruno Haible <bruno@clisp.org>
parents:
14625
diff
changeset
|
4256 func_emit_autoconf_snippets () |
7d7930e97930
gnulib-tool: Reduce code duplication.
Bruno Haible <bruno@clisp.org>
parents:
14625
diff
changeset
|
4257 { |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
4258 referenceable_modules="$2" |
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
4259 verifier="$3" |
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
4260 toplevel="$4" |
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
4261 disable_libtool="$5" |
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
4262 disable_gettext="$6" |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4263 if test "$cond_dependencies" = true; then |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
4264 for m in $referenceable_modules; do echo $m; done | LC_ALL=C sort -u > "$tmp"/modules |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4265 # Emit the autoconf code for the unconditional modules. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4266 for module in $1; do |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4267 eval $verifier |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4268 if test -n "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4269 if func_cond_module_p "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4270 : |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4271 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4272 func_emit_autoconf_snippet " " |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4273 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4274 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4275 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4276 # Initialize the shell variables indicating that the modules are enabled. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4277 for module in $1; do |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4278 eval $verifier |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4279 if test -n "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4280 if func_cond_module_p "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4281 func_module_shellvar_name "$module" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4282 echo " $shellvar=false" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4283 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4284 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4285 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4286 # Emit the autoconf code for the conditional modules, each in a separate |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4287 # function. This makes it possible to support cycles among conditional |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4288 # modules. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4289 for module in $1; do |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4290 eval $verifier |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4291 if test -n "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4292 if func_cond_module_p "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4293 func_module_shellfunc_name "$module" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4294 func_module_shellvar_name "$module" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4295 echo " $shellfunc ()" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4296 echo ' {' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4297 echo " if ! \$$shellvar; then" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4298 func_emit_autoconf_snippet " " |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4299 echo " $shellvar=true" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4300 deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"` |
15854
d3633bf8b61d
gnulib-tool: Improve last commit.
Bruno Haible <bruno@clisp.org>
parents:
15853
diff
changeset
|
4301 # Intersect $deps with the modules list $1. |
d3633bf8b61d
gnulib-tool: Improve last commit.
Bruno Haible <bruno@clisp.org>
parents:
15853
diff
changeset
|
4302 deps=`for m in $deps; do echo $m; done | LC_ALL=C sort -u | LC_ALL=C join - "$tmp"/modules` |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4303 for dep in $deps; do |
15854
d3633bf8b61d
gnulib-tool: Improve last commit.
Bruno Haible <bruno@clisp.org>
parents:
15853
diff
changeset
|
4304 if func_cond_module_p "$dep"; then |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4305 func_module_shellfunc_name "$dep" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4306 func_cond_module_condition "$module" "$dep" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4307 if test "$condition" != true; then |
15852
44740f4ef8e2
gnulib-tool: fix typo that broke Emacs on powerpc-apple-darwin9.8.0.
Paul Eggert <eggert@cs.ucla.edu>
parents:
15801
diff
changeset
|
4308 echo " if $condition; then" |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4309 echo " $shellfunc" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4310 echo ' fi' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4311 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4312 echo " $shellfunc" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4313 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4314 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4315 # The autoconf code for $dep has already been emitted above and |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4316 # therefore is already executed when this function is run. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4317 : |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4318 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4319 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4320 echo ' fi' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4321 echo ' }' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4322 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4323 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4324 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4325 # Emit the dependencies from the unconditional to the conditional modules. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4326 for module in $1; do |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4327 eval $verifier |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4328 if test -n "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4329 if func_cond_module_p "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4330 : |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4331 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4332 deps=`func_get_dependencies $module | sed -e "$sed_dependencies_without_conditions"` |
15854
d3633bf8b61d
gnulib-tool: Improve last commit.
Bruno Haible <bruno@clisp.org>
parents:
15853
diff
changeset
|
4333 # Intersect $deps with the modules list $1. |
d3633bf8b61d
gnulib-tool: Improve last commit.
Bruno Haible <bruno@clisp.org>
parents:
15853
diff
changeset
|
4334 deps=`for m in $deps; do echo $m; done | LC_ALL=C sort -u | LC_ALL=C join - "$tmp"/modules` |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4335 for dep in $deps; do |
15854
d3633bf8b61d
gnulib-tool: Improve last commit.
Bruno Haible <bruno@clisp.org>
parents:
15853
diff
changeset
|
4336 if func_cond_module_p "$dep"; then |
14682
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4337 func_module_shellfunc_name "$dep" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4338 func_cond_module_condition "$module" "$dep" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4339 if test "$condition" != true; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4340 echo " if $condition; then" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4341 echo " $shellfunc" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4342 echo ' fi' |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4343 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4344 echo " $shellfunc" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4345 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4346 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4347 # The autoconf code for $dep has already been emitted above and |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4348 # therefore is already executed when this code is run. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4349 : |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4350 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4351 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4352 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4353 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4354 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4355 # Define the Automake conditionals. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4356 echo " m4_pattern_allow([^${macro_prefix}_GNULIB_ENABLED_])" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4357 for module in $1; do |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4358 eval $verifier |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4359 if test -n "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4360 if func_cond_module_p "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4361 func_module_conditional_name "$module" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4362 func_module_shellvar_name "$module" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4363 echo " AM_CONDITIONAL([$conditional], [\$$shellvar])" |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4364 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4365 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4366 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4367 else |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4368 # Ignore the conditions, and enable all modules unconditionally. |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4369 for module in $1; do |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4370 eval $verifier |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4371 if test -n "$module"; then |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4372 func_emit_autoconf_snippet " " |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4373 fi |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4374 done |
af0bb23f406a
Support for conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
14672
diff
changeset
|
4375 fi |
14669
7d7930e97930
gnulib-tool: Reduce code duplication.
Bruno Haible <bruno@clisp.org>
parents:
14625
diff
changeset
|
4376 } |
7d7930e97930
gnulib-tool: Reduce code duplication.
Bruno Haible <bruno@clisp.org>
parents:
14625
diff
changeset
|
4377 |
18124
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4378 # func_emit_pre_early_macros require indentation modules |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4379 # The require parameter can be ':' (AC_REQUIRE) or 'false' (direct call). |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4380 func_emit_pre_early_macros () |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4381 { |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4382 echo |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4383 echo "${2}# Pre-early section." |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4384 if $1; then |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4385 _pre_early_snippet="echo \"${2}AC_REQUIRE([\$_pre_early_macro])\"" |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4386 else |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4387 _pre_early_snippet="echo \"${2}\$_pre_early_macro\"" |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4388 fi |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4389 |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4390 # We need to call gl_USE_SYSTEM_EXTENSIONS before gl_PROG_AR_RANLIB. Doing |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4391 # AC_REQUIRE in configure-ac.early is not early enough. |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4392 _pre_early_macro="gl_USE_SYSTEM_EXTENSIONS" |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4393 case "${nl}${3}${nl}" in |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4394 *${nl}extensions${nl}*) eval "$_pre_early_snippet" ;; |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4395 esac |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4396 |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4397 _pre_early_macro="gl_PROG_AR_RANLIB" |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4398 eval "$_pre_early_snippet" |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4399 echo |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4400 } |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4401 |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4402 # func_reconstruct_cached_dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4403 # callback for func_reconstruct_cached_local_gnulib_path |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4404 # Input: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4405 # - destdir from --dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4406 # Output: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4407 # - local_gnulib_path restored '--local-dir' path from cache |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4408 func_reconstruct_cached_dir () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4409 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4410 cached_dir=$1 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4411 if test -n "$cached_dir"; then |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4412 case "$destdir" in |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4413 /*) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4414 func_path_append local_gnulib_path "$destdir/$cached_dir" ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4415 *) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4416 case "$cached_dir" in |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4417 /*) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4418 func_path_append local_gnulib_path "$destdir/$cached_dir" ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4419 *) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4420 func_relconcat "$destdir" "$cached_dir" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4421 func_path_append local_gnulib_path "$relconcat" ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4422 esac ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4423 esac |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4424 fi |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4425 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4426 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4427 # func_reconstruct_cached_local_gnulib_path |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4428 # reconstruct local_gnulib_path from cached_local_gnulib_path to be set |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4429 # relatively to $destdir again. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4430 # Input: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4431 # - cached_local_gnulib_path local_gnulib_path stored within gnulib-cache.m4 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4432 # - destdir from --dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4433 # Output: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4434 # - local_gnulib_path restored '--local-dir' path from cache |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4435 func_reconstruct_cached_local_gnulib_path () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4436 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4437 func_path_foreach "$cached_local_gnulib_path" func_reconstruct_cached_dir %dir% |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4438 } |
18124
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
4439 |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
4440 # func_import modules |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
4441 # Uses also the variables |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4442 # - mode import or add-import or remove-import or update |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
4443 # - destdir target directory |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4444 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
4445 # - 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
|
4446 # - 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
|
4447 # - 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
|
4448 # - 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
|
4449 # - 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
|
4450 # - 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
|
4451 # - 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
|
4452 # - 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
|
4453 # - 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
|
4454 # - auxdir directory relative to destdir where to place build aux files |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
4455 # - inctests true if --with-tests was given, false otherwise |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4456 # - 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
|
4457 # - 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
|
4458 # - 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
|
4459 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4460 # - 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
|
4461 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4462 # - 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
|
4463 # otherwise |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4464 # - inc_all_tests true if --with-all-tests was given, blank otherwise |
5981 | 4465 # - avoidlist list of modules to avoid, from --avoid |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4466 # - cond_dependencies true if --conditional-dependencies was given, false if |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4467 # --no-conditional-dependencies was given, blank otherwise |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4468 # - 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
|
4469 # blank otherwise |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4470 # - makefile_name from --makefile-name |
7077 | 4471 # - libtool true if --libtool was given, false if --no-libtool was |
4472 # given, blank otherwise | |
4473 # - guessed_libtool true if the configure.ac file uses libtool, false otherwise | |
6176 | 4474 # - 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
|
4475 # - po_domain prefix of i18n domain to use (without -gnulib suffix) |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4476 # - witness_c_macro from --witness-c-macro |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4477 # - 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
|
4478 # given, blank otherwise |
6994
3484a8772427
Add option --assume-autoconf. Default is back to 2.59.
Bruno Haible <bruno@clisp.org>
parents:
6993
diff
changeset
|
4479 # - autoconf_minversion minimum supported autoconf version |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
4480 # - doit : if actions shall be executed, false if only to be printed |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
4481 # - copymode copy mode for files in general |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
4482 # - lcopymode copy mode for files from local_gnulib_path |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
4483 # - 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
|
4484 # blank otherwise |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
4485 func_import () |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
4486 { |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4487 # Get the cached settings. |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4488 # In 'import' mode, we read them only for the purpose of knowing the old |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4489 # installed file list, and don't use them as defaults. |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4490 cached_local_gnulib_path= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4491 cached_specified_modules= |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4492 cached_incobsolete= |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4493 cached_inc_cxx_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4494 cached_inc_longrunning_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4495 cached_inc_privileged_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4496 cached_inc_unportable_tests= |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4497 cached_inc_all_tests= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4498 cached_avoidlist= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4499 cached_sourcebase= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4500 cached_m4base= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4501 cached_pobase= |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
4502 cached_docbase= |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4503 cached_testsbase= |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
4504 cached_inctests= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4505 cached_libname= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4506 cached_lgpl= |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4507 cached_makefile_name= |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4508 cached_cond_dependencies= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4509 cached_libtool= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4510 cached_macro_prefix= |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4511 cached_po_domain= |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4512 cached_witness_c_macro= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4513 cached_vc_files= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4514 cached_files= |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4515 if test -f "$destdir"/$m4base/gnulib-cache.m4; then |
7077 | 4516 cached_libtool=false |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4517 my_sed_traces=' |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4518 s,#.*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4519 s,^dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4520 s, dnl .*$,, |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4521 /gl_LOCAL_DIR(/ { |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4522 s,^.*gl_LOCAL_DIR([[ ]*\([^]"$`\\)]*\).*$,cached_local_gnulib_path="\1",p |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4523 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4524 /gl_MODULES(/ { |
10293
3c624b3d1039
Make a sed program more robust.
Bruno Haible <bruno@clisp.org>
parents:
10261
diff
changeset
|
4525 ta |
10246
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
4526 :a |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
4527 s/)/)/ |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
4528 tb |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
4529 N |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
4530 ba |
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
4531 :b |
10987 | 4532 s,^.*gl_MODULES([[ ]*\([^]"$`\\)]*\).*$,cached_specified_modules="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4533 } |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4534 /gl_WITH_OBSOLETE/ { |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4535 s,^.*$,cached_incobsolete=true,p |
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
4536 } |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4537 /gl_WITH_CXX_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4538 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
|
4539 } |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4540 /gl_WITH_LONGRUNNING_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4541 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
|
4542 } |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4543 /gl_WITH_PRIVILEGED_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4544 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
|
4545 } |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4546 /gl_WITH_UNPORTABLE_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4547 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
|
4548 } |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4549 /gl_WITH_ALL_TESTS/ { |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4550 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
|
4551 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4552 /gl_AVOID(/ { |
10987 | 4553 s,^.*gl_AVOID([[ ]*\([^]"$`\\)]*\).*$,cached_avoidlist="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4554 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4555 /gl_SOURCE_BASE(/ { |
10987 | 4556 s,^.*gl_SOURCE_BASE([[ ]*\([^]"$`\\)]*\).*$,cached_sourcebase="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4557 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4558 /gl_M4_BASE(/ { |
10987 | 4559 s,^.*gl_M4_BASE([[ ]*\([^]"$`\\)]*\).*$,cached_m4base="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4560 } |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4561 /gl_PO_BASE(/ { |
10987 | 4562 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
|
4563 } |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
4564 /gl_DOC_BASE(/ { |
10987 | 4565 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
|
4566 } |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
4567 /gl_TESTS_BASE(/ { |
10987 | 4568 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
|
4569 } |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
4570 /gl_WITH_TESTS/ { |
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
4571 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
|
4572 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4573 /gl_LIB(/ { |
10987 | 4574 s,^.*gl_LIB([[ ]*\([^]"$`\\)]*\).*$,cached_libname="\1",p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4575 } |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4576 /gl_LGPL(/ { |
10987 | 4577 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
|
4578 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4579 /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
|
4580 s,^.*$,cached_lgpl=yes,p |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4581 } |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4582 /gl_MAKEFILE_NAME(/ { |
10987 | 4583 s,^.*gl_MAKEFILE_NAME([[ ]*\([^]"$`\\)]*\).*$,cached_makefile_name="\1",p |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
4584 } |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4585 /gl_CONDITIONAL_DEPENDENCIES/ { |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4586 s,^.*$,cached_cond_dependencies=true,p |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4587 } |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4588 /gl_LIBTOOL/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4589 s,^.*$,cached_libtool=true,p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4590 } |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4591 /gl_MACRO_PREFIX(/ { |
10987 | 4592 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
|
4593 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
4594 /gl_PO_DOMAIN(/ { |
10987 | 4595 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
|
4596 } |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4597 /gl_WITNESS_C_MACRO(/ { |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4598 s,^.*gl_WITNESS_C_MACRO([[ ]*\([^]"$`\\)]*\).*$,cached_witness_c_macro="\1",p |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4599 } |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
4600 /gl_VC_FILES(/ { |
10987 | 4601 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
|
4602 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4603 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
|
4604 if test -f "$destdir"/$m4base/gnulib-comp.m4; then |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4605 my_sed_traces=' |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4606 s,#.*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4607 s,^dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4608 s, dnl .*$,, |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4609 /AC_DEFUN(\['"${cached_macro_prefix}"'_FILE_LIST\], \[/ { |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4610 s,^.*$,cached_files=",p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4611 n |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4612 ta |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4613 :a |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4614 s,^\]).*$,", |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4615 tb |
10987 | 4616 s,["$`\\],,g |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4617 p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4618 n |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4619 ba |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4620 :b |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4621 p |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4622 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
4623 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
|
4624 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4625 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4626 |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4627 if test "$mode" = import; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4628 # In 'import' mode, the new set of specified modules overrides the cached |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4629 # set of modules. Ignore the cached settings. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4630 specified_modules="$1" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4631 else |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4632 # Merge the cached settings with the specified ones. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4633 # The m4base must be the same as expected from the pathname. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4634 if test -n "$cached_m4base" && test "$cached_m4base" != "$m4base"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4635 func_fatal_error "$m4base/gnulib-cache.m4 is expected to contain gl_M4_BASE([$m4base])" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4636 fi |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4637 # The local_gnulib_path defaults to the cached one. Recall that the cached one |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4638 # is relative to $destdir, whereas the one we use is relative to . or absolute. |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4639 if test -z "$local_gnulib_path"; then |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
4640 func_reconstruct_cached_local_gnulib_path |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4641 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4642 case $mode in |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4643 add-import) |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4644 # Append the cached and the specified module names. So that |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4645 # "gnulib-tool --add-import foo" means to add the module foo. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4646 specified_modules="$cached_specified_modules $1" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4647 ;; |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4648 remove-import) |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4649 # Take the cached module names, minus the specified module names. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4650 specified_modules= |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4651 if $have_associative; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4652 # Use an associative array, for O(N) worst-case run time. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4653 declare -A to_remove |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4654 for m in $1; do |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
4655 eval 'to_remove[$m]=yes' |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4656 done |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4657 for module in $cached_specified_modules; do |
13660
6a2c7d3ca5f0
gnulib-tool: work with NetBSD /bin/sh
Eric Blake <eblake@redhat.com>
parents:
13658
diff
changeset
|
4658 if eval 'test -z "${to_remove[$module]}"'; then |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4659 func_append specified_modules "$module " |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4660 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4661 done |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4662 else |
18109
244355088b86
maint: add coding cookies to non-ASCII sources
Paul Eggert <eggert@cs.ucla.edu>
parents:
18080
diff
changeset
|
4663 # This loop has O(N**2) worst-case run time. |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4664 for module in $cached_specified_modules; do |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4665 to_remove= |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4666 for m in $1; do |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4667 if test "$m" = "$module"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4668 to_remove=yes |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4669 break |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4670 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4671 done |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4672 if test -z "$to_remove"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4673 func_append specified_modules "$module " |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4674 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4675 done |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4676 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4677 ;; |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4678 update) |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4679 # Take the cached module names. There are no specified module names. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4680 specified_modules="$cached_specified_modules" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4681 ;; |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4682 esac |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4683 # Included obsolete modules among the dependencies if specified either way. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4684 if test -z "$incobsolete"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4685 incobsolete="$cached_incobsolete" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4686 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4687 # Included special kinds of tests modules among the dependencies if specified |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4688 # either way. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4689 if test -z "$inc_cxx_tests"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4690 inc_cxx_tests="$cached_inc_cxx_tests" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4691 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4692 if test -z "$inc_longrunning_tests"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4693 inc_longrunning_tests="$cached_inc_longrunning_tests" |
7213
0f2957c42e86
Save the --local-dir value in the cache file.
Bruno Haible <bruno@clisp.org>
parents:
7212
diff
changeset
|
4694 fi |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4695 if test -z "$inc_privileged_tests"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4696 inc_privileged_tests="$cached_inc_privileged_tests" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4697 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4698 if test -z "$inc_unportable_tests"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4699 inc_unportable_tests="$cached_inc_unportable_tests" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4700 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4701 if test -z "$inc_all_tests"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4702 inc_all_tests="$cached_inc_all_tests" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4703 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4704 # Append the cached and the specified avoidlist. This is probably better |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4705 # than dropping the cached one when --avoid is specified at least once. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4706 avoidlist=`for m in $cached_avoidlist $avoidlist; do echo $m; done | LC_ALL=C sort -u` |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4707 avoidlist=`echo $avoidlist` |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4708 |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4709 # The sourcebase defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4710 if test -z "$sourcebase"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4711 sourcebase="$cached_sourcebase" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4712 if test -z "$sourcebase"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4713 func_fatal_error "missing --source-base option" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4714 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4715 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4716 # The pobase defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4717 if test -z "$pobase"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4718 pobase="$cached_pobase" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4719 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4720 # The docbase defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4721 if test -z "$docbase"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4722 docbase="$cached_docbase" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4723 if test -z "$docbase"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4724 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." |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4725 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4726 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4727 # The testsbase defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4728 if test -z "$testsbase"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4729 testsbase="$cached_testsbase" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4730 if test -z "$testsbase"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4731 func_fatal_error "missing --tests-base option" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4732 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4733 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4734 # Require the tests if specified either way. |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
4735 if ! $inctests; then |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4736 inctests="$cached_inctests" |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
4737 if test -z "$inctests"; then |
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
4738 inctests=false |
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
4739 fi |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4740 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4741 # The libname defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4742 if test -z "$supplied_libname"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4743 libname="$cached_libname" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4744 if test -z "$libname"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4745 func_fatal_error "missing --lib option" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4746 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4747 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4748 # Require LGPL if specified either way. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4749 if test -z "$lgpl"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4750 lgpl="$cached_lgpl" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4751 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4752 # The makefile_name defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4753 if test -z "$makefile_name"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4754 makefile_name="$cached_makefile_name" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4755 fi |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4756 # Use conditional dependencies if specified either way. |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4757 if test -z "$cond_dependencies"; then |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4758 cond_dependencies="$cached_cond_dependencies" |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4759 fi |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4760 # Use libtool if specified either way, or if guessed. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4761 if test -z "$libtool"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4762 if test -n "$cached_m4base"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4763 libtool="$cached_libtool" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4764 else |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4765 libtool="$guessed_libtool" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4766 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4767 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4768 # The macro_prefix defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4769 if test -z "$macro_prefix"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4770 macro_prefix="$cached_macro_prefix" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4771 if test -z "$macro_prefix"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4772 func_fatal_error "missing --macro-prefix option" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4773 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4774 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4775 # The po_domain defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4776 if test -z "$po_domain"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4777 po_domain="$cached_po_domain" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4778 fi |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4779 # The witness_c_macro defaults to the cached one. |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4780 if test -z "$witness_c_macro"; then |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4781 witness_c_macro="$cached_witness_c_macro" |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
4782 fi |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4783 # The vc_files defaults to the cached one. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4784 if test -z "$vc_files"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4785 vc_files="$cached_vc_files" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
4786 fi |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4787 # Ensure constraints. |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
4788 if test "$cond_dependencies" = true && $inctests; then |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4789 echo "gnulib-tool: option --conditional-dependencies is not supported with --with-tests" 1>&2 |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4790 func_exit 1 |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
4791 fi |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
4792 fi |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4793 # --without-*-tests options are not supported here. |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4794 excl_cxx_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4795 excl_longrunning_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4796 excl_privileged_tests= |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
4797 excl_unportable_tests= |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4798 |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4799 # Canonicalize the list of specified modules. |
7319
1726cc39709b
Use "sort -u" where it makes sense.
Bruno Haible <bruno@clisp.org>
parents:
7299
diff
changeset
|
4800 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
|
4801 |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
4802 # 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
|
4803 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
|
4804 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
|
4805 |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
4806 # Determine final module list. |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4807 modules="$specified_modules" |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
4808 func_modules_transitive_closure |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4809 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
|
4810 func_show_module_list |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
4811 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
|
4812 final_modules="$modules" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4813 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4814 # Determine main module list and tests-related module list separately. |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
4815 func_modules_transitive_closure_separately |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4816 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4817 # Determine whether a $testsbase/libtests.a is needed. |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
4818 func_determine_use_libtests |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
4819 |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
4820 # Add the dummy module to the main module list or to the tests-related module |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
4821 # list if needed. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
4822 func_modules_add_dummy_separately |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
4823 |
7235
3dbbe645b976
* MODULES.html.sh (Support for building documentation): Add gpl, lgpl.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7222
diff
changeset
|
4824 # 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
|
4825 if test -n "$lgpl"; then |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
4826 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
|
4827 for module in $main_modules; do |
5346 | 4828 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
|
4829 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
|
4830 'GPLed build tool') ;; |
7245 | 4831 '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
|
4832 *) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4833 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
|
4834 yes | 3) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4835 case $license in |
18501
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
4836 LGPLv2+ | 'LGPLv3+ or GPLv2' | LGPLv3+ | LGPL) ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
4837 *) func_append license_incompatibilities "$module $license$nl" ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
4838 esac |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
4839 ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
4840 3orGPLv2) |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
4841 case $license in |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
4842 LGPLv2+ | 'LGPLv3+ or GPLv2') ;; |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
4843 *) 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
|
4844 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4845 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4846 2) |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4847 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
|
4848 LGPLv2+) ;; |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
4849 *) 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
|
4850 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4851 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4852 *) 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
|
4853 esac |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4854 ;; |
5963
6fb8c48c4dcd
* gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
4855 esac |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4856 done |
10479
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
4857 if test -n "$license_incompatibilities"; then |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
4858 # Format the license incompatibilities as a table. |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
4859 sed_expand_column1_width50_indent17='s,^\([^ ]*\) ,\1 , |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
4860 s,^\(.................................................[^ ]*\) *, \1 ,' |
74885eaea206
Report all license incompatibilities during --import.
Bruno Haible <bruno@clisp.org>
parents:
10478
diff
changeset
|
4861 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
|
4862 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
|
4863 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4864 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4865 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4866 # 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
|
4867 modules="$main_modules" |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4868 func_modules_notice |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
4869 |
7199
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
4870 # 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
|
4871 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
|
4872 for module in $main_modules; do |
7245 | 4873 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
|
4874 # 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
|
4875 sed_transform_lib_file=$sed_transform_lib_file' |
7245 | 4876 s/^#ifdef[ ]*HAVE_CONFIG_H[ ]*$/#if 1/ |
4877 ' | |
4878 break | |
4879 fi | |
4880 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
|
4881 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
|
4882 if test -n "$do_copyrights"; then |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
4883 if test -n "$lgpl"; then |
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
4884 # 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
|
4885 case "$lgpl" in |
18542
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4886 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
|
4887 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
|
4888 s/GNU General/GNU Lesser General/g |
14323
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4889 s/General Public License/Lesser General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4890 s/Lesser Lesser General Public License/Lesser General Public License/g |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4891 ' |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4892 ;; |
18542
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4893 3orGPLv2) |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4894 sed_transform_main_lib_file=$sed_transform_main_lib_file' |
18544
38ff2272f689
gnulib-tool: fix the previous change
Daiki Ueno <ueno@gnu.org>
parents:
18543
diff
changeset
|
4895 /^ *This program is free software/i\ |
38ff2272f689
gnulib-tool: fix the previous change
Daiki Ueno <ueno@gnu.org>
parents:
18543
diff
changeset
|
4896 This program is free software: you can redistribute it and\/or\ |
38ff2272f689
gnulib-tool: fix the previous change
Daiki Ueno <ueno@gnu.org>
parents:
18543
diff
changeset
|
4897 modify it under the terms of either:\ |
18542
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4898 \ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4899 * the GNU Lesser General Public License as published by the Free\ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4900 Software Foundation; either version 3 of the License, or (at your\ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4901 option) any later version.\ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4902 \ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4903 or\ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4904 \ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4905 * the GNU General Public License as published by the Free\ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4906 Software Foundation; either version 2 of the License, or (at your\ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4907 option) any later version.\ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4908 \ |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4909 or both in parallel, as here. |
18544
38ff2272f689
gnulib-tool: fix the previous change
Daiki Ueno <ueno@gnu.org>
parents:
18543
diff
changeset
|
4910 /^ *This program is free software/,/^$/d |
18542
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4911 ' |
017f1e6e1dd1
gnulib-tool: properly list the LGPL3orGPLv2 license
Nikos Mavrogiannopoulos <nmav@gnutls.org>
parents:
18501
diff
changeset
|
4912 ;; |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4913 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
|
4914 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
|
4915 s/GNU General/GNU Lesser General/g |
14323
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4916 s/General Public License/Lesser General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4917 s/Lesser Lesser General Public License/Lesser General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4918 |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4919 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
|
4920 ' |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4921 ;; |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
4922 *) 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
|
4923 esac |
9424
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
4924 else |
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
4925 # 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
|
4926 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
|
4927 s/GNU Lesser General/GNU General/g |
14323
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4928 s/Lesser General Public License/General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4929 |
9424
d852c1c185e4
If --lgpl is not specified, convert copyright headers to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
9417
diff
changeset
|
4930 s/GNU Library General/GNU General/g |
14323
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4931 s/Library General Public License/General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4932 |
11592
345504ca672e
gnulib-tool: Don't use non-POSIX regexps.
Simon Josefsson <simon@josefsson.org>
parents:
11560
diff
changeset
|
4933 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
|
4934 ' |
9096
7f1880b27b89
New gnulib-tool option --more-symlinks.
Bruno Haible <bruno@clisp.org>
parents:
9090
diff
changeset
|
4935 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
|
4936 fi |
85ef7b18536b
New config-h module, so that "make" output needn't be cluttered
Paul Eggert <eggert@cs.ucla.edu>
parents:
7195
diff
changeset
|
4937 |
11594
36af7f748bb9
Don't do HAVE_CONFIG_H replacements on build-aux/ files.
Bruno Haible <bruno@clisp.org>
parents:
11593
diff
changeset
|
4938 # 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
|
4939 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
|
4940 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
|
4941 # Update license. |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
4942 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
|
4943 s/GNU Lesser General/GNU General/g |
14323
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4944 s/Lesser General Public License/General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4945 |
11593
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
4946 s/GNU Library General/GNU General/g |
14323
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4947 s/Library General Public License/General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4948 |
11593
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
4949 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
|
4950 ' |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
4951 fi |
476a58fbc9b9
gnulib-tool: Transform license on build-aux/ files too.
Simon Josefsson <simon@josefsson.org>
parents:
11592
diff
changeset
|
4952 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4953 # 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
|
4954 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
|
4955 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
|
4956 # 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
|
4957 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
|
4958 s/GNU Lesser General/GNU General/g |
14323
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4959 s/Lesser General Public License/General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4960 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4961 s/GNU Library General/GNU General/g |
14323
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4962 s/Library General Public License/General Public License/g |
c1410c31aa51
gnulib-tool: Make copyright notice adjustment more robust.
Bruno Haible <bruno@clisp.org>
parents:
14273
diff
changeset
|
4963 |
11592
345504ca672e
gnulib-tool: Don't use non-POSIX regexps.
Simon Josefsson <simon@josefsson.org>
parents:
11560
diff
changeset
|
4964 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
|
4965 ' |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4966 fi |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4967 |
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
4968 # Determine the final file lists. |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
4969 func_modules_to_filelist_separately |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4970 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4971 test -n "$files" \ |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
4972 || 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
|
4973 |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4974 # 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
|
4975 new_files="$files m4/gnulib-tool.m4" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4976 old_files="$cached_files" |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4977 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
|
4978 func_append old_files " m4/gnulib-tool.m4" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4979 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
4980 |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4981 rewritten='%REWRITTEN%' |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4982 sed_rewrite_old_files="\ |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4983 s,^build-aux/,$rewritten$auxdir/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4984 s,^doc/,$rewritten$cached_docbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4985 s,^lib/,$rewritten$cached_sourcebase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4986 s,^m4/,$rewritten$cached_m4base/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4987 s,^tests/,$rewritten$cached_testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4988 s,^tests=lib/,$rewritten$cached_testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4989 s,^top/,$rewritten, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4990 s,^$rewritten,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
4991 sed_rewrite_new_files="\ |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4992 s,^build-aux/,$rewritten$auxdir/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4993 s,^doc/,$rewritten$docbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4994 s,^lib/,$rewritten$sourcebase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4995 s,^m4/,$rewritten$m4base/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4996 s,^tests/,$rewritten$testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4997 s,^tests=lib/,$rewritten$testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4998 s,^top/,$rewritten, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
4999 s,^$rewritten,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5000 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5001 # Create directories. |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5002 { echo "$sourcebase" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5003 echo "$m4base" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5004 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5005 echo "$pobase" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5006 fi |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5007 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
|
5008 if test -n "$docfiles"; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5009 echo "$docbase" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5010 fi |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5011 if $inctests; then |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5012 echo "$testsbase" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
5013 fi |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5014 echo "$auxdir" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5015 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
|
5016 | sed -e "$sed_rewrite_new_files" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5017 | sed -n -e 's,^\(.*\)/[^/]*,\1,p' \ |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5018 | LC_ALL=C sort -u |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5019 } > "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5020 { # Rearrange file descriptors. Needed because "while ... done < ..." |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5021 # 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
|
5022 exec 5<&0 < "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5023 while read d; do |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5024 if test ! -d "$destdir/$d"; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5025 if $doit; then |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5026 echo "Creating directory $destdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5027 mkdir -p "$destdir/$d" || func_fatal_error "failed" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5028 else |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5029 echo "Create directory $destdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5030 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5031 fi |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5032 done |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5033 exec 0<&5 5<&- |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
5034 } |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
5035 |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
5036 # Copy files or make symbolic links or hard links. Remove obsolete files. |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5037 added_files='' |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5038 removed_files='' |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5039 delimiter=' ' |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5040 # 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
|
5041 # 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
|
5042 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
|
5043 | 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
|
5044 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5045 > "$tmp"/old-files |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5046 # 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
|
5047 # representing the files after this gnulib-tool invocation. |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5048 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
|
5049 | 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
|
5050 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5051 > "$tmp"/new-files |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5052 # 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
|
5053 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
|
5054 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
|
5055 # 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
|
5056 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
|
5057 if $doit; then |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5058 echo "Removing file $g (backup in ${g}~)" |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5059 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
|
5060 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5061 echo "Remove file $g (backup in ${g}~)" |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5062 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5063 func_append removed_files "$g$nl" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5064 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5065 done |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5066 # 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
|
5067 # Uses parameters |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5068 # - f the original file name |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5069 # - g the rewritten file name |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5070 # - 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
|
5071 # otherwise |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5072 func_add_or_update () |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5073 { |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
5074 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
|
5075 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
|
5076 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
|
5077 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
|
5078 func_dest_tmpfilename "$g" |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
5079 func_lookup_file "$f" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
5080 cp "$lookedup_file" "$tmpfile" || func_fatal_error "failed" |
19141
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5081 case "$f" in |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5082 *.class | *.mo ) |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5083 # Don't process binary files with sed. |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5084 ;; |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5085 *) |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5086 if test -n "$sed_transform_main_lib_file"; then |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5087 case "$of" in |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5088 lib/*) |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5089 sed -e "$sed_transform_main_lib_file" \ |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5090 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed" |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5091 ;; |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5092 esac |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5093 fi |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5094 if test -n "$sed_transform_build_aux_file"; then |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5095 case "$of" in |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5096 build-aux/*) |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5097 sed -e "$sed_transform_build_aux_file" \ |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5098 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed" |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5099 ;; |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5100 esac |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5101 fi |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5102 if test -n "$sed_transform_testsrelated_lib_file"; then |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5103 case "$of" in |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5104 tests=lib/*) |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5105 sed -e "$sed_transform_testsrelated_lib_file" \ |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5106 < "$lookedup_file" > "$tmpfile" || func_fatal_error "failed" |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5107 ;; |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5108 esac |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5109 fi |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5110 ;; |
6d737cdd7618
gnulib-tool: Simplify commit from 2015-08-20.
Bruno Haible <bruno@clisp.org>
parents:
18959
diff
changeset
|
5111 esac |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5112 if test -f "$destdir/$g"; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5113 # The file already exists. |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5114 func_update_file |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5115 else |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5116 # Install the file. |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5117 # Don't protest if the file should be there but isn't: it happens |
13636
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
5118 # frequently that developers don't put autogenerated files under version control. |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
5119 func_add_file |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5120 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
|
5121 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
|
5122 rm -f "$tmpfile" |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5123 } |
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5124 # 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
|
5125 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
|
5126 already_present= |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5127 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
|
5128 | sed -e "$sed_take_last_column" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5129 | 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
|
5130 { # 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
|
5131 # 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
|
5132 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
|
5133 while read g f; do |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
5134 func_add_or_update |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
5135 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
5136 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
5137 } |
6245
07b16a28510d
Speed up the matching of new and old files.
Bruno Haible <bruno@clisp.org>
parents:
6213
diff
changeset
|
5138 # 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
|
5139 already_present=true |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
5140 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
|
5141 | sed -e "$sed_take_last_column" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5142 | 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
|
5143 { # 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
|
5144 # 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
|
5145 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
|
5146 while read g f; do |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
5147 func_add_or_update |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
5148 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
5149 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
5150 } |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5151 |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5152 # Command-line invocation printed in a comment in generated gnulib-cache.m4. |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5153 actioncmd="# gnulib-tool --import" |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5154 |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5155 # Local helper. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5156 func_append_local_dir () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5157 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5158 func_append "$1" " --local-dir=$2" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5159 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5160 func_path_foreach "$local_gnulib_path" func_append_local_dir actioncmd %dir% |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5161 |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5162 # Break the action command log into multiple lines. |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5163 # Emacs puts some gnulib-tool log lines in its source repository, and |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5164 # git send-email rejects patch lines longer than 998 characters. |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5165 # Also, config.status uses awk, and the HP-UX 11.00 awk fails if a |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5166 # line has length >= 3071; similarly, the IRIX 6.5 awk fails if a |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5167 # line has length >= 3072. |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5168 func_append_actionarg () |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5169 { |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5170 func_append actioncmd " \\$nl# $1" |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5171 } |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5172 func_append_actionarg "--lib=$libname" |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5173 func_append_actionarg "--source-base=$sourcebase" |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5174 func_append_actionarg "--m4-base=$m4base" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5175 if test -n "$pobase"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5176 func_append_actionarg "--po-base=$pobase" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5177 fi |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5178 func_append_actionarg "--doc-base=$docbase" |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5179 func_append_actionarg "--tests-base=$testsbase" |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5180 func_append_actionarg "--aux-dir=$auxdir" |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5181 if $inctests; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5182 func_append_actionarg "--with-tests" |
8890
576d3e4f31c2
Remember the presence of the --with-tests command-line option through
Bruno Haible <bruno@clisp.org>
parents:
8672
diff
changeset
|
5183 fi |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
5184 if test -n "$incobsolete"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5185 func_append_actionarg "--with-obsolete" |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
5186 fi |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5187 if test -n "$inc_cxx_tests"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5188 func_append_actionarg "--with-c++-tests" |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5189 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5190 if test -n "$inc_longrunning_tests"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5191 func_append_actionarg "--with-longrunning-tests" |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5192 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5193 if test -n "$inc_privileged_tests"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5194 func_append_actionarg "--with-privileged-tests" |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5195 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5196 if test -n "$inc_unportable_tests"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5197 func_append_actionarg "--with-unportable-tests" |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5198 fi |
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5199 if test -n "$inc_all_tests"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5200 func_append_actionarg "--with-all-tests" |
13080
fad0b62b5bf5
gnulib-tool: Add support for special categories of tests.
Bruno Haible <bruno@clisp.org>
parents:
13070
diff
changeset
|
5201 fi |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5202 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
|
5203 if test "$lgpl" = yes; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5204 func_append_actionarg "--lgpl" |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
5205 else |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5206 func_append_actionarg "--lgpl=$lgpl" |
9417
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
5207 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5208 fi |
18732
691ee9363949
gnulib-tool: fix typo in comment output
Paul Eggert <eggert@cs.ucla.edu>
parents:
18730
diff
changeset
|
5209 if $gnu_make; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5210 func_append_actionarg "--gnu-make" |
18730
5ce4a5b6d112
gnulib-tool: minor --gnu-make fixups
Paul Eggert <eggert@cs.ucla.edu>
parents:
18729
diff
changeset
|
5211 fi |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5212 if test -n "$makefile_name"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5213 func_append_actionarg "--makefile-name=$makefile_name" |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5214 fi |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
5215 if test "$cond_dependencies" = true; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5216 func_append_actionarg "--conditional-dependencies" |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
5217 else |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5218 func_append_actionarg "--no-conditional-dependencies" |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
5219 fi |
7077 | 5220 if test "$libtool" = true; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5221 func_append_actionarg "--libtool" |
7077 | 5222 else |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5223 func_append_actionarg "--no-libtool" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5224 fi |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5225 func_append_actionarg "--macro-prefix=$macro_prefix" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5226 if test -n "$po_domain"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5227 func_append_actionarg "--po-domain=$po_domain" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5228 fi |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
5229 if test -n "$witness_c_macro"; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5230 func_append_actionarg "--witness-c-macro=$witness_c_macro" |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
5231 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5232 if test -n "$vc_files"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5233 if test "$vc_files" = true; then |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5234 func_append_actionarg "--vc-files" |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5235 else |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5236 func_append_actionarg "--no-vc-files" |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5237 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5238 fi |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5239 for module in $avoidlist; do |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5240 func_append_actionarg "--avoid=$module" |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5241 done |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5242 for module in $specified_modules; do |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5243 func_append_actionarg "$module" |
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5244 done |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5245 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
5246 # Determine include_guard_prefix. |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
5247 func_compute_include_guard_prefix |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
5248 |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
5249 # 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
|
5250 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
|
5251 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
|
5252 else |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
5253 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
|
5254 fi |
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
5255 |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
5256 # 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
|
5257 for_test=false |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
5258 |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5259 # 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
|
5260 # 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
|
5261 # 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
|
5262 makefile_am_edits=0 |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
5263 # func_note_Makefile_am_edit dir var value [dotfirst] |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5264 # 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
|
5265 # ${value}. |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
5266 # If ${dotfirst} is non-empty, this mention needs to be present after '.'. |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
5267 # This is a special hack for the SUBDIRS variable, cf. |
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
5268 # <https://www.gnu.org/software/automake/manual/html_node/Subdirectories.html>. |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5269 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
|
5270 { |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5271 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
|
5272 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
|
5273 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
|
5274 eval makefile_am_edit${makefile_am_edits}_val=\"\$3\" |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
5275 eval makefile_am_edit${makefile_am_edits}_dotfirst=\"\$4\" |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5276 } |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5277 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
|
5278 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
|
5279 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
|
5280 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
|
5281 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5282 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
|
5283 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
|
5284 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
|
5285 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
|
5286 fi |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5287 if $inctests; 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
|
5288 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
|
5289 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
|
5290 testsbase_base=`basename "$testsbase"` |
39815
35efeabe809f
gnulib-tool: Fix build order when $testsbase is a subdir of $sourcebase.
Bruno Haible <bruno@clisp.org>
parents:
39755
diff
changeset
|
5291 func_note_Makefile_am_edit "$testsbase_dir" SUBDIRS "$testsbase_base" true |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5292 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5293 fi |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5294 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
|
5295 { |
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
|
5296 # 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
|
5297 # 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
|
5298 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
|
5299 s,//*$,/,' |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5300 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
|
5301 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
|
5302 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
|
5303 && ! { 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
|
5304 || 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
|
5305 || test "./${dir1}Makefile.am" = "$sourcebase/$makefile_am" \ |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5306 || { $inctests \ |
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
|
5307 && { 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
|
5308 || 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
|
5309 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
|
5310 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
|
5311 done |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5312 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
|
5313 } |
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
5314 |
7222
06eec4eaf416
* gnulib-tool (emit_lib_Makefile_am): Don't put $makefile_name
Paul Eggert <eggert@cs.ucla.edu>
parents:
7216
diff
changeset
|
5315 # Create library makefile. |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5316 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
|
5317 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
|
5318 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
|
5319 func_emit_lib_Makefile_am > "$tmpfile" |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5320 if test -f "$destdir"/$sourcebase/$makefile_am; then |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
5321 if cmp -s "$destdir"/$sourcebase/$makefile_am "$tmpfile"; 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
|
5322 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5323 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5324 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5325 echo "Updating $sourcebase/$makefile_am (backup in $sourcebase/$makefile_am~)" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5326 mv -f "$destdir"/$sourcebase/$makefile_am "$destdir"/$sourcebase/$makefile_am~ |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5327 mv -f "$tmpfile" "$destdir"/$sourcebase/$makefile_am |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5328 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5329 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
|
5330 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5331 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5332 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5333 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5334 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5335 echo "Creating $sourcebase/$makefile_am" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5336 mv -f "$tmpfile" "$destdir"/$sourcebase/$makefile_am |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5337 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5338 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
|
5339 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5340 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5341 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
|
5342 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5343 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5344 # Create po/ directory. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5345 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5346 # Create po makefile and auxiliary files. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5347 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
|
5348 func_dest_tmpfilename $pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5349 func_lookup_file build-aux/po/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5350 cat "$lookedup_file" > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5351 if test -f "$destdir"/$pobase/$file; then |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
5352 if cmp -s "$destdir"/$pobase/$file "$tmpfile"; then |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5353 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5354 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5355 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5356 echo "Updating $pobase/$file (backup in $pobase/$file~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5357 mv -f "$destdir"/$pobase/$file "$destdir"/$pobase/$file~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5358 mv -f "$tmpfile" "$destdir"/$pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5359 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5360 echo "Update $pobase/$file (backup in $pobase/$file~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5361 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5362 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5363 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5364 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5365 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5366 echo "Creating $pobase/$file" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5367 mv -f "$tmpfile" "$destdir"/$pobase/$file |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5368 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5369 echo "Create $pobase/$file" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5370 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5371 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5372 func_append added_files "$pobase/$file$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5373 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5374 done |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
5375 # Create po makefile parameterization, part 1. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5376 func_dest_tmpfilename $pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5377 func_emit_po_Makevars > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5378 if test -f "$destdir"/$pobase/Makevars; then |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
5379 if cmp -s "$destdir"/$pobase/Makevars "$tmpfile"; then |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5380 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5381 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5382 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5383 echo "Updating $pobase/Makevars (backup in $pobase/Makevars~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5384 mv -f "$destdir"/$pobase/Makevars "$destdir"/$pobase/Makevars~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5385 mv -f "$tmpfile" "$destdir"/$pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5386 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5387 echo "Update $pobase/Makevars (backup in $pobase/Makevars~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5388 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5389 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5390 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5391 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5392 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5393 echo "Creating $pobase/Makevars" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5394 mv -f "$tmpfile" "$destdir"/$pobase/Makevars |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5395 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5396 echo "Create $pobase/Makevars" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5397 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5398 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5399 func_append added_files "$pobase/Makevars$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5400 fi |
10065
e1449fcc7ecb
* gnulib-tool: Fix various comment typos.
Eric Blake <ebb9@byu.net>
parents:
9887
diff
changeset
|
5401 # Create po makefile parameterization, part 2. |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5402 func_dest_tmpfilename $pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5403 func_emit_po_POTFILES_in > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5404 if test -f "$destdir"/$pobase/POTFILES.in; then |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
5405 if cmp -s "$destdir"/$pobase/POTFILES.in "$tmpfile"; then |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5406 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5407 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5408 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5409 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
|
5410 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
|
5411 mv -f "$tmpfile" "$destdir"/$pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5412 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5413 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
|
5414 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5415 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5416 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5417 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5418 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5419 echo "Creating $pobase/POTFILES.in" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5420 mv -f "$tmpfile" "$destdir"/$pobase/POTFILES.in |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5421 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5422 echo "Create $pobase/POTFILES.in" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5423 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5424 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5425 func_append added_files "$pobase/POTFILES.in$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5426 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5427 # Fetch PO files. |
19192
d86e08b1f555
all: Replace many more http URLs by https URLs. Update stale URLs.
Bruno Haible <bruno@clisp.org>
parents:
19190
diff
changeset
|
5428 TP_URL="https://translationproject.org/latest/" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5429 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5430 echo "Fetching gnulib PO files from $TP_URL" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5431 (cd "$destdir"/$pobase \ |
39897
ac60f423d63b
bootstrap, gnulib-tool: use https instead of insecure rsync
Benno Schulenberg <bensberg@telfort.nl>
parents:
39895
diff
changeset
|
5432 && wget --no-verbose --mirror --level=1 -nd -A.po -P . "${TP_URL}gnulib/" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5433 ) |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5434 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5435 echo "Fetch gnulib PO files from $TP_URL" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5436 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5437 # Create po/LINGUAS. |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5438 if $doit; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5439 func_dest_tmpfilename $pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5440 (cd "$destdir"/$pobase \ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5441 && { echo '# Set of available languages.' |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5442 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
|
5443 } |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5444 ) > "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5445 if test -f "$destdir"/$pobase/LINGUAS; then |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
5446 if cmp -s "$destdir"/$pobase/LINGUAS "$tmpfile"; then |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5447 rm -f "$tmpfile" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5448 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5449 echo "Updating $pobase/LINGUAS (backup in $pobase/LINGUAS~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5450 mv -f "$destdir"/$pobase/LINGUAS "$destdir"/$pobase/LINGUAS~ |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5451 mv -f "$tmpfile" "$destdir"/$pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5452 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5453 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5454 echo "Creating $pobase/LINGUAS" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5455 mv -f "$tmpfile" "$destdir"/$pobase/LINGUAS |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5456 func_append added_files "$pobase/LINGUAS$nl" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5457 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5458 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5459 if test -f "$destdir"/$pobase/LINGUAS; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5460 echo "Update $pobase/LINGUAS (backup in $pobase/LINGUAS~)" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5461 else |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5462 echo "Create $pobase/LINGUAS" |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5463 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5464 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5465 fi |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5466 |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5467 # func_count_relative_local_gnulib_path |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5468 # gl_LOCAL_DIR requires local_gnulib_path to be set relatively to destdir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5469 # Input: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5470 # - local_gnulib_path from --local-dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5471 # - destdir from --dir |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5472 # Output: |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5473 # - relative_local_dir path to be stored into gl_LOCAL_DIR |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5474 func_count_relative_local_gnulib_path () |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5475 { |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5476 save_IFS=$IFS |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5477 IFS=$PATH_SEPARATOR |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5478 relative_local_gnulib_path= |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5479 for local_dir in $local_gnulib_path |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5480 do |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5481 # Store the local_dir relative to destdir. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5482 case "$local_dir" in |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5483 "" | /*) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5484 relative_local_dir="$local_dir" ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5485 * ) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5486 case "$destdir" in |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5487 /*) relative_local_dir="$local_dir" ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5488 *) |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5489 # destdir, local_dir are both relative. |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5490 func_relativize "$destdir" "$local_dir" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5491 relative_local_dir="$reldir" ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5492 esac ;; |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5493 esac |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5494 func_path_append relative_local_gnulib_path "$relative_local_dir" |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5495 done |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5496 IFS=$save_IFS |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5497 } |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5498 |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5499 # 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
|
5500 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
|
5501 ( |
6777
d9b10884dc69
* gnulib-tool (func_version): Base copyright year on CVS date.
Eric Blake <ebb9@byu.net>
parents:
6765
diff
changeset
|
5502 func_emit_copyright_notice |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5503 echo "#" |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5504 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
|
5505 echo "# It acts as a cache: It is written and read by gnulib-tool." |
13636
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
5506 echo "# In projects that use version control, this file is meant to be put under" |
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
5507 echo "# version control, like the configure.ac and various Makefile.am files." |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5508 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5509 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5510 echo "# Specification in the form of a command-line invocation:" |
39748
912cc79f4d91
gnulib-tool: limit line length for git send-email
Paul Eggert <eggert@cs.ucla.edu>
parents:
39737
diff
changeset
|
5511 printf '%s\n' "$actioncmd" |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5512 echo |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5513 echo "# Specification in the form of a few gnulib-tool.m4 macro invocations:" |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5514 func_count_relative_local_gnulib_path |
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5515 echo "gl_LOCAL_DIR([$relative_local_gnulib_path])" |
10246
50a9076d476d
Make gnulib-cache.m4 easier to diff.
Eric Blake <ebb9@byu.net>
parents:
10157
diff
changeset
|
5516 echo "gl_MODULES([" |
12417 | 5517 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
|
5518 echo "])" |
10744
7fb7b37150b3
New option --with-obsolete.
Bruno Haible <bruno@clisp.org>
parents:
10743
diff
changeset
|
5519 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
|
5520 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
|
5521 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
|
5522 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
|
5523 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
|
5524 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
|
5525 echo "gl_AVOID([$avoidlist])" |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5526 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
|
5527 echo "gl_M4_BASE([$m4base])" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5528 echo "gl_PO_BASE([$pobase])" |
6955
7715890c929a
* gnulib-tool: List --doc-base before --tests-base.
Eric Blake <ebb9@byu.net>
parents:
6952
diff
changeset
|
5529 echo "gl_DOC_BASE([$docbase])" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5530 echo "gl_TESTS_BASE([$testsbase])" |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5531 if $inctests; then |
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5532 echo "gl_WITH_TESTS" |
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5533 fi |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5534 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
|
5535 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
|
5536 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
|
5537 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
|
5538 else |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
5539 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
|
5540 fi |
95cbd64f5138
Allow specifying the LGPL version number through --lgpl=2 or --lgpl=3.
Bruno Haible <bruno@clisp.org>
parents:
9377
diff
changeset
|
5541 fi |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5542 echo "gl_MAKEFILE_NAME([$makefile_name])" |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
5543 if test "$cond_dependencies" = true; then |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
5544 echo "gl_CONDITIONAL_DEPENDENCIES" |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
5545 fi |
7077 | 5546 if test "$libtool" = true; then |
5547 echo "gl_LIBTOOL" | |
5548 fi | |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5549 echo "gl_MACRO_PREFIX([$macro_prefix])" |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5550 echo "gl_PO_DOMAIN([$po_domain])" |
17039
e5d33904a8b2
gnulib-tool: Fix persistence of --witness-c-macro option.
Bruno Haible <bruno@clisp.org>
parents:
17004
diff
changeset
|
5551 echo "gl_WITNESS_C_MACRO([$witness_c_macro])" |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5552 if test -n "$vc_files"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5553 echo "gl_VC_FILES([$vc_files])" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5554 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
|
5555 ) > "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5556 if test -f "$destdir"/$m4base/gnulib-cache.m4; then |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
5557 if cmp -s "$destdir"/$m4base/gnulib-cache.m4 "$tmpfile"; 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
|
5558 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5559 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5560 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5561 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
|
5562 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
|
5563 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
|
5564 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5565 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
|
5566 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
|
5567 cat "$tmpfile" |
6249
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
5568 echo |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
5569 echo "# gnulib-cache.m4 ends here" |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
5570 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
|
5571 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5572 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5573 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5574 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5575 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5576 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
|
5577 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
|
5578 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5579 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
|
5580 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
|
5581 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5582 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5583 fi |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5584 |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5585 # 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
|
5586 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
|
5587 ( |
7421
8bace4b08db5
Mark generated files as "DO NOT EDIT".
Bruno Haible <bruno@clisp.org>
parents:
7391
diff
changeset
|
5588 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
|
5589 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
|
5590 echo "#" |
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5591 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
|
5592 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
|
5593 echo "# to be invoked from configure.ac." |
13636
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
5594 echo "# In projects that use version control, this file can be treated like" |
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
5595 echo "# other built files." |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5596 echo |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5597 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
5598 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
|
5599 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
|
5600 echo "# any checks for libraries, header files, types and library functions." |
6176 | 5601 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
|
5602 echo "[" |
7105
641bac73140c
* gnulib-tool (func_import): Detect unexpanded macros in gnulib
Eric Blake <ebb9@byu.net>
parents:
7090
diff
changeset
|
5603 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
|
5604 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
|
5605 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
|
5606 echo " m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable" |
18114
e212f9b1ce05
gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
Pavel Raiskup <praiskup@redhat.com>
parents:
18109
diff
changeset
|
5607 |
18124
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
5608 func_emit_pre_early_macros : ' ' "$final_modules" |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
5609 |
18729
9534f71959d1
gnulib-tool: new option --gnu-make
Paul Eggert <eggert@cs.ucla.edu>
parents:
18704
diff
changeset
|
5610 if ! $gnu_make && test -n "$uses_subdirs"; then |
7641
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
5611 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
|
5612 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
|
5613 for module in $final_modules; do |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5614 func_verify_module |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5615 if test -n "$module"; then |
12983
39ddc4b73387
gnulib-tool (func_import): Explain origin of code.
Simon Josefsson <simon@josefsson.org>
parents:
12982
diff
changeset
|
5616 echo "# Code from module $module:" |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5617 func_get_autoconf_early_snippet "$module" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5618 fi |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5619 done \ |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
5620 | 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
|
5621 echo "])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5622 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
5623 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
|
5624 echo "# \"Check for header files, types and library functions\"." |
6176 | 5625 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
|
5626 echo "[" |
7077 | 5627 if test "$libtool" = true; then |
5628 echo " AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" | |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5629 echo " gl_cond_libtool=true" |
7077 | 5630 else |
6512 | 5631 echo " AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5632 echo " gl_cond_libtool=false" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5633 echo " gl_libdeps=" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5634 echo " gl_ltlibdeps=" |
6414
46d47c8fe734
* gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents:
6389
diff
changeset
|
5635 fi |
6556 | 5636 if test "$auxdir" != "build-aux"; then |
5637 sed_replace_build_aux=' | |
5638 :a | |
5639 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ | |
5640 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| | |
5641 ba | |
5642 }' | |
5643 else | |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
5644 sed_replace_build_aux="$sed_noop" |
6556 | 5645 fi |
13105
6d950d2ec11e
gnulib-tool: Provide the value of --m4-base to modules.
Bruno Haible <bruno@clisp.org>
parents:
13090
diff
changeset
|
5646 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
|
5647 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
|
5648 echo " gl_source_base='$sourcebase'" |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
5649 if test -n "$witness_c_macro"; then |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
5650 echo " m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$witness_c_macro])" |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
5651 fi |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
5652 func_emit_autoconf_snippets "$main_modules" "$main_modules" func_verify_module true false true |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
5653 if test -n "$witness_c_macro"; then |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
5654 echo " m4_popdef([gl_MODULE_INDICATOR_CONDITION])" |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
5655 fi |
12983
39ddc4b73387
gnulib-tool (func_import): Explain origin of code.
Simon Josefsson <simon@josefsson.org>
parents:
12982
diff
changeset
|
5656 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
|
5657 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
|
5658 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
|
5659 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
|
5660 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
|
5661 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
|
5662 # 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
|
5663 # PACKAGE is defined by AM_INIT_AUTOMAKE, PACKAGE_TARNAME is defined by AC_INIT. |
19439
8bfc20b57265
maint: shorten https://lists.gnu.org/archive/html/... links
Jim Meyering <meyering@fb.com>
parents:
19271
diff
changeset
|
5664 # See <https://lists.gnu.org/r/automake/2009-05/msg00145.html>. |
13089
a1999d4ef573
Fix definition of tests witness macro.
Bruno Haible <bruno@clisp.org>
parents:
13081
diff
changeset
|
5665 echo "changequote(,)dnl" |
13090
f870702f0e45
Fix definition of tests witness macro.
Bruno Haible <bruno@clisp.org>
parents:
13089
diff
changeset
|
5666 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
|
5667 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
|
5668 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
|
5669 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
|
5670 echo " m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [\$gl_module_indicator_condition])" |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
5671 func_emit_autoconf_snippets "$testsrelated_modules" "$main_modules $testsrelated_modules" func_verify_module true true true |
13067
0e829091f9c0
Avoid side effects from tests-related modules on the compilation of lib.
Bruno Haible <bruno@clisp.org>
parents:
12986
diff
changeset
|
5672 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
|
5673 func_emit_initmacro_end ${macro_prefix}tests |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5674 # _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
|
5675 # 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
|
5676 if test "$libtool" != true; then |
13768
f19c8837df90
more ports to Solaris tr, which needs [] around ranges
Paul Eggert <eggert@cs.ucla.edu>
parents:
13763
diff
changeset
|
5677 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
|
5678 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5679 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5680 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5681 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
5682 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
|
5683 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
|
5684 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
|
5685 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
|
5686 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5687 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
|
5688 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
|
5689 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
|
5690 echo |
6180
a0904de304e5
Separate the generates files into cvs-committable files and frequently
Bruno Haible <bruno@clisp.org>
parents:
6179
diff
changeset
|
5691 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
|
5692 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
|
5693 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
|
5694 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
|
5695 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
|
5696 ) > "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5697 if test -f "$destdir"/$m4base/gnulib-comp.m4; then |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
5698 if cmp -s "$destdir"/$m4base/gnulib-comp.m4 "$tmpfile"; 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
|
5699 rm -f "$tmpfile" |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5700 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5701 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5702 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
|
5703 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
|
5704 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
|
5705 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5706 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
|
5707 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
|
5708 cat "$tmpfile" |
6249
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
5709 echo |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
5710 echo "# gnulib-comp.m4 ends here" |
564133adbd69
Comment out too much verbosity in --dry-run.
Bruno Haible <bruno@clisp.org>
parents:
6248
diff
changeset
|
5711 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
|
5712 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5713 fi |
6246
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5714 fi |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5715 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5716 if $doit; then |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5717 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
|
5718 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
|
5719 else |
7c089b3b2200
Rework the way --dry-run works.
Bruno Haible <bruno@clisp.org>
parents:
6245
diff
changeset
|
5720 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
|
5721 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
|
5722 rm -f "$tmpfile" |
6181
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5723 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5724 fi |
95b89dc3f638
Read the previous cached settings.
Bruno Haible <bruno@clisp.org>
parents:
6180
diff
changeset
|
5725 |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5726 if $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
|
5727 # Create tests makefile. |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5728 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
|
5729 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
|
5730 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
|
5731 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
|
5732 if test -f "$destdir"/$testsbase/$makefile_am; then |
16714
2e2bf6c7bf38
gnulib-tool: Avoid unintended error output from 'cmp'.
Bruno Haible <bruno@clisp.org>
parents:
16713
diff
changeset
|
5733 if cmp -s "$destdir"/$testsbase/$makefile_am "$tmpfile"; 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
|
5734 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5735 else |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5736 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5737 echo "Updating $testsbase/$makefile_am (backup in $testsbase/$makefile_am~)" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5738 mv -f "$destdir"/$testsbase/$makefile_am "$destdir"/$testsbase/$makefile_am~ |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5739 mv -f "$tmpfile" "$destdir"/$testsbase/$makefile_am |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5740 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5741 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
|
5742 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5743 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5744 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5745 else |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5746 if $doit; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5747 echo "Creating $testsbase/$makefile_am" |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5748 mv -f "$tmpfile" "$destdir"/$testsbase/$makefile_am |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5749 else |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5750 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
|
5751 rm -f "$tmpfile" |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5752 fi |
17046
e23106558036
gnulib-tool: Fix indentation.
Bruno Haible <bruno@clisp.org>
parents:
17045
diff
changeset
|
5753 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
|
5754 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5755 fi |
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5756 |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5757 if test "$vc_files" != false; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5758 # Update the .cvsignore and .gitignore files. |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5759 { 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
|
5760 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
|
5761 # 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
|
5762 echo "$m4base/|A|gnulib-comp.m4" |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5763 } | 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
|
5764 { # Rearrange file descriptors. Needed because "while ... done < ..." |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5765 # 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
|
5766 exec 5<&0 < "$tmp"/fileset-changes |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5767 func_update_ignorelist () |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5768 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5769 ignore="$1" |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5770 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
|
5771 # 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
|
5772 # 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
|
5773 anchor='/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5774 escaped_anchor='\/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5775 doubly_escaped_anchor='\\/' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5776 else |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5777 anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5778 escaped_anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5779 doubly_escaped_anchor='' |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5780 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5781 if test -f "$destdir/$dir$ignore"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5782 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
|
5783 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
|
5784 (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
|
5785 | 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
|
5786 echo "$dir_removed" | sed -e '/^$/d' | LC_ALL=C sort -u \ |
17045
0e193bb29639
gnulib-tool: Remove old file names from .cvsignore, .gitignore.
Bruno Haible <bruno@clisp.org>
parents:
17042
diff
changeset
|
5787 > "$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
|
5788 ) |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5789 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
|
5790 if $doit; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5791 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
|
5792 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
|
5793 { 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
|
5794 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
|
5795 } > "$tmp"/sed-ignore-removed |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5796 { cat "$destdir/$dir$ignore"~ |
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5797 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
|
5798 } | sed -f "$tmp"/sed-ignore-removed \ |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5799 > "$destdir/$dir$ignore" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5800 else |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5801 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
|
5802 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5803 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5804 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5805 else |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5806 if test -n "$dir_added"; then |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5807 if $doit; then |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5808 echo "Creating $destdir/$dir$ignore" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5809 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5810 if test "$ignore" = .cvsignore; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5811 echo ".deps" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5812 # 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
|
5813 echo ".dirstamp" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5814 fi |
10298
9b0ceb24a573
Prepend each added line in .gitignore files with a slash.
Bruno Haible <bruno@clisp.org>
parents:
10293
diff
changeset
|
5815 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
|
5816 } > "$destdir/$dir$ignore" |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5817 else |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5818 echo "Create $destdir/$dir$ignore" |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5819 fi |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5820 fi |
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5821 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5822 } |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5823 func_done_dir () |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5824 { |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5825 dir="$1" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5826 dir_added="$2" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5827 dir_removed="$3" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5828 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
|
5829 func_update_ignorelist .cvsignore |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5830 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5831 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
|
5832 func_update_ignorelist .gitignore |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5833 fi |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5834 } |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5835 last_dir= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5836 last_dir_added= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5837 last_dir_removed= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5838 while read line; do |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5839 # 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
|
5840 next_dir=`echo "$line" | sed -e 's,|.*,,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5841 op=`echo "$line" | sed -e 's,^[^|]*|\([^|]*\)|.*$,\1,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5842 file=`echo "$line" | sed -e 's,^[^|]*|[^|]*|,,'` |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5843 if test "$next_dir" != "$last_dir"; then |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5844 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
|
5845 last_dir="$next_dir" |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5846 last_dir_added= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5847 last_dir_removed= |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5848 fi |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5849 case $op in |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5850 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
|
5851 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
|
5852 esac |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5853 done |
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5854 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
|
5855 exec 0<&5 5<&- |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5856 } |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
5857 fi |
8451
ba5ed28cb276
Update .cvsignore and .gitignore files.
Bruno Haible <bruno@clisp.org>
parents:
8432
diff
changeset
|
5858 |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5859 echo "Finished." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5860 echo |
5572
54000928a33d
Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents:
5527
diff
changeset
|
5861 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
|
5862 # 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
|
5863 # (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
|
5864 # - 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
|
5865 # $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
|
5866 # 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
|
5867 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
|
5868 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
|
5869 # 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
|
5870 # 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
|
5871 # then the #include directives that are surrounded by #ifs. Not sorted. |
7722 | 5872 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
|
5873 include_directive=`func_get_include_directive "$module"` |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5874 case "$nl$include_directive" in |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5875 *"$nl#if"*) |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5876 echo "$include_directive" 1>&5 |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5877 ;; |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5878 *) |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5879 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
|
5880 echo "$include_directive" | grep 'include "' 1>&7 |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5881 ;; |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5882 esac |
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5883 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
|
5884 ( |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5885 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
|
5886 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
|
5887 cat "$tmp"/include-if |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
5888 ) | sed -e '/^$/d' -e 's/^/ /' |
7322
46d98b687a87
Speed up presentation of the include files.
Bruno Haible <bruno@clisp.org>
parents:
7321
diff
changeset
|
5889 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
|
5890 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
5891 for module in $main_modules; do |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5892 func_get_link_directive "$module" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5893 done \ |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5894 | 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
|
5895 if test `wc -l < "$tmp"/link` != 0; then |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5896 echo |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5897 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
|
5898 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
|
5899 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
|
5900 cat "$tmp"/link |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5901 fi |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5902 rm -f "$tmp"/link |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
5903 |
5572
54000928a33d
Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents:
5527
diff
changeset
|
5904 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
5905 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
|
5906 if test "$makefile_am" = Makefile.am; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5907 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
|
5908 else |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5909 echo " - \"include $makefile_name\" from within \"$sourcebase/Makefile.am\"," |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5910 fi |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5911 if test -n "$pobase"; then |
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
5912 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
|
5913 fi |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5914 if $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
|
5915 if test "$makefile_am" = Makefile.am; then |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5916 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
|
5917 else |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5918 echo " - \"include $makefile_name\" from within \"$testsbase/Makefile.am\"," |
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5919 fi |
6250
2c772fe1e1d0
Support --with-tests also with --import.
Bruno Haible <bruno@clisp.org>
parents:
6249
diff
changeset
|
5920 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
|
5921 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
|
5922 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
|
5923 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
|
5924 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
|
5925 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
|
5926 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
|
5927 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
|
5928 echo " - mention \"${val}\" in ${var} in ${dir}Makefile.am," |
7216
91df49e70c77
New option --makefile-name.
Bruno Haible <bruno@clisp.org>
parents:
7215
diff
changeset
|
5929 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
|
5930 done |
15801
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5931 if grep '^ *AC_PROG_CC_STDC' "$configure_ac" > /dev/null; then |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5932 position_early_after=AC_PROG_CC_STDC |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5933 else |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5934 if grep '^ *AC_PROG_CC_C99' "$configure_ac" > /dev/null; then |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5935 position_early_after=AC_PROG_CC_C99 |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5936 else |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5937 position_early_after=AC_PROG_CC |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5938 fi |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5939 fi |
3002f394d1fe
gnulib-tool: Improve suggestion where to put gl_EARLY invocation.
Bruno Haible <bruno@clisp.org>
parents:
15790
diff
changeset
|
5940 echo " - invoke ${macro_prefix}_EARLY in $configure_ac, right after $position_early_after," |
6176 | 5941 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
|
5942 } |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
5943 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5944 # func_create_testdir testdir modules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
5945 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
5946 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
5947 # - 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
|
5948 # - auxdir directory relative to destdir where to place build aux files |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
5949 # - inctests true if tests should be included, false otherwise |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
5950 # - 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
|
5951 # included, blank otherwise |
13263
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
5952 # - 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
|
5953 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
5954 # - 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
|
5955 # blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
5956 # - 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
|
5957 # excluded, blank otherwise |
e7d114c00ff9
gnulib-tool: Add --without-*-tests options.
Bruno Haible <bruno@clisp.org>
parents:
13223
diff
changeset
|
5958 # - 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
|
5959 # excluded, blank otherwise |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
5960 # - single_configure true if a single configure file should be generated, |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
5961 # false for a separate configure file for the tests |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
5962 # - avoidlist list of modules to avoid |
14833
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
5963 # - cond_dependencies true if --conditional-dependencies was given, false if |
76127af7039f
Finish the conditional dependencies mechanism.
Bruno Haible <bruno@clisp.org>
parents:
14806
diff
changeset
|
5964 # --no-conditional-dependencies was given, blank otherwise |
12986
bfc76977457d
Clarify which options are available for --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12983
diff
changeset
|
5965 # - 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
|
5966 # given, blank otherwise |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
5967 # - copymode copy mode for files in general |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
5968 # - lcopymode copy mode for files from local_gnulib_path |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5969 func_create_testdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5970 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5971 testdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5972 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
|
5973 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
|
5974 # 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
|
5975 # Except config-h, which breaks all modules which use HAVE_CONFIG_H. |
18471
5031955d34d3
gnulib-tool: Make --create-testdir on all modules work again.
Bruno Haible <bruno@clisp.org>
parents:
18231
diff
changeset
|
5976 # Except non-recursive-gnulib-prefix-hack, which represents a nonstandard |
5031955d34d3
gnulib-tool: Make --create-testdir on all modules work again.
Bruno Haible <bruno@clisp.org>
parents:
18231
diff
changeset
|
5977 # way of using Automake. |
39941
647230feebc0
Fix failure of 'gnulib-tool --create-testdir' with all modules.
Bruno Haible <bruno@clisp.org>
parents:
39897
diff
changeset
|
5978 # Except timevar, which lacks the required file timevar.def. |
7533
029a26ecb19a
Don't include ftruncate and mountlist by default.
Bruno Haible <bruno@clisp.org>
parents:
7530
diff
changeset
|
5979 # 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
|
5980 # 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
|
5981 modules=`func_all_modules` |
39941
647230feebc0
Fix failure of 'gnulib-tool --create-testdir' with all modules.
Bruno Haible <bruno@clisp.org>
parents:
39897
diff
changeset
|
5982 modules=`for m in $modules; do case $m in config-h | non-recursive-gnulib-prefix-hack | timevar | 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
|
5983 fi |
13419
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
5984 specified_modules="$modules" |
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
5985 |
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
5986 # 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
|
5987 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
|
5988 |
18704
316d6897d46c
gnulib-tool: Avoid conflict of havelib-tests with --single-configure.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
5989 # Test modules which invoke AC_CONFIG_FILES cannot be used with |
316d6897d46c
gnulib-tool: Avoid conflict of havelib-tests with --single-configure.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
5990 # --with-tests --single-configure. Avoid them. |
316d6897d46c
gnulib-tool: Avoid conflict of havelib-tests with --single-configure.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
5991 if $inctests && $single_configure; then |
316d6897d46c
gnulib-tool: Avoid conflict of havelib-tests with --single-configure.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
5992 avoidlist="$avoidlist havelib-tests" |
316d6897d46c
gnulib-tool: Avoid conflict of havelib-tests with --single-configure.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
5993 fi |
316d6897d46c
gnulib-tool: Avoid conflict of havelib-tests with --single-configure.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
5994 |
13264
d66e74e6fe48
gnulib-tool: Don't include hairy tests of dependencies in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
13263
diff
changeset
|
5995 # 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
|
5996 # 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
|
5997 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
|
5998 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
|
5999 |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6000 # 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
|
6001 # its dependencies. |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
6002 saved_inctests="$inctests" |
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
6003 # When computing transitive closures, don't consider $module to depend on |
16358 | 6004 # $module-tests. Need this because tests are implicitly GPL and may depend |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
6005 # on GPL modules - therefore we don't want a warning in this case. |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
6006 inctests=false |
13419
a18c56544c84
gnulib-tool: Align code of func_import and func_create_testdir.
Bruno Haible <bruno@clisp.org>
parents:
13299
diff
changeset
|
6007 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
|
6008 requested_license=`func_get_license "$requested_module"` |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6009 if test "$requested_license" != GPL; then |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6010 # 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
|
6011 # 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
|
6012 # 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
|
6013 # on a GPL module. |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6014 modules="$requested_module" |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6015 func_modules_transitive_closure |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6016 for module in $modules; do |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6017 license=`func_get_license "$module"` |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6018 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6019 'GPLed build tool') ;; |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6020 'public domain' | 'unlimited' | 'unmodifiable license text') ;; |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6021 *) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6022 case "$requested_license" in |
18501
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6023 GPLv3+ | GPL) |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6024 case "$license" in |
18501
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6025 LGPLv2+ | 'LGPLv3+ or GPLv2' | LGPLv3+ | LGPL | GPLv2+ | GPLv3+ | GPL) ;; |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
6026 *) 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
|
6027 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6028 ;; |
18501
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6029 GPLv2+) |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6030 case "$license" in |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6031 LGPLv2+ | 'LGPLv3+ or GPLv2' | GPLv2+) ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6032 *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6033 esac |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6034 ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6035 LGPLv3+ | LGPL) |
9090
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6036 case "$license" in |
18501
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6037 LGPLv2+ | 'LGPLv3+ or GPLv2' | LGPLv3+ | LGPL) ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6038 *) func_warning "module $requested_module depends on a module with an incompatible license: $module" ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6039 esac |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6040 ;; |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6041 'LGPLv3+ or GPLv2') |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6042 case "$license" in |
9012a151a519
gnulib-tool: Support for the dual "LGPLv3+ or GPLv2" license.
Bruno Haible <bruno@clisp.org>
parents:
18474
diff
changeset
|
6043 LGPLv2+ | 'LGPLv3+ or GPLv2') ;; |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
6044 *) 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
|
6045 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6046 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6047 LGPLv2+) |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6048 case "$license" in |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6049 LGPLv2+) ;; |
12819
4b5bf4c79e0c
gnulib-tool: Make warning diagnostics consistent.
Bruno Haible <bruno@clisp.org>
parents:
12775
diff
changeset
|
6050 *) 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
|
6051 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6052 ;; |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6053 esac |
b1835d4a5e2a
Handle copying terms "GPLv2+" and "LGPLv2+".
Bruno Haible <bruno@clisp.org>
parents:
9086
diff
changeset
|
6054 ;; |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6055 esac |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6056 done |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6057 fi |
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6058 done |
7896
cd3ed2fae0bf
Tests modules are under GPL now.
Bruno Haible <bruno@clisp.org>
parents:
7872
diff
changeset
|
6059 inctests="$saved_inctests" |
7660
7aa6fbd6b3b7
Add license compatibility check in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7647
diff
changeset
|
6060 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6061 # Subdirectory names. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6062 sourcebase=gllib |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6063 m4base=glm4 |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
6064 pobase= |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
6065 docbase=gldoc |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6066 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
|
6067 macro_prefix=gl |
9108
33eb494700d6
New options --po-base, --po-domain.
Bruno Haible <bruno@clisp.org>
parents:
9107
diff
changeset
|
6068 po_domain= |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
6069 witness_c_macro= |
9810
f805ab5f1771
New options --vc-files, --no-vc-files.
Bruno Haible <bruno@clisp.org>
parents:
9807
diff
changeset
|
6070 vc_files= |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6071 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6072 # 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
|
6073 modules="$specified_modules" |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
6074 func_modules_transitive_closure |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6075 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
|
6076 func_show_module_list |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6077 fi |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6078 final_modules="$modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6079 |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6080 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6081 # Determine main module list and tests-related module list separately. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6082 func_modules_transitive_closure_separately |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6083 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6084 |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6085 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6086 # Determine whether a $testsbase/libtests.a is needed. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6087 func_determine_use_libtests |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6088 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6089 |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
6090 # Add the dummy module if needed. |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6091 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6092 func_modules_add_dummy_separately |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6093 else |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6094 func_modules_add_dummy |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6095 fi |
6550
3bb57675fc1b
Avoid error due to empty archive on MacOS X.
Bruno Haible <bruno@clisp.org>
parents:
6549
diff
changeset
|
6096 |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6097 # Note: |
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6098 # If $single_configure, we use the module lists $main_modules and |
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6099 # $testsrelated_modules; $modules is merely a temporary variable. |
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6100 # Whereas if ! $configure, the module list is $modules. |
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6101 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6102 # Show banner notice of every module. |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6103 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6104 modules="$main_modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6105 func_modules_notice |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6106 else |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6107 func_modules_notice |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6108 fi |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6109 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6110 # Determine final file list. |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6111 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6112 func_modules_to_filelist_separately |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6113 else |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6114 func_modules_to_filelist |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6115 if test $verbose -ge 0; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6116 echo "File list:" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6117 echo "$files" | sed -e 's/^/ /' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6118 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6119 fi |
13752
68e7104b03e2
gnulib-tool: In testdirs, use the newest available config.{guess.sub}.
Bruno Haible <bruno@clisp.org>
parents:
13750
diff
changeset
|
6120 # Add files for which the copy in gnulib is newer than the one that |
68e7104b03e2
gnulib-tool: In testdirs, use the newest available config.{guess.sub}.
Bruno Haible <bruno@clisp.org>
parents:
13750
diff
changeset
|
6121 # "automake --add-missing --copy" would provide. |
68e7104b03e2
gnulib-tool: In testdirs, use the newest available config.{guess.sub}.
Bruno Haible <bruno@clisp.org>
parents:
13750
diff
changeset
|
6122 files="$files build-aux/config.guess" |
68e7104b03e2
gnulib-tool: In testdirs, use the newest available config.{guess.sub}.
Bruno Haible <bruno@clisp.org>
parents:
13750
diff
changeset
|
6123 files="$files build-aux/config.sub" |
68e7104b03e2
gnulib-tool: In testdirs, use the newest available config.{guess.sub}.
Bruno Haible <bruno@clisp.org>
parents:
13750
diff
changeset
|
6124 files=`for f in $files; do echo $f; done | LC_ALL=C sort -u` |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6125 |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
6126 rewritten='%REWRITTEN%' |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
6127 sed_rewrite_files="\ |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
6128 s,^build-aux/,$rewritten$auxdir/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
6129 s,^doc/,$rewritten$docbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
6130 s,^lib/,$rewritten$sourcebase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
6131 s,^m4/,$rewritten$m4base/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
6132 s,^tests/,$rewritten$testsbase/, |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6133 s,^tests=lib/,$rewritten$testsbase/, |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
6134 s,^top/,$rewritten, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
6135 s,^$rewritten,," |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6136 |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6137 # Create directories. |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6138 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
|
6139 | sed -e "$sed_rewrite_files" \ |
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
6140 | sed -n -e 's,^\(.*\)/[^/]*,\1,p' \ |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6141 | LC_ALL=C sort -u \ |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6142 > "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6143 { # Rearrange file descriptors. Needed because "while ... done < ..." |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6144 # 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
|
6145 exec 5<&0 < "$tmp"/dirs |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6146 while read d; do |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6147 mkdir -p "$testdir/$d" |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6148 done |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6149 exec 0<&5 5<&- |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6150 } |
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6151 |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6152 # Copy files or make symbolic links or hard links. |
7605
ae17dea0254d
Create also all needed subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7600
diff
changeset
|
6153 delimiter=' ' |
7321
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
6154 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
|
6155 | 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
|
6156 | LC_ALL=C sort \ |
3bf1b669d1e1
Rewrite all file names at once.
Bruno Haible <bruno@clisp.org>
parents:
7320
diff
changeset
|
6157 > "$tmp"/files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
6158 { # 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
|
6159 # 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
|
6160 exec 5<&0 < "$tmp"/files |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
6161 while read g f; do |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6162 case "$f" in |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6163 tests=lib/*) f=`echo "$f" | sed -e 's,^tests=lib/,lib/,'` ;; |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6164 esac |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
6165 func_lookup_file "$f" |
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
6166 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
|
6167 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
|
6168 else |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6169 func_should_link |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6170 if test "$copyaction" = symlink; then |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6171 func_symlink "$lookedup_file" "$testdir/$g" |
7643
d67f9dc6019d
New option --local-symlink.
Bruno Haible <bruno@clisp.org>
parents:
7642
diff
changeset
|
6172 else |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6173 if test "$copyaction" = hardlink; then |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6174 func_hardlink "$lookedup_file" "$testdir/$g" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6175 else |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6176 cp -p "$lookedup_file" "$testdir/$g" |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
6177 fi |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
6178 fi |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
6179 fi |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
6180 done |
7373
330a972d58f0
Tweak last patch, for symmetry.
Bruno Haible <bruno@clisp.org>
parents:
7368
diff
changeset
|
6181 exec 0<&5 5<&- |
7326
1ca1035630dd
Avoid to execute while loops in a subshell.
Bruno Haible <bruno@clisp.org>
parents:
7323
diff
changeset
|
6182 } |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6183 |
14840
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
6184 # Determine include_guard_prefix. |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
6185 func_compute_include_guard_prefix |
5f709022a256
Allow multiple gnulib generated include files to be combined.
Bruno Haible <bruno@clisp.org>
parents:
14836
diff
changeset
|
6186 |
7981
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
6187 # 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
|
6188 for_test=true |
41421349e26b
In testing directories, link the test programs already during "make", not
Bruno Haible <bruno@clisp.org>
parents:
7911
diff
changeset
|
6189 |
10476
429cc7a6da60
Don't ask the user to perform edits in the generated Makefile.ams.
Bruno Haible <bruno@clisp.org>
parents:
10475
diff
changeset
|
6190 # 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
|
6191 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
|
6192 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6193 # Create $sourcebase/Makefile.am. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6194 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
|
6195 destfile="$sourcebase/Makefile.am" |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6196 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6197 modules="$main_modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6198 fi |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6199 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
|
6200 any_uses_subdirs="$uses_subdirs" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6201 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6202 # Create $m4base/Makefile.am. |
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6203 mkdir -p "$testdir/$m4base" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6204 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6205 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6206 echo "EXTRA_DIST =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6207 for f in $files; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6208 case "$f" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6209 m4/* ) |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
6210 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6211 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6212 done |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6213 ) > "$testdir/$m4base/Makefile.am" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6214 |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6215 subdirs="$sourcebase $m4base" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6216 subdirs_with_configure_ac="" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6217 |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
6218 if false && test -f "$testdir"/$m4base/gettext.m4; then |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6219 # Avoid stupid error message from automake: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6220 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6221 mkdir -p "$testdir/po" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6222 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6223 ) > "$testdir/po/Makefile.am" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
6224 func_append subdirs " po" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6225 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6226 |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
6227 if $inctests; then |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6228 test -d "$testdir/$testsbase" || mkdir "$testdir/$testsbase" |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6229 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6230 # Create $testsbase/Makefile.am. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6231 destfile="$testsbase/Makefile.am" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6232 modules="$testsrelated_modules" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6233 func_emit_tests_Makefile_am "${macro_prefix}tests_WITNESS" > "$testdir/$testsbase/Makefile.am" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6234 else |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6235 # Viewed from the $testsbase subdirectory, $auxdir is different. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6236 saved_auxdir="$auxdir" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6237 auxdir=`echo "$testsbase/" | sed -e 's%[^/][^/]*//*%../%g'`"$auxdir" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6238 # Create $testsbase/Makefile.am. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6239 use_libtests=false |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6240 destfile="$testsbase/Makefile.am" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6241 func_emit_tests_Makefile_am "" > "$testdir/$testsbase/Makefile.am" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6242 any_uses_subdirs="$any_uses_subdirs$uses_subdirs" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6243 # Create $testsbase/configure.ac. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6244 (echo "# Process this file with autoconf to produce a configure script." |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6245 echo "AC_INIT([dummy], [0])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6246 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6247 echo "AM_INIT_AUTOMAKE" |
12109
b56c1bd3de46
Conditionally emit AM_PROG_CC_C_O invocation to tests/configure.ac.
Bruno Haible <bruno@clisp.org>
parents:
12055
diff
changeset
|
6248 echo |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6249 echo "AC_CONFIG_HEADERS([config.h])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6250 echo |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6251 echo "AC_PROG_CC" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6252 echo "AC_PROG_INSTALL" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6253 echo "AC_PROG_MAKE_SET" |
18124
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
6254 |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
6255 func_emit_pre_early_macros false '' "$modules" |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
6256 |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6257 if test -n "$uses_subdirs"; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6258 echo "AM_PROG_CC_C_O" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6259 echo |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
6260 fi |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6261 for module in $modules; do |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6262 func_verify_module |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6263 if test -n "$module"; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6264 case $module in |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6265 gnumakefile | maintainer-makefile) |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6266 # These modules are meant to be used only in the top-level directory. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6267 ;; |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6268 *) |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6269 func_get_autoconf_early_snippet "$module" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6270 ;; |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6271 esac |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6272 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6273 done \ |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6274 | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)\])/\1/' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6275 if test "$libtool" = true; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6276 echo "LT_INIT([win32-dll])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6277 echo "LT_LANG([C++])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6278 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6279 echo "gl_cond_libtool=true" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6280 else |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6281 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6282 echo "gl_cond_libtool=false" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6283 echo "gl_libdeps=" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6284 echo "gl_ltlibdeps=" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6285 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6286 # Wrap the set of autoconf snippets into an autoconf macro that is then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6287 # invoked. This is needed because autoconf does not support AC_REQUIRE |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6288 # at the top level: |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6289 # error: AC_REQUIRE(gt_CSHARPCOMP): cannot be used outside of an AC_DEFUN'd macro |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6290 # but we want the AC_REQUIRE to have its normal meaning (provide one |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6291 # expansion of the required macro before the current point, and only one |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6292 # expansion total). |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6293 echo "AC_DEFUN([gl_INIT], [" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6294 sed_replace_build_aux=' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6295 :a |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6296 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6297 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6298 ba |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6299 }' |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6300 echo "gl_m4_base='../$m4base'" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6301 func_emit_initmacro_start $macro_prefix |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6302 # We don't have explicit ordering constraints between the various |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6303 # autoconf snippets. It's cleanest to put those of the library before |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6304 # those of the tests. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6305 echo "gl_source_base='../$sourcebase'" |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6306 func_emit_autoconf_snippets "$modules" "$modules" func_verify_nontests_module false false false |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6307 echo "gl_source_base='.'" |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6308 func_emit_autoconf_snippets "$modules" "$modules" func_verify_tests_module false false false |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6309 func_emit_initmacro_end $macro_prefix |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6310 # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6311 # created using libtool, because libtool already handles the dependencies. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6312 if test "$libtool" != true; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6313 libname_upper=`echo "$libname" | LC_ALL=C tr '[a-z]-' '[A-Z]_'` |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6314 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6315 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6316 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6317 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6318 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6319 echo "])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6320 func_emit_initmacro_done $macro_prefix $sourcebase # FIXME use $sourcebase or $testsbase? |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6321 echo |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6322 echo "gl_INIT" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6323 echo |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6324 # Usually $testsbase/config.h will be a superset of config.h. Verify this |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6325 # by "merging" config.h into $testsbase/config.h; look out for gcc warnings. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6326 echo "AH_TOP([#include \"../config.h\"])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6327 echo |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6328 echo "AC_CONFIG_FILES([Makefile])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6329 echo "AC_OUTPUT" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6330 ) > "$testdir/$testsbase/configure.ac" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6331 auxdir="$saved_auxdir" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6332 subdirs_with_configure_ac="$subdirs_with_configure_ac $testsbase" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6333 fi |
14841
9341bfde6165
gnulib-tool: Fix bug in yesterday's commit.
Bruno Haible <bruno@clisp.org>
parents:
14840
diff
changeset
|
6334 func_append subdirs " $testsbase" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6335 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6336 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6337 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6338 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6339 echo |
39943 | 6340 echo "AUTOMAKE_OPTIONS = 1.11 foreign" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6341 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6342 echo "SUBDIRS = $subdirs" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6343 echo |
7195
e4a459055e78
Test other subdirectory names than 'lib' and 'm4'.
Bruno Haible <bruno@clisp.org>
parents:
7187
diff
changeset
|
6344 echo "ACLOCAL_AMFLAGS = -I $m4base" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6345 ) > "$testdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6346 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6347 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6348 (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
|
6349 echo "AC_INIT([dummy], [0])" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
6350 if test "$auxdir" != "."; then |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
6351 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
6352 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6353 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6354 echo |
11931
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
6355 echo "AC_CONFIG_HEADERS([config.h])" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6356 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6357 echo "AC_PROG_CC" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6358 echo "AC_PROG_INSTALL" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6359 echo "AC_PROG_MAKE_SET" |
7106
b9fff044578d
Apply last patch also to --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7105
diff
changeset
|
6360 echo |
7777
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
6361 echo "# For autobuild." |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
6362 echo "AC_CANONICAL_BUILD" |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
6363 echo "AC_CANONICAL_HOST" |
b33956fbd953
2007-01-03 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
7771
diff
changeset
|
6364 echo |
7106
b9fff044578d
Apply last patch also to --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
7105
diff
changeset
|
6365 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
|
6366 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
|
6367 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
|
6368 echo "m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable" |
18124
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
6369 |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
6370 func_emit_pre_early_macros false '' "$final_modules" |
ef6cdfd2e603
gnulib-tool: fix tests of 'extensions' module
Pavel Raiskup <praiskup@redhat.com>
parents:
18114
diff
changeset
|
6371 |
9516
020ae1c236a0
Collect sources for tests-related modules in tests/, compile them to libtests.a.
Bruno Haible <bruno@clisp.org>
parents:
9515
diff
changeset
|
6372 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
|
6373 echo "AM_PROG_CC_C_O" |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
6374 echo |
d6fbdb213b01
Finish support for source files in subdirectories.
Bruno Haible <bruno@clisp.org>
parents:
7640
diff
changeset
|
6375 fi |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6376 for module in $final_modules; do |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6377 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6378 func_verify_module |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6379 else |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6380 func_verify_nontests_module |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6381 fi |
8079
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
6382 if test -n "$module"; then |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
6383 func_get_autoconf_early_snippet "$module" |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
6384 fi |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
6385 done \ |
0951beec5b89
New module description section 'configure.ac-early'.
Bruno Haible <bruno@clisp.org>
parents:
8055
diff
changeset
|
6386 | sed -e '/^$/d;' -e 's/AC_REQUIRE(\[\([^()]*\)\])/\1/' |
7077 | 6387 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
|
6388 echo "LT_INIT([win32-dll])" |
12982
4bf217bee1d8
Fix problem with automake's definition of CXXLINK.
Bruno Haible <bruno@clisp.org>
parents:
12979
diff
changeset
|
6389 echo "LT_LANG([C++])" |
7077 | 6390 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [true])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6391 echo "gl_cond_libtool=true" |
7077 | 6392 else |
6418
e0a8b9b05999
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6414
diff
changeset
|
6393 echo "AM_CONDITIONAL([GL_COND_LIBTOOL], [false])" |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6394 echo "gl_cond_libtool=false" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6395 echo "gl_libdeps=" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6396 echo "gl_ltlibdeps=" |
6414
46d47c8fe734
* gnulib-tool: Define automake conditional GL_COND_LIBTOOL if
Simon Josefsson <simon@josefsson.org>
parents:
6389
diff
changeset
|
6397 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
6398 # 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
|
6399 # 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
|
6400 # at the top level: |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
6401 # 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
|
6402 # 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
|
6403 # 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
|
6404 # expansion total). |
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
6405 echo "AC_DEFUN([gl_INIT], [" |
6556 | 6406 if test "$auxdir" != "build-aux"; then |
6407 sed_replace_build_aux=' | |
6408 :a | |
6409 /AC_CONFIG_FILES(.*:build-aux\/.*)/{ | |
6410 s|AC_CONFIG_FILES(\(.*\):build-aux/\(.*\))|AC_CONFIG_FILES(\1:'"$auxdir"'/\2)| | |
6411 ba | |
6412 }' | |
6413 else | |
10400
817f1418bbde
Make gnulib-tool work with native 'sed' on AIX.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
10380
diff
changeset
|
6414 sed_replace_build_aux="$sed_noop" |
6556 | 6415 fi |
13105
6d950d2ec11e
gnulib-tool: Provide the value of --m4-base to modules.
Bruno Haible <bruno@clisp.org>
parents:
13090
diff
changeset
|
6416 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
|
6417 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
|
6418 echo "gl_source_base='$sourcebase'" |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6419 if $single_configure; then |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6420 func_emit_autoconf_snippets "$main_modules" "$main_modules" func_verify_module true false false |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6421 else |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6422 func_emit_autoconf_snippets "$modules" "$modules" func_verify_nontests_module true false false |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6423 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
|
6424 func_emit_initmacro_end $macro_prefix |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6425 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6426 echo " gltests_libdeps=" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6427 echo " gltests_ltlibdeps=" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6428 func_emit_initmacro_start ${macro_prefix}tests |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6429 echo " gl_source_base='$testsbase'" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6430 # Define a tests witness macro. |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6431 echo " ${macro_prefix}tests_WITNESS=IN_GNULIB_TESTS" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6432 echo " AC_SUBST([${macro_prefix}tests_WITNESS])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6433 echo " gl_module_indicator_condition=\$${macro_prefix}tests_WITNESS" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6434 echo " m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [\$gl_module_indicator_condition])" |
19478
fef1e0e56d65
gnulib-tool: Make --conditional-dependencies work better.
Bruno Haible <bruno@clisp.org>
parents:
19439
diff
changeset
|
6435 func_emit_autoconf_snippets "$testsrelated_modules" "$main_modules $testsrelated_modules" func_verify_module true false false |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6436 echo " m4_popdef([gl_MODULE_INDICATOR_CONDITION])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6437 func_emit_initmacro_end ${macro_prefix}tests |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6438 fi |
7286
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6439 # _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
|
6440 # 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
|
6441 if test "$libtool" != true; then |
13768
f19c8837df90
more ports to Solaris tr, which needs [] around ranges
Paul Eggert <eggert@cs.ucla.edu>
parents:
13763
diff
changeset
|
6442 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
|
6443 echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6444 echo " AC_SUBST([${libname_upper}_LIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6445 echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6446 echo " AC_SUBST([${libname_upper}_LTLIBDEPS])" |
727bb5526bad
For libraries not built with libtool:
Bruno Haible <bruno@clisp.org>
parents:
7270
diff
changeset
|
6447 fi |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6448 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6449 if $use_libtests; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6450 echo " LIBTESTS_LIBDEPS=\"\$gltests_libdeps\"" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6451 echo " AC_SUBST([LIBTESTS_LIBDEPS])" |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6452 fi |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6453 fi |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
6454 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
|
6455 func_emit_initmacro_done $macro_prefix $sourcebase |
14836
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6456 if $single_configure; then |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6457 func_emit_initmacro_done ${macro_prefix}tests $testsbase |
ea0ee6fc3c8e
gnulib-tool: Alternative structure of testdirs, similar to --import.
Bruno Haible <bruno@clisp.org>
parents:
14833
diff
changeset
|
6458 fi |
7486
46b72819ef52
Add support for multiple gnulib-tool invocations in the scope of a single
Bruno Haible <bruno@clisp.org>
parents:
7485
diff
changeset
|
6459 echo |
7090
dfc92f94c781
Allow AC_REQUIREs in the configure.ac snippet.
Bruno Haible <bruno@clisp.org>
parents:
7089
diff
changeset
|
6460 echo "gl_INIT" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6461 echo |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6462 if test -n "$subdirs_with_configure_ac"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6463 echo "AC_CONFIG_SUBDIRS(["`echo $subdirs_with_configure_ac`"])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6464 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6465 makefiles="Makefile" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6466 for d in $subdirs; do |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6467 # 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
|
6468 # 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
|
6469 case " $subdirs_with_configure_ac " in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6470 *" $d "*) ;; |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
6471 *) func_append makefiles " $d/Makefile" ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
6472 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6473 done |
11931
d42b3b6f11d3
Replace uses of obsolete Autoconf macros with modern counterparts.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11919
diff
changeset
|
6474 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
|
6475 echo "AC_OUTPUT" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6476 ) > "$testdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6477 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6478 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6479 (cd "$testdir" |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
6480 # 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
|
6481 # 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
|
6482 if test -f $m4base/gettext.m4; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6483 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
|
6484 for f in $m4base/*.m4~; do |
10969
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
6485 if test -f $f; then |
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
6486 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
|
6487 fi |
7485
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
6488 done |
0194db3ad154
Handle mismatch between latest gettext release and current gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7484
diff
changeset
|
6489 fi |
12978
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
6490 if test "$libtool" = true; then |
b7726f620298
gnulib-tool: Add support for --libtool in --create-testdir.
Bruno Haible <bruno@clisp.org>
parents:
12923
diff
changeset
|
6491 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
|
6492 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6493 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
|
6494 if ! test -d build-aux; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6495 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
|
6496 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6497 func_execute_command ${AUTOCONF} || func_exit 1 |
19261
91adfa2ad3ed
gnulib-tool: Avoid unnecessary config.h.in remaking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
19192
diff
changeset
|
6498 # Explicit 'touch config.h.in': see <https://savannah.gnu.org/support/index.php?109406>. |
19271
6d9b9b82d0af
Port recent gnulib-tool change to Dash
Paul Eggert <eggert@cs.ucla.edu>
parents:
19261
diff
changeset
|
6499 func_execute_command ${AUTOHEADER} && |
6d9b9b82d0af
Port recent gnulib-tool change to Dash
Paul Eggert <eggert@cs.ucla.edu>
parents:
19261
diff
changeset
|
6500 func_execute_command touch config.h.in || |
6d9b9b82d0af
Port recent gnulib-tool change to Dash
Paul Eggert <eggert@cs.ucla.edu>
parents:
19261
diff
changeset
|
6501 func_exit 1 |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6502 func_execute_command ${AUTOMAKE} --add-missing --copy || func_exit 1 |
18959
a2064df3feed
gnulib-tool: Clean up after autotools.
Bruno Haible <bruno@clisp.org>
parents:
18952
diff
changeset
|
6503 rm -rf autom4te.cache |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6504 ) || func_exit 1 |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
6505 if $inctests && ! $single_configure; then |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6506 # Create autogenerated files. |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6507 (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
|
6508 # 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
|
6509 # 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
|
6510 if test -f ../$m4base/gettext.m4; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6511 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
|
6512 for f in ../$m4base/*.m4~; do |
10969
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
6513 if test -f $f; then |
4c304a656b87
Fix a gnulib-tool failure.
Bruno Haible <bruno@clisp.org>
parents:
10854
diff
changeset
|
6514 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
|
6515 fi |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6516 done |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6517 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6518 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
|
6519 if ! test -d ../build-aux; then |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6520 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
|
6521 fi |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6522 func_execute_command ${AUTOCONF} || func_exit 1 |
19261
91adfa2ad3ed
gnulib-tool: Avoid unnecessary config.h.in remaking in testdirs.
Bruno Haible <bruno@clisp.org>
parents:
19192
diff
changeset
|
6523 # Explicit 'touch config.h.in': see <https://savannah.gnu.org/support/index.php?109406>. |
19271
6d9b9b82d0af
Port recent gnulib-tool change to Dash
Paul Eggert <eggert@cs.ucla.edu>
parents:
19261
diff
changeset
|
6524 func_execute_command ${AUTOHEADER} && |
6d9b9b82d0af
Port recent gnulib-tool change to Dash
Paul Eggert <eggert@cs.ucla.edu>
parents:
19261
diff
changeset
|
6525 func_execute_command touch config.h.in || |
6d9b9b82d0af
Port recent gnulib-tool change to Dash
Paul Eggert <eggert@cs.ucla.edu>
parents:
19261
diff
changeset
|
6526 func_exit 1 |
9188
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6527 func_execute_command ${AUTOMAKE} --add-missing --copy || func_exit 1 |
18959
a2064df3feed
gnulib-tool: Clean up after autotools.
Bruno Haible <bruno@clisp.org>
parents:
18952
diff
changeset
|
6528 rm -rf autom4te.cache |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6529 ) || func_exit 1 |
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6530 fi |
7866
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
6531 # Need to run configure and make once, to create built files that are to be |
13769
896628c568fa
parse-datetime: better name than get_date
Eric Blake <eblake@redhat.com>
parents:
13768
diff
changeset
|
6532 # distributed (such as parse-datetime.c). |
13107
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6533 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
|
6534 # Extract the value of "CLEANFILES += ..." and "MOSTLYCLEANFILES += ...". |
18000
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
6535 cleaned_files=`combine_lines < "$testdir/$sourcebase/Makefile.am" \ |
8503
7c0e7f4f1ac1
* gnulib-tool: Rearrange space-tab sequences, since some editors
Eric Blake <ebb9@byu.net>
parents:
8451
diff
changeset
|
6536 | 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
|
6537 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
|
6538 # 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
|
6539 # such $(FOO_H) because they don't refer to distributed files. |
18000
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
6540 built_sources=`combine_lines < "$testdir/$sourcebase/Makefile.am" \ |
8503
7c0e7f4f1ac1
* gnulib-tool: Rearrange space-tab sequences, since some editors
Eric Blake <ebb9@byu.net>
parents:
8451
diff
changeset
|
6541 | 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
|
6542 | sed -e "$sed_remove_make_variables"` |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
6543 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
|
6544 case "$cleaned_files" in |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
6545 *" "$file" "*) ;; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
6546 *) echo $file ;; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
6547 esac; |
58d9bcb3d6c4
Don't unnecessarily run configure and make.
Bruno Haible <bruno@clisp.org>
parents:
7858
diff
changeset
|
6548 done` |
13107
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6549 tests_distributed_built_sources= |
16932
48e8f0679448
gnulib-tool: Refactor inctests variable.
Bruno Haible <bruno@clisp.org>
parents:
16931
diff
changeset
|
6550 if $inctests; then |
13107
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6551 # Likewise for built files in the $testsbase directory. |
18000
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
6552 tests_cleaned_files=`combine_lines < "$testdir/$testsbase/Makefile.am" \ |
13107
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6553 | 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
|
6554 tests_cleaned_files=`for file in $tests_cleaned_files; do echo " $file "; done` |
18000
d0c8068a7c6f
gnulib-tool: concatenate lib_SOURCES to a single line
Pádraig Brady <P@draigBrady.com>
parents:
17964
diff
changeset
|
6555 tests_built_sources=`combine_lines < "$testdir/$testsbase/Makefile.am" \ |
13107
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6556 | 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
|
6557 | 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
|
6558 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
|
6559 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
|
6560 *" "$file" "*) ;; |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6561 *) echo $file ;; |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6562 esac; |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6563 done` |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6564 fi |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6565 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
|
6566 (cd "$testdir" |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6567 ./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
|
6568 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
|
6569 cd "$sourcebase" |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6570 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
|
6571 $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
|
6572 built_sources \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6573 || func_exit 1 |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6574 cd .. |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6575 fi |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6576 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
|
6577 cd "$testsbase" |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6578 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
|
6579 $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
|
6580 built_sources \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6581 || func_exit 1 |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6582 cd .. |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6583 fi |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6584 $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
|
6585 distclean \ |
ed335ebb55f0
gnulib-tool: Create distributed built sources also for the tests.
Bruno Haible <bruno@clisp.org>
parents:
13106
diff
changeset
|
6586 || func_exit 1 |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6587 ) || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6588 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6589 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6590 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6591 # func_create_megatestdir megatestdir allmodules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
6592 # Input: |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
6593 # - local_gnulib_path from --local-dir |
12857
dfbc7f3aa6d0
gnulib-tool: Fix up caching patches.
Bruno Haible <bruno@clisp.org>
parents:
12856
diff
changeset
|
6594 # - 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
|
6595 # - 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
|
6596 func_create_megatestdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6597 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6598 megatestdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6599 allmodules="$2" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6600 if test -z "$allmodules"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6601 allmodules=`func_all_modules` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6602 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6603 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6604 megasubdirs= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6605 # First, all modules one by one. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6606 for onemodule in $allmodules; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6607 func_create_testdir "$megatestdir/$onemodule" $onemodule |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
6608 func_append megasubdirs "$onemodule " |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6609 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6610 # 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
|
6611 # 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
|
6612 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
|
6613 func_create_testdir "$megatestdir/ALL" "$allmodules" |
7323
7ca0e325d5db
Avoid quadratic complexity due to string concatenations.
Bruno Haible <bruno@clisp.org>
parents:
7322
diff
changeset
|
6614 func_append megasubdirs "ALL" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6615 |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6616 # Create autobuild. |
17378
1d9362a18c34
Assume gnulib is checked out from Git, not CVS
Stefano Lattarini <stefano.lattarini@gmail.com>
parents:
17269
diff
changeset
|
6617 cvsdate=`vc_witness="$gnulib_dir/.git/refs/heads/master"; \ |
9377
ca27c3808c95
Update after move from cvs to git.
Bruno Haible <bruno@clisp.org>
parents:
9355
diff
changeset
|
6618 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
|
6619 | sed -e 's,January,01,' -e 's,Jan,01,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6620 -e 's,February,02,' -e 's,Feb,02,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6621 -e 's,March,03,' -e 's,Mar,03,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6622 -e 's,April,04,' -e 's,Apr,04,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6623 -e 's,May,05,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6624 -e 's,June,06,' -e 's,Jun,06,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6625 -e 's,July,07,' -e 's,Jul,07,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6626 -e 's,August,08,' -e 's,Aug,08,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6627 -e 's,September,09,' -e 's,Sep,09,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6628 -e 's,October,10,' -e 's,Oct,10,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6629 -e 's,November,11,' -e 's,Nov,11,' \ |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6630 -e 's,December,12,' -e 's,Dec,12,' \ |
9022
44509698ba9d
* gnulib-tool: Fix indentation.
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
9010
diff
changeset
|
6631 -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
|
6632 -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
|
6633 (echo '#!/bin/sh' |
6840759b4ce2
Start the autobuild script with /bin/sh.
Bruno Haible <bruno@clisp.org>
parents:
8416
diff
changeset
|
6634 echo "CVSDATE=$cvsdate" |
11403
ec75c090b646
gnulib-tool: use $MAKE not make in generated files
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11261
diff
changeset
|
6635 echo ": \${MAKE=make}" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6636 echo "test -d logs || mkdir logs" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6637 echo "for module in $megasubdirs; do" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6638 echo " echo \"Working on module \$module...\"" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6639 echo " safemodule=\`echo \$module | sed -e 's|/|-|g'\`" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6640 echo " (echo \"To: gnulib@autobuild.josefsson.org\"" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6641 echo " echo" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6642 echo " set -x" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6643 echo " : autobuild project... \$module" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6644 echo " : autobuild revision... cvs-\$CVSDATE-000000" |
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6645 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
|
6646 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
|
6647 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
|
6648 echo " echo rc=\$?" |
8419
d5e85ac6458c
Avoid using sed -e "", not supported by AIX sed.
Bruno Haible <bruno@clisp.org>
parents:
8418
diff
changeset
|
6649 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
|
6650 echo "done" |
8672
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
6651 ) > "$megatestdir/do-autobuild" |
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
6652 chmod a+x "$megatestdir/do-autobuild" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6653 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6654 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6655 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6656 echo |
39943 | 6657 echo "AUTOMAKE_OPTIONS = 1.11 foreign" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6658 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6659 echo "SUBDIRS = $megasubdirs" |
8416
0bf5cb89a6b9
Create also an autobuild script.
Bruno Haible <bruno@clisp.org>
parents:
8410
diff
changeset
|
6660 echo |
8672
c00e30e9aba4
2007-04-12 Simon Josefsson <simon@josefsson.org>
Simon Josefsson <simon@josefsson.org>
parents:
8668
diff
changeset
|
6661 echo "EXTRA_DIST = do-autobuild" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6662 ) > "$megatestdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6663 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6664 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6665 (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
|
6666 echo "AC_INIT([dummy], [0])" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
6667 if test "$auxdir" != "."; then |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
6668 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
6669 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6670 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6671 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6672 echo "AC_PROG_MAKE_SET" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6673 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6674 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
|
6675 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
|
6676 echo "AC_OUTPUT" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6677 ) > "$megatestdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6678 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6679 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6680 (cd "$megatestdir" |
6547
1a65fb7ddbbb
Don't waste time in a recursive autoreconf.
Bruno Haible <bruno@clisp.org>
parents:
6546
diff
changeset
|
6681 # 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
|
6682 # 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
|
6683 # 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
|
6684 func_execute_command ${ACLOCAL} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6685 func_execute_command mkdir build-aux |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6686 func_execute_command ${AUTOCONF} || func_exit 1 |
7bf3aff81ae2
New options --verbose, --quiet.
Bruno Haible <bruno@clisp.org>
parents:
9187
diff
changeset
|
6687 func_execute_command ${AUTOMAKE} --add-missing --copy || func_exit 1 |
18959
a2064df3feed
gnulib-tool: Clean up after autotools.
Bruno Haible <bruno@clisp.org>
parents:
18952
diff
changeset
|
6688 rm -rf autom4te.cache |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6689 ) || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6690 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6691 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6692 case $mode in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6693 "" ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6694 func_fatal_error "no mode specified" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6695 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6696 list ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6697 func_all_modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6698 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6699 |
12876
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6700 find ) |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6701 # 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
|
6702 # Needs to handle . [ \ * ^ $. |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6703 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
|
6704 s/\[/\\[/g |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6705 s/\^/\\^/g |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6706 s/\([.*$]\)/[\1]/g' |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6707 for filename |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6708 do |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6709 if test -f "$gnulib_dir/$filename" \ |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
6710 || func_lookup_local_file "$filename"; then |
12877
2e190fad4cfe
Tweak last commit: Reduce the candidate list.
Bruno Haible <bruno@clisp.org>
parents:
12876
diff
changeset
|
6711 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
|
6712 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
|
6713 module_candidates=` |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6714 { |
12877
2e190fad4cfe
Tweak last commit: Reduce the candidate list.
Bruno Haible <bruno@clisp.org>
parents:
12876
diff
changeset
|
6715 (cd "$gnulib_dir" && find modules -type f -print | xargs -n 100 grep -l "$filename_line_regex" /dev/null | sed -e 's,^modules/,,') |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
6716 func_path_foreach "$local_gnulib_path" func_modules_in_dir %dir% | 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
|
6717 } \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6718 | func_sanitize_modulelist \ |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6719 | 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
|
6720 ` |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6721 for module in $module_candidates; do |
12877
2e190fad4cfe
Tweak last commit: Reduce the candidate list.
Bruno Haible <bruno@clisp.org>
parents:
12876
diff
changeset
|
6722 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
|
6723 echo $module |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6724 fi |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6725 done |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6726 else |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6727 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
|
6728 fi |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6729 done |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6730 ;; |
030a6f5cbffd
Make it easier to find modules. New gnulib-tool option '--find'.
Bruno Haible <bruno@clisp.org>
parents:
12859
diff
changeset
|
6731 |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6732 import | add-import | remove-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
|
6733 |
5343 | 6734 # Where to import. |
6735 if test -z "$destdir"; then | |
6736 destdir=. | |
6737 fi | |
6738 test -d "$destdir" \ | |
6739 || 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
|
6740 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6741 # 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
|
6742 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
|
6743 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
|
6744 else |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6745 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
|
6746 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
|
6747 else |
12021
d625e819e6ea
Add advice to an error message.
Bruno Haible <bruno@clisp.org>
parents:
11931
diff
changeset
|
6748 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
|
6749 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6750 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6751 |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6752 # Analyze configure.ac. |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6753 guessed_auxdir="." |
7077 | 6754 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
|
6755 my_sed_traces=' |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6756 s,#.*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6757 s,^dnl .*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6758 s, dnl .*$,, |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6759 /AC_CONFIG_AUX_DIR/ { |
10987 | 6760 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
|
6761 } |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6762 /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
|
6763 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
|
6764 }' |
7752
fc2ff707c74b
* gnulib-tool (SED): Remove, undoing previous change.
Paul Eggert <eggert@cs.ucla.edu>
parents:
7737
diff
changeset
|
6765 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
|
6766 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6767 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
|
6768 auxdir="$guessed_auxdir" |
5343 | 6769 fi |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
6770 |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6771 # Determine where to apply func_import. |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6772 if test "$mode" = import; then |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6773 # Apply func_import to a particular gnulib directory. |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6774 # The command line contains the complete specification; don't look at |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6775 # the contents of gnulib-cache.m4. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6776 test -n "$supplied_libname" || supplied_libname=true |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6777 test -n "$sourcebase" || sourcebase="lib" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6778 test -n "$m4base" || m4base="m4" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6779 test -n "$docbase" || docbase="doc" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6780 test -n "$testsbase" || testsbase="tests" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6781 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
|
6782 func_import "$*" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6783 else |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6784 if test -n "$m4base"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6785 # Apply func_import to a particular gnulib directory. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6786 # Any number of additional modules can be given. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6787 if test ! -f "$destdir/$m4base"/gnulib-cache.m4; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6788 # First use of gnulib in the given m4base. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6789 test -n "$supplied_libname" || supplied_libname=true |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6790 test -n "$sourcebase" || sourcebase="lib" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6791 test -n "$docbase" || docbase="doc" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6792 test -n "$testsbase" || testsbase="tests" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6793 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
|
6794 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6795 func_import "$*" |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6796 else |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6797 # Apply func_import to all gnulib directories. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6798 # To get this list of directories, look at Makefile.am. (Not at |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6799 # configure, because it may be omitted from version control. Also, |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6800 # don't run "find $destdir -name gnulib-cache.m4", as it might be |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6801 # too expensive.) |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6802 m4dirs= |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6803 m4dirs_count=0 |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6804 if test -f "$destdir"/Makefile.am; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6805 aclocal_amflags=`sed -n -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/p' "$destdir"/Makefile.am` |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6806 m4dir_is_next= |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6807 for arg in $aclocal_amflags; do |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6808 if test -n "$m4dir_is_next"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6809 # Ignore absolute directory pathnames, like /usr/local/share/aclocal. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6810 case "$arg" in |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6811 /*) ;; |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6812 *) |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6813 if test -f "$destdir/$arg"/gnulib-cache.m4; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6814 func_append m4dirs " $arg" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6815 m4dirs_count=`expr $m4dirs_count + 1` |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6816 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6817 ;; |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6818 esac |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6819 m4dir_is_next= |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6820 else |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6821 if test "X$arg" = "X-I"; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6822 m4dir_is_next=yes |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6823 else |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6824 m4dir_is_next= |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6825 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6826 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6827 done |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6828 else |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6829 # No Makefile.am! Oh well. Look at the last generated aclocal.m4. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6830 if test -f "$destdir"/aclocal.m4; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6831 sedexpr1='s,^m4_include(\[\(.*\)])$,\1,p' |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6832 sedexpr2='s,^[^/]*$,.,' |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6833 sedexpr3='s,/[^/]*$,,' |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6834 m4dirs=`sed -n -e "$sedexpr1" aclocal.m4 | sed -e "$sedexpr2" -e "$sedexpr3" | LC_ALL=C sort -u` |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6835 m4dirs=`for arg in $m4dirs; do if test -f "$destdir/$arg"/gnulib-cache.m4; then echo $arg; fi; done` |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6836 m4dirs_count=`for arg in $m4dirs; do echo "$arg"; done | wc -l` |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6837 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6838 fi |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6839 if test $m4dirs_count = 0; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6840 # First use of gnulib in a package. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6841 # Any number of additional modules can be given. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6842 test -n "$supplied_libname" || supplied_libname=true |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6843 test -n "$sourcebase" || sourcebase="lib" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6844 m4base="m4" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6845 test -n "$docbase" || docbase="doc" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6846 test -n "$testsbase" || testsbase="tests" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6847 test -n "$macro_prefix" || macro_prefix="gl" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6848 func_import "$*" |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6849 else |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6850 if test $m4dirs_count = 1; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6851 # There's only one use of gnulib here. Assume the user means it. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6852 # Any number of additional modules can be given. |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6853 for m4base in $m4dirs; do |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6854 func_import "$*" |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6855 done |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6856 else |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6857 # Ambiguous - guess what the user meant. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6858 if test $# = 0; then |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6859 # No further arguments. Guess the user wants to update all of them. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6860 for m4base in $m4dirs; do |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6861 # Perform func_import in a subshell, so that variable values |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6862 # such as |
18173
c5a6d6300f8f
gnulib-tool: allow multiple --local-dir usage
Pavel Raiskup <praiskup@redhat.com>
parents:
18124
diff
changeset
|
6863 # local_gnulib_path, incobsolete, inc_cxx_tests, |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6864 # inc_longrunning_tests, inc_privileged_tests, |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6865 # inc_unportable_tests, inc_all_tests, avoidlist, sourcebase, |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6866 # m4base, pobase, docbase, testsbase, inctests, libname, lgpl, |
14894
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
6867 # makefile_name, libtool, macro_prefix, po_domain, |
b22360ddefc4
gnulib-tool: Better isolation between different gnulib-tool invocations.
Bruno Haible <bruno@clisp.org>
parents:
14841
diff
changeset
|
6868 # witness_c_macro, vc_files |
13638
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6869 # don't propagate from one directory to another. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6870 (func_import) || func_exit 1 |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6871 done |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6872 else |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6873 # Really ambiguous. |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6874 func_fatal_error "Ambiguity: to which directory should the modules be added? Please specify at least --m4-base=..." |
8ae47cf4002f
gnulib-tool: Change --import. New options --add/remove-import.
Bruno Haible <bruno@clisp.org>
parents:
13636
diff
changeset
|
6875 fi |
6183
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6876 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6877 fi |
d12635ef6eb5
Make it possible to use multiple gnulib instantiations with the same
Bruno Haible <bruno@clisp.org>
parents:
6182
diff
changeset
|
6878 fi |
6178 | 6879 fi |
5343 | 6880 ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6881 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6882 create-testdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6883 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6884 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6885 fi |
4126
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
6886 mkdir "$destdir" |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
6887 test -d "$destdir" \ |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
6888 || func_fatal_error "could not create destination directory" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
6889 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6890 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6891 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6892 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6893 create-megatestdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6894 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6895 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6896 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6897 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
|
6898 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6899 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6900 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6901 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6902 test ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6903 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6904 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
|
6905 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6906 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6907 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6908 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6909 cd build |
7638
581c011e05d6
* gnulib-tool (func_create_testdir): Fix replacement of
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
7605
diff
changeset
|
6910 ../configure || func_exit 1 |
11404
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
6911 $MAKE || func_exit 1 |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
6912 $MAKE check || func_exit 1 |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
6913 $MAKE distclean || func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6914 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6915 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6916 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6917 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
|
6918 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6919 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6920 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6921 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6922 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6923 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6924 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6925 megatest ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6926 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6927 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
|
6928 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6929 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6930 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6931 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6932 cd build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6933 ../configure |
11404
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
6934 $MAKE |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
6935 $MAKE check |
eb725d01cd4c
gnulib-tool: execute $MAKE not make
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents:
11403
diff
changeset
|
6936 $MAKE distclean |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6937 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6938 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6939 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6940 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
|
6941 func_exit 1 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6942 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6943 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6944 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6945 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6946 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6947 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6948 extract-description ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6949 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6950 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6951 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6952 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6953 func_get_description "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6954 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6955 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6956 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6957 |
13070
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6958 extract-comment ) |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6959 for module |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6960 do |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6961 func_verify_module |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6962 if test -n "$module"; then |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6963 func_get_comment "$module" |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6964 fi |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6965 done |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6966 ;; |
71d59ec8c75f
New module description field 'Comment'.
Bruno Haible <bruno@clisp.org>
parents:
13069
diff
changeset
|
6967 |
10743
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6968 extract-status ) |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6969 for module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6970 do |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6971 func_verify_module |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6972 if test -n "$module"; then |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6973 func_get_status "$module" |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6974 fi |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6975 done |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6976 ;; |
ec39330cb04e
Modules now have a 'status' attribute.
Bruno Haible <bruno@clisp.org>
parents:
10732
diff
changeset
|
6977 |
9189
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6978 extract-notice ) |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6979 for module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6980 do |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6981 func_verify_module |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6982 if test -n "$module"; then |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6983 func_get_notice "$module" |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6984 fi |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6985 done |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6986 ;; |
1d7d9694f1e2
Allow for modules to show an arbitrary notice.
Bruno Haible <bruno@clisp.org>
parents:
9188
diff
changeset
|
6987 |
12460
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6988 extract-applicability ) |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6989 for module |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6990 do |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6991 func_verify_module |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6992 if test -n "$module"; then |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6993 func_get_applicability "$module" |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6994 fi |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6995 done |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6996 ;; |
282eecca2301
New module attribute 'Applicability'.
Bruno Haible <bruno@clisp.org>
parents:
12417
diff
changeset
|
6997 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6998 extract-filelist ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6999 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7000 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7001 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7002 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7003 func_get_filelist "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7004 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7005 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7006 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7007 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7008 extract-dependencies ) |
15853
3034b1243e09
gnulib-tool: don't follow dependencies to avoided modules
Paul Eggert <eggert@cs.ucla.edu>
parents:
15852
diff
changeset
|
7009 if test -n "$avoidlist"; then |
3034b1243e09
gnulib-tool: don't follow dependencies to avoided modules
Paul Eggert <eggert@cs.ucla.edu>
parents:
15852
diff
changeset
|
7010 func_fatal_error "cannot combine --avoid and --extract-dependencies" |
3034b1243e09
gnulib-tool: don't follow dependencies to avoided modules
Paul Eggert <eggert@cs.ucla.edu>
parents:
15852
diff
changeset
|
7011 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7012 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7013 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7014 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7015 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7016 func_get_dependencies "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7017 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7018 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7019 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7020 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7021 extract-autoconf-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7022 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7023 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7024 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7025 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7026 func_get_autoconf_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7027 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7028 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7029 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7030 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7031 extract-automake-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7032 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7033 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7034 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7035 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7036 func_get_automake_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7037 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7038 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7039 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7040 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7041 extract-include-directive ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7042 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7043 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7044 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7045 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7046 func_get_include_directive "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7047 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7048 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7049 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7050 |
8055
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7051 extract-link-directive ) |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7052 for module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7053 do |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7054 func_verify_module |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7055 if test -n "$module"; then |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7056 func_get_link_directive "$module" |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7057 fi |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7058 done |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7059 ;; |
5c79d44f739d
New module description field 'Link'.
Bruno Haible <bruno@clisp.org>
parents:
8040
diff
changeset
|
7060 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7061 extract-license ) |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7062 for module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7063 do |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7064 func_verify_module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7065 if test -n "$module"; then |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7066 func_get_license "$module" |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7067 fi |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7068 done |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7069 ;; |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
7070 |
4197 | 7071 extract-maintainer ) |
7072 for module | |
7073 do | |
7074 func_verify_module | |
7075 if test -n "$module"; then | |
7076 func_get_maintainer "$module" | |
7077 fi | |
7078 done | |
7079 ;; | |
7080 | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7081 extract-tests-module ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7082 for module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7083 do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7084 func_verify_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7085 if test -n "$module"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7086 func_get_tests_module "$module" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7087 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7088 done |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7089 ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
7090 |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7091 copy-file ) |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7092 # Verify the number of arguments. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7093 if test $# -lt 1 || test $# -gt 2; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7094 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
|
7095 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7096 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7097 # 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
|
7098 f="$1" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7099 # Verify the file exists. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7100 func_lookup_file "$f" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7101 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7102 # 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
|
7103 # It defaults to the current directory. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7104 dest="$2" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7105 test -n "$dest" || dest='.' |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7106 test -n "$sourcebase" || sourcebase="lib" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7107 test -n "$m4base" || m4base="m4" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7108 test -n "$docbase" || docbase="doc" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7109 test -n "$testsbase" || testsbase="tests" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7110 test -n "$auxdir" || auxdir="build-aux" |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
7111 rewritten='%REWRITTEN%' |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7112 sed_rewrite_files="\ |
11560
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
7113 s,^build-aux/,$rewritten$auxdir/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
7114 s,^doc/,$rewritten$docbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
7115 s,^lib/,$rewritten$sourcebase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
7116 s,^m4/,$rewritten$m4base/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
7117 s,^tests/,$rewritten$testsbase/, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
7118 s,^top/,$rewritten, |
987b2dec97b7
Fix the rewriting rules for file names.
Bruno Haible <bruno@clisp.org>
parents:
11533
diff
changeset
|
7119 s,^$rewritten,," |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7120 if test -d "$dest"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7121 destdir="$dest" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7122 g=`echo "$f" | sed -e "$sed_rewrite_files"` |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7123 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7124 destdir=`dirname "$dest"` |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7125 g=`basename "$dest"` |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7126 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7127 |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7128 # Create the directory for destfile. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7129 d=`dirname "$destdir/$g"` |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7130 if $doit; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7131 if test -n "$d" && test ! -d "$d"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7132 mkdir -p "$d" || func_fatal_error "failed" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7133 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7134 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7135 # Copy the file. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7136 func_dest_tmpfilename "$g" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7137 cp "$lookedup_file" "$tmpfile" || func_fatal_error "failed" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7138 already_present=true |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7139 if test -f "$destdir/$g"; then |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7140 # The file already exists. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7141 func_update_file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7142 else |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7143 # Install the file. |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7144 # Don't protest if the file should be there but isn't: it happens |
13636
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
7145 # frequently that developers don't put autogenerated files under version |
06064a28d167
gnulib-tool: Don't talk about CVS any more.
Bruno Haible <bruno@clisp.org>
parents:
13634
diff
changeset
|
7146 # control. |
11461
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7147 func_add_file |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7148 fi |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7149 rm -f "$tmpfile" |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7150 ;; |
263b7daa235d
New gnulib-tool option --copy-file.
Bruno Haible <bruno@clisp.org>
parents:
11421
diff
changeset
|
7151 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7152 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7153 func_fatal_error "unknown operation mode --$mode" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7154 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7155 |
18937
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7156 if test "$copymode" = hardlink -o "$lcopymode" = hardlink; then |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7157 # Setting hard links modifies the ctime of files in the gnulib checkout. |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7158 # This disturbs the result of the next "gitk" invocation. |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7159 # Workaround: Let git scan the files. This can be done through |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7160 # "git update-index --refresh" or "git status" or "git diff". |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7161 if test -d "$gnulib_dir"/.git \ |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7162 && (git --version) >/dev/null 2>/dev/null; then |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7163 (cd "$gnulib_dir" && git update-index --refresh >/dev/null) |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7164 fi |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7165 fi |
f0e497cb3d67
gnulib-tool: Add options to create hard links.
Bruno Haible <bruno@clisp.org>
parents:
18934
diff
changeset
|
7166 |
7073
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
7167 rm -rf "$tmp" |
eb23418a908e
Make it possible to use a locally augmented gnulib.
Bruno Haible <bruno@clisp.org>
parents:
7072
diff
changeset
|
7168 # 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
|
7169 # 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
|
7170 # 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
|
7171 # 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
|
7172 # 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
|
7173 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
|
7174 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
|
7175 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7176 exit 0 |
7241
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
7177 |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
7178 # Local Variables: |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
7179 # indent-tabs-mode: nil |
aed440dca701
* gnulib-tool: Don't let emacs change spaces to TAB.
Eric Blake <ebb9@byu.net>
parents:
7240
diff
changeset
|
7180 # 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
|
7181 # End: |