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