Mercurial > hg > octave-nkf > gnulib-hg
annotate gnulib-tool @ 6170:a10e4460ad4c
* lib/regex_internal.h (re_sub_match_top_t): Remove unused member
next_last_offset.
(struct re_dfa_t): Remove unused member states_alloc.
* lib/regcomp.c (init_dfa): Don't initialize unused members.
* config/srclist.txt: Add glibc bug 1273.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Wed, 31 Aug 2005 18:08:34 +0000 |
parents | 09720f424348 |
children | 9412dd89619b |
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 |
6161
09720f424348
Avoid unnecessary spaces in $avoidlist.
Bruno Haible <bruno@clisp.org>
parents:
6160
diff
changeset
|
25 cvsdatestamp='$Date: 2005-08-29 20:03:02 $' |
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. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
105 --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
|
106 --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
|
107 -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
|
108 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
109 Report bugs to <bug-gnulib@gnu.org>." |
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 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
112 # func_version |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
113 # outputs to stdout the --version message. |
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 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
116 echo "$progname (GNU $package) $version" |
6111
4bc400780d6a
Update copyright year and authors.
Bruno Haible <bruno@clisp.org>
parents:
6110
diff
changeset
|
117 echo "Copyright (C) 2002-2005 Free Software Foundation, Inc. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
118 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
|
119 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
|
120 echo "Written by" "Bruno Haible" "and" "Simon Josefsson" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
121 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
122 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
123 # func_fatal_error message |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
124 # 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
|
125 func_fatal_error () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
126 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
127 echo "gnulib-tool: *** $1" 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
128 echo "gnulib-tool: *** Stop." 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
129 exit 1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
130 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
131 |
5684
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
132 # func_cp_if_changed SRC DEST |
5685
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
133 # Like cp, but avoids munging timestamps if the file hasn't changed. |
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
134 # Uses also the variables |
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
135 # - dry_run true if actions shall only be printed, blank otherwise |
5684
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
136 func_cp_if_changed () |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
137 { |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
138 if test $# -ne 2; then |
5685
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
139 echo "usage: func_cp_if_changed SRC DEST" >&2 |
5684
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
140 fi |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
141 test -n "$dry_run" && dry=echo |
5685
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
142 if cmp "$1" "$2" >/dev/null 2>&1; then |
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
143 : |
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
144 else |
5684
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
145 $dry cp -p "$1" "$2" |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
146 fi |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
147 } |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
148 |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
149 # func_mv_if_changed SRC DEST |
5685
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
150 # Like mv, but avoids munging timestamps if the file hasn't changed. |
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
151 # Removes SRC if it is not renamed. |
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
152 # Uses also the variables |
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
153 # - dry_run true if actions shall only be printed, blank otherwise |
5684
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
154 func_mv_if_changed () |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
155 { |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
156 if test $# -ne 2; then |
5685
18b4bb3dea47
Preserve timestamps of files that have not changed.
Bruno Haible <bruno@clisp.org>
parents:
5684
diff
changeset
|
157 echo "usage: func_mv_if_changed SRC DEST" >&2 |
5684
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
158 fi |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
159 test -n "$dry_run" && dry=echo |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
160 if cmp "$1" "$2" >/dev/null 2>&1; then |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
161 $dry rm "$1" |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
162 else |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
163 $dry mv "$1" "$2" |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
164 fi |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
165 } |
0aebab2c04d4
* gnulib-tool: Only replace files via --import when they have
Paul Eggert <eggert@cs.ucla.edu>
parents:
5572
diff
changeset
|
166 |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
167 # 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
|
168 # 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
|
169 # Uses also the variables |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
170 # - dry_run true if actions shall only be printed, blank otherwise |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
171 func_ln_if_changed () |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
172 { |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
173 if test $# -ne 2; then |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
174 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
|
175 fi |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
176 test -n "$dry_run" && dry=echo |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
177 if test -L "$2" -a "$1" = "`readlink "$2"`"; then |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
178 : |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
179 else |
5805
afd959c1af76
(Options): Add -s for --symlink/--symbolic.
Simon Josefsson <simon@josefsson.org>
parents:
5803
diff
changeset
|
180 $dry rm -f "$2" |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
181 $dry ln -s "$1" "$2" |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
182 fi |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
183 } |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
184 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
185 # Command-line option processing. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
186 # Removes the OPTIONS from the arguments. Sets the variables: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
187 # - mode list or import or create-testdir or create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
188 # - destdir from --dir |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
189 # - libname, supplied_libname from --lib |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
190 # - sourcebase from --source-base |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
191 # - m4base from --m4-base |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
192 # - testsbase from --tests-base |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
193 # - auxdir from --aux-dir |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
194 # - inctests true if --with-tests was given, blank otherwise |
5981 | 195 # - avoidlist list of modules to avoid, from --avoid |
196 # - 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
|
197 # - libtool true if --libtool was given, blank otherwise |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
198 # - do_changelog false if --no-changelog was given, : otherwise |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
199 # - dry_run true if --dry-run was given, blank otherwise |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
200 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
201 mode= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
202 destdir= |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
203 libname=libgnu |
5344
c2f5677fc6ed
Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents:
5343
diff
changeset
|
204 supplied_libname= |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
205 sourcebase= |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
206 m4base= |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
207 testsbase= |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
208 auxdir= |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
209 inctests= |
5981 | 210 avoidlist= |
211 lgpl= | |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
212 libtool= |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
213 do_changelog=: |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
214 dry_run= |
5799
ad9eff556694
2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
5798
diff
changeset
|
215 symbolic= |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
216 |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
217 supplied_opts="$@" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
218 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
219 while test $# -gt 0; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
220 case "$1" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
221 --list | --lis ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
222 mode=list |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
223 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
224 --import | --impor | --impo | --imp | --im | --i ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
225 mode=import |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
226 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
227 --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
|
228 mode=create-testdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
229 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
230 --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
|
231 mode=create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
232 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
233 --test | --tes | --te | --t ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
234 mode=test |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
235 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
236 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
237 mode=megatest |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
238 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
239 --extract-* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
240 mode=`echo "X$1" | sed -e 's/^X--//'` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
241 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
242 --dir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
243 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
244 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
245 func_fatal_error "missing argument for --dir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
246 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
247 destdir=$1 |
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 --dir=* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
250 destdir=`echo "X$1" | sed -e 's/^X--dir=//'` |
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 --lib ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
253 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
254 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
255 func_fatal_error "missing argument for --lib" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
256 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
257 libname=$1 |
5343 | 258 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
259 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
260 --lib=* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
261 libname=`echo "X$1" | sed -e 's/^X--lib=//'` |
5343 | 262 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
263 shift ;; |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
264 --source-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
265 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
266 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
267 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
|
268 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
269 sourcebase=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
270 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
271 --source-base=* ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
272 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
|
273 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
274 --m4-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
275 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
276 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
277 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
|
278 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
279 m4base=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
280 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
281 --m4-base=* ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
282 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
|
283 shift ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
284 --tests-base ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
285 shift |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
286 if test $# = 0; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
287 func_fatal_error "missing argument for --tests-base" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
288 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
289 testsbase=$1 |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
290 shift ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
291 --tests-base=* ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
292 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
|
293 shift ;; |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
294 --aux-dir ) |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
295 shift |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
296 if test $# = 0; then |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
297 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
|
298 fi |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
299 auxdir=$1 |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
300 shift ;; |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
301 --aux-dir=* ) |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
302 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
|
303 shift ;; |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
304 --with-tests ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
305 inctests=true |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
306 shift ;; |
5981 | 307 --avoid ) |
308 shift | |
309 if test $# = 0; then | |
310 func_fatal_error "missing argument for --avoid" | |
311 fi | |
312 avoidlist="$avoidlist $1" | |
313 shift ;; | |
314 --avoid=* ) | |
315 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
|
316 shift ;; |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
317 --lgpl ) |
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
318 lgpl=true |
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
319 shift ;; |
5981 | 320 --libtool ) |
321 libtool=true | |
322 shift ;; | |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
323 --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
|
324 do_changelog=false |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
325 shift ;; |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
326 --dry-run ) |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
327 dry_run=true |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
328 shift ;; |
5805
afd959c1af76
(Options): Add -s for --symlink/--symbolic.
Simon Josefsson <simon@josefsson.org>
parents:
5803
diff
changeset
|
329 -s | --symbolic | --symlink ) |
5799
ad9eff556694
2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
5798
diff
changeset
|
330 symbolic=true |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
331 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
332 --help | --hel | --he | --h ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
333 func_usage |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
334 exit 0 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
335 --version | --versio | --versi | --vers | --ver | --ve | --v ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
336 func_version |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
337 exit 0 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
338 -- ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
339 # Stop option prcessing |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
340 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
341 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
342 -* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
343 echo "gnulib-tool: unknown option $1" 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
344 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
345 exit 1 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
346 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
347 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
348 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
349 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
350 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
351 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
352 case "$0" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
353 /*) self_abspathname="$0" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
354 */*) self_abspathname=`pwd`/"$0" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
355 *) 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
|
356 if test -x "$d/$0" && test ! -d "$d/$0"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
357 self_abspathname="$d/$0" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
358 break |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
359 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
360 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
361 if test -z "$self_abspathname"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
362 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
|
363 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
364 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
365 esac |
4717
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
366 while test -h "$self_abspathname"; do |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
367 # Resolve symbolic link. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
368 sedexpr1='s, -> ,#%%#,' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
369 sedexpr2='s,^.*#%%#\(.*\)$,\1,p' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
370 linkval=`LC_ALL=C ls -l "$self_abspathname" | sed -e "$sedexpr1" | sed -n -e "$sedexpr2"` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
371 test -n "$linkval" || break |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
372 case "$linkval" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
373 /* ) self_abspathname="$linkval" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
374 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
375 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
376 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
377 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
378 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
379 # func_all_modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
380 func_all_modules () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
381 { |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
382 # 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
|
383 # 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
|
384 # --extract-tests-module if desired. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
385 (cd "$gnulib_dir/modules" && ls -1) \ |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
386 | 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
|
387 | sed -e '/-tests$/d' \ |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
388 | sort |
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 # func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
392 # verifies a module name |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
393 func_verify_module () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
394 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
395 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
|
396 || test "CVS" = "$module" \ |
1346b5405a74
(func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents:
4126
diff
changeset
|
397 || test "ChangeLog" = "$module" \ |
5312 | 398 || test "README" = "$module" \ |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
399 || test "TEMPLATE" = "$module" \ |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
400 || test "TEMPLATE-TESTS" = "$module"; then |
4128
1346b5405a74
(func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents:
4126
diff
changeset
|
401 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
|
402 module= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
403 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
404 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
405 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
406 # func_verify_nontests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
407 # verifies a module name, excluding tests modules |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
408 func_verify_nontests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
409 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
410 case "$module" in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
411 *-tests ) module= ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
412 * ) func_verify_module ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
413 esac |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
414 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
415 |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
416 # func_verify_tests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
417 # verifies a module name, considering only tests modules |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
418 func_verify_tests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
419 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
420 case "$module" in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
421 *-tests ) func_verify_module ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
422 * ) module= ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
423 esac |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
424 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
425 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
426 sed_extract_prog=':[ ]*$/ { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
427 :a |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
428 n |
4717
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
429 s/^Description:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
430 s/^Files:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
431 s/^Depends-on:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
432 s/^configure\.ac:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
433 s/^Makefile\.am:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
434 s/^Include:[ ]*$// |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
435 s/^License:[ ]*$// |
4717
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
436 s/^Maintainer:[ ]*$// |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
437 tb |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
438 p |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
439 ba |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
440 :b |
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 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
443 # func_get_description module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
444 func_get_description () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
445 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
446 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
|
447 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
448 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
449 # func_get_filelist module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
450 func_get_filelist () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
451 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
452 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
|
453 #echo m4/onceonly.m4 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
454 echo m4/onceonly_2_57.m4 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
455 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
456 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
457 # func_get_dependencies module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
458 func_get_dependencies () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
459 { |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
460 # ${module}-tests always implicitly depends on ${module}. |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
461 echo "$1" | sed -n -e 's/-tests//p' |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
462 # Then the explicit dependencies listed in the module description. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
463 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
|
464 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
465 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
466 # func_get_autoconf_snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
467 func_get_autoconf_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
468 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
469 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
|
470 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
471 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
472 # func_get_automake_snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
473 func_get_automake_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
474 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
475 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
|
476 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
477 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
478 # func_get_include_directive module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
479 func_get_include_directive () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
480 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
481 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
|
482 sed -e 's/^\(["<]\)/#include \1/' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
483 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
484 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
485 # func_get_license module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
486 func_get_license () |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
487 { |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
488 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
|
489 } |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
490 |
4197 | 491 # func_get_maintainer module |
492 func_get_maintainer () | |
493 { | |
494 sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1" | |
495 } | |
496 | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
497 # func_get_tests_module module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
498 func_get_tests_module () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
499 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
500 # 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
|
501 if test -f modules/"$1"-tests; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
502 echo "$1"-tests |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
503 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
504 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
505 |
5981 | 506 # func_acceptable module |
507 # tests whether a module is acceptable. | |
508 # Input: | |
509 # - avoidlist list of modules to avoid | |
510 func_acceptable () | |
511 { | |
512 for avoid in $avoidlist; do | |
513 if test "$avoid" = "$1"; then | |
514 return 1 | |
515 fi | |
516 done | |
517 return 0 | |
518 } | |
519 | |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
520 # func_modules_transitive_closure |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
521 # Input: |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
522 # - modules list of specified modules |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
523 # - inctests true if tests should be included, blank otherwise |
5981 | 524 # - 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
|
525 # Output: |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
526 # - 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
|
527 func_modules_transitive_closure () |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
528 { |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
529 while true; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
530 xmodules= |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
531 for module in $modules; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
532 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
533 if test -n "$module"; then |
5981 | 534 # Duplicate dependencies are harmless, but Jim wants a warning. |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
535 duplicated_deps=`func_get_dependencies $module | sort | uniq -d` |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
536 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
|
537 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
|
538 fi |
5981 | 539 if func_acceptable $module; then |
540 xmodules="$xmodules $module" | |
541 for depmodule in `func_get_dependencies $module`; do | |
542 if func_acceptable $depmodule; then | |
543 xmodules="$xmodules $depmodule" | |
544 fi | |
545 done | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
546 if test -n "$inctests"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
547 testsmodule=`func_get_tests_module $module` |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
548 if test -n "$testsmodule"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
549 if func_acceptable $testsmodule; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
550 xmodules="$xmodules $testsmodule" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
551 for depmodule in `func_get_dependencies $testsmodule`; do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
552 if func_acceptable $depmodule; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
553 xmodules="$xmodules $depmodule" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
554 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
555 done |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
556 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
557 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
558 fi |
5981 | 559 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
560 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
561 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
562 xmodules=`for m in $xmodules; do echo $m; done | sort | uniq` |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
563 if test "$xmodules" = "$modules"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
564 break |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
565 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
566 modules="$xmodules" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
567 done |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
568 } |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
569 |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
570 # func_modules_to_filelist |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
571 # Input: |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
572 # - 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
|
573 # Output: |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
574 # - files list of files |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
575 func_modules_to_filelist () |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
576 { |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
577 files= |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
578 for module in $modules; do |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
579 func_verify_module |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
580 if test -n "$module"; then |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
581 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
|
582 fi |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
583 done |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
584 files=`for f in $files; do echo $f; done | sort | uniq` |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
585 } |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
586 |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
587 # 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
|
588 # 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
|
589 # Input: |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
590 # - 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
|
591 # - libname library name |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
592 # - 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
|
593 # - cmd (optional) command that led to this invocation |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
594 # - 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
|
595 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
|
596 { |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
597 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
|
598 libext=la |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
599 perhapsLT=LT |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
600 else |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
601 libext=a |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
602 perhapsLT= |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
603 fi |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
604 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
|
605 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
|
606 echo "#" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
607 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
|
608 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
|
609 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
|
610 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
|
611 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
|
612 echo "#" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
613 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
|
614 if test -n "$cmd"; then |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
615 echo "# Invoked as: $cmd" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
616 fi |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
617 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
|
618 echo "# Reproduce by: $actioncmd" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
619 fi |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
620 echo |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
621 # 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
|
622 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
|
623 echo |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
624 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
|
625 echo |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
626 echo "${libname}_${libext}_SOURCES =" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
627 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
|
628 echo "EXTRA_DIST =" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
629 echo "BUILT_SOURCES =" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
630 echo "SUFFIXES =" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
631 echo "MOSTLYCLEANFILES =" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
632 echo "CLEANFILES =" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
633 echo "DISTCLEANFILES =" |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
634 echo "MAINTAINERCLEANFILES =" |
5352
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
635 echo |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
636 for module in $modules; do |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
637 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
|
638 if test -n "$module"; then |
5352
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
639 { |
5527
1270fb7d6695
(func_emit_lib_Makefile_am): Shorten a long sed command.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5358
diff
changeset
|
640 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
|
641 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
|
642 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
|
643 echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@" |
5352
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
644 fi |
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
645 } > amsnippet.tmp |
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
646 # Skip the contents if its entirely empty. |
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
647 if grep '[^ ]' amsnippet.tmp > /dev/null ; then |
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
648 echo "## begin gnulib module $module" |
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
649 echo |
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
650 cat amsnippet.tmp |
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
651 echo "## end gnulib module $module" |
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
652 echo |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
653 fi |
5352
f1f20fc1ff2f
Emit separators in lib/Makefile.am.
Bruno Haible <bruno@clisp.org>
parents:
5351
diff
changeset
|
654 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
|
655 fi |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
656 done |
5357
8bce169f70cc
Fix comments. Fix parse problem.
Simon Josefsson <simon@josefsson.org>
parents:
5356
diff
changeset
|
657 echo |
8bce169f70cc
Fix comments. Fix parse problem.
Simon Josefsson <simon@josefsson.org>
parents:
5356
diff
changeset
|
658 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
|
659 } |
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
660 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
661 # func_emit_tests_Makefile_am |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
662 # 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
|
663 # Input: |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
664 # - modules list of modules, including dependencies |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
665 # - libname library name |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
666 # - libtool true if libtool will be used, blank otherwise |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
667 # - sourcebase relative directory containing lib source code |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
668 func_emit_tests_Makefile_am () |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
669 { |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
670 if test -n "$libtool"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
671 libext=la |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
672 else |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
673 libext=a |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
674 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
675 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
|
676 echo "# Copyright (C) 2004-2005 Free Software Foundation, Inc." |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
677 echo "#" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
678 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
|
679 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
|
680 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
|
681 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
|
682 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
|
683 echo "#" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
684 echo "# Generated by gnulib-tool." |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
685 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
686 # 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
|
687 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
688 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
689 echo "ACLOCAL_AMFLAGS = -I ../m4" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
690 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
691 echo "TESTS =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
692 echo "noinst_PROGRAMS =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
693 echo "EXTRA_DIST =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
694 echo "BUILT_SOURCES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
695 echo "SUFFIXES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
696 echo "MOSTLYCLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
697 echo "CLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
698 echo "DISTCLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
699 echo "MAINTAINERCLEANFILES =" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
700 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
701 echo "AM_CPPFLAGS = \\" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
702 echo " -I. -I\$(srcdir) \\" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
703 echo " -I.. -I\$(srcdir)/.. \\" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
704 echo " -I../${sourcebase-lib} -I\$(srcdir)/../${sourcebase-lib}" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
705 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
706 echo "LDADD = ../${sourcebase-lib}/${libname}.${libext}" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
707 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
708 for module in $modules; do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
709 func_verify_tests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
710 if test -n "$module"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
711 func_get_automake_snippet "$module" > amsnippet.tmp |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
712 # Skip the contents if its entirely empty. |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
713 if grep '[^ ]' amsnippet.tmp > /dev/null ; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
714 echo "## begin gnulib module $module" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
715 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
716 cat amsnippet.tmp |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
717 echo "## end gnulib module $module" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
718 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
719 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
720 rm -f amsnippet.tmp |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
721 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
722 done |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
723 echo "# Clean up after Solaris cc." |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
724 echo "clean-local:" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
725 echo " rm -rf SunWS_cache" |
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 "# Makefile.am ends here" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
728 } |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
729 |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
730 # func_import modules |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
731 # Uses also the variables |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
732 # - destdir target directory |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
733 # - libname library name |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
734 # - 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
|
735 # - m4base directory relative to destdir where to place *.m4 macros |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
736 # - auxdir directory relative to destdir where to place build aux files |
5981 | 737 # - avoidlist list of modules to avoid, from --avoid |
738 # - 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
|
739 # - libtool true if libtool will be used, blank otherwise |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
740 # - dry_run true if actions shall only be printed, blank otherwise |
5799
ad9eff556694
2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
5798
diff
changeset
|
741 # - 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
|
742 # - supplied_opts all options passed to gnulib-tool |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
743 func_import () |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
744 { |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
745 modules="$1" |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
746 modules=`for m in $modules; do echo $m; done | sort | uniq` |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
747 |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
748 # Determine final module list. |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
749 func_modules_transitive_closure |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
750 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
|
751 echo "$modules" | sed -e 's/^/ /' |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
752 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
753 # 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
|
754 if test -n "$lgpl"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
755 for module in $modules; do |
5346 | 756 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
|
757 case $license in |
6039
93f48e27ac36
* gnulib-tool (sed_extract_prog): Recognize 'unlimited' license.
Simon Josefsson <simon@josefsson.org>
parents:
6021
diff
changeset
|
758 LGPL | 'public domain' | 'unlimited') ;; |
5963
6fb8c48c4dcd
* gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
759 *) |
6fb8c48c4dcd
* gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
760 func_fatal_error \ |
6fb8c48c4dcd
* gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
761 "incompatible license on module \`$module\`: $license" ;; |
6fb8c48c4dcd
* gnulib-tool (func_import): Add support for 'public domain' license.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5848
diff
changeset
|
762 esac |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
763 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
764 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
765 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
766 # Determine final file list. |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
767 func_modules_to_filelist |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
768 echo "File list:" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
769 echo "$files" | sed -e 's/^/ /' |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
770 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
771 test -n "$files" \ |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
772 || 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
|
773 |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
774 # Copy files or make symbolic links. |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
775 for f in $files; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
776 source= |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
777 case "$f" in |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
778 build-aux/*) g=`echo "$f" | sed -e "s,^build-aux/,$auxdir/,"` ;; |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
779 lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"`; source=true ;; |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
780 m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;; |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
781 *) g="$f" ;; |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
782 esac |
5799
ad9eff556694
2005-04-15 Simon Josefsson <jas@extundo.com>
Simon Josefsson <simon@josefsson.org>
parents:
5798
diff
changeset
|
783 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
|
784 func_cp_if_changed "$gnulib_dir/$f" "$destdir/$g" |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
785 else |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
786 func_ln_if_changed "$gnulib_dir/$f" "$destdir/$g" |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
787 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
788 # Update license. |
5350 | 789 if test -z "$dry_run" && test -n "$lgpl" && test -n "$source"; then |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
790 perl -pi -e 's/GNU General/GNU Lesser General/g;' \ |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
791 -e 's/version 2([ ,])/version 2.1\1/g' \ |
6159
a544c5156698
Protect references to destdir with double-quotes.
Bruno Haible <bruno@clisp.org>
parents:
6113
diff
changeset
|
792 "$destdir/$g" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
793 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
794 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
795 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
796 # Commands printed in a comment in generated files. |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
797 cmd="gnulib-tool $supplied_opts" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
798 opt_libtool= |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
799 if test -n "$libtool"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
800 opt_libtool="--libtool" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
801 fi |
5349 | 802 opt_lgpl= |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
803 if test -n "$lgpl"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
804 opt_lgpl="--lgpl" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
805 fi |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
806 actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base --aux-dir=$auxdir $opt_libtool $opt_lgpl `echo $modules`" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
807 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
808 # Create lib/Makefile.am. |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
809 echo "Creating $destdir/$sourcebase/Makefile.am..." |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
810 if test -z "$dry_run"; then |
6159
a544c5156698
Protect references to destdir with double-quotes.
Bruno Haible <bruno@clisp.org>
parents:
6113
diff
changeset
|
811 func_emit_lib_Makefile_am > "$destdir"/$sourcebase/Makefile.am.new |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
812 else |
5351
7c565c8ecabc
Move duplicated code into function func_emit_lib_Makefile_am().
Bruno Haible <bruno@clisp.org>
parents:
5350
diff
changeset
|
813 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
|
814 fi |
6159
a544c5156698
Protect references to destdir with double-quotes.
Bruno Haible <bruno@clisp.org>
parents:
6113
diff
changeset
|
815 func_mv_if_changed "$destdir"/$sourcebase/Makefile.am.new \ |
a544c5156698
Protect references to destdir with double-quotes.
Bruno Haible <bruno@clisp.org>
parents:
6113
diff
changeset
|
816 "$destdir"/$sourcebase/Makefile.am |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
817 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
818 # Create gnulib.m4. |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
819 echo "Creating $destdir/$m4base/gnulib.m4..." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
820 ( |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
821 if test -z "$dry_run"; then |
6159
a544c5156698
Protect references to destdir with double-quotes.
Bruno Haible <bruno@clisp.org>
parents:
6113
diff
changeset
|
822 exec > "$destdir"/$m4base/gnulib.m4.new |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
823 else |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
824 echo "# $destdir/$m4base/gnulib.m4" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
825 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
826 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
|
827 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
|
828 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
|
829 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
|
830 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
|
831 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
|
832 echo "#" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
833 echo "# Generated by gnulib-tool." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
834 echo "#" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
835 echo "# Invoked as: $cmd" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
836 echo "# Reproduce by: $actioncmd" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
837 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
838 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
|
839 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
|
840 echo "# any checks for libraries, header files, types and library functions." |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
841 echo "AC_DEFUN([gl_EARLY]," |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
842 echo "[" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
843 if grep AC_GNU_SOURCE "$destdir"/$m4base/*.m4 > /dev/null; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
844 echo " AC_GNU_SOURCE" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
845 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
846 if grep gl_USE_SYSTEM_EXTENSIONS "$destdir"/$m4base/*.m4 > /dev/null; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
847 echo " gl_USE_SYSTEM_EXTENSIONS" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
848 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
849 echo "])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
850 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
851 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
|
852 echo "# \"Check for header files, types and library functions\"." |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
853 echo "AC_DEFUN([gl_INIT]," |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
854 echo "[" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
855 for module in $modules; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
856 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
857 if test -n "$module"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
858 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
|
859 if test "$module" = 'alloca' && test -n "$libtool"; then |
5356
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
860 echo 'changequote(,)dnl' |
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
861 echo 'LTALLOCA=`echo "$ALLOCA" | sed '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`' |
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
862 echo 'changequote([, ])dnl' |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
863 echo 'AC_SUBST([LTALLOCA])' |
5356
144b29bba7b7
Provisions for defining LTALLOCA.
Bruno Haible <bruno@clisp.org>
parents:
5353
diff
changeset
|
864 fi |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
865 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
866 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
867 echo "])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
868 echo |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
869 echo "dnl Usage: gl_MODULES([module1 module2 ...])" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
870 echo "AC_DEFUN([gl_MODULES], [])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
871 echo |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
872 echo "dnl Usage: gl_AVOID([module1 module2 ...])" |
6021 | 873 echo "AC_DEFUN([gl_AVOID], [])" |
874 echo | |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
875 echo "dnl Usage: gl_SOURCE_BASE([DIR])" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
876 echo "AC_DEFUN([gl_SOURCE_BASE], [])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
877 echo |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
878 echo "dnl Usage: gl_M4_BASE([DIR])" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
879 echo "AC_DEFUN([gl_M4_BASE], [])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
880 echo |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
881 echo "dnl Usage: gl_LIB([LIBNAME])" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
882 echo "AC_DEFUN([gl_LIB], [])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
883 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
884 echo "dnl Usage: gl_LGPL" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
885 echo "AC_DEFUN([gl_LGPL], [])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
886 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
887 echo "# gnulib.m4 ends here" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
888 ) |
6159
a544c5156698
Protect references to destdir with double-quotes.
Bruno Haible <bruno@clisp.org>
parents:
6113
diff
changeset
|
889 func_mv_if_changed "$destdir"/$m4base/gnulib.m4.new "$destdir"/$m4base/gnulib.m4 |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
890 echo "Finished." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
891 echo |
5572
54000928a33d
Print #include directives when --import'ing.
Simon Josefsson <simon@josefsson.org>
parents:
5527
diff
changeset
|
892 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
|
893 for module in $modules; do |
5845
918e52aa283d
(func_import): Sort and uniquify recommended includes.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5805
diff
changeset
|
894 func_get_include_directive "$module" |
918e52aa283d
(func_import): Sort and uniquify recommended includes.
Paul Eggert <eggert@cs.ucla.edu>
parents:
5805
diff
changeset
|
895 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
|
896 echo |
6160
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
897 echo "Don't forget to" |
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
898 echo " - add \"$sourcebase/Makefile\" to AC_CONFIG_FILES in $configure_ac," |
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
899 sourcebase_dir=`echo "$sourcebase" | sed -n -e 's,/[^/]*$,/,p'` |
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
900 sourcebase_base=`basename "$sourcebase"` |
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
901 echo " - mention \"${sourcebase_base}\" in SUBDIRS in ${sourcebase_dir}Makefile.am," |
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
902 echo " - mention \"-I ${m4base}\" in ACLOCAL_AMFLAGS in Makefile.am," |
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
903 echo " - invoke gl_EARLY in $configure_ac, right after AC_PROG_CC," |
2fb771c0af6b
Emit more comments and advice.
Bruno Haible <bruno@clisp.org>
parents:
6159
diff
changeset
|
904 echo " - invoke gl_INIT in $configure_ac." |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
905 } |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
906 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
907 # func_create_testdir testdir modules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
908 # Input: |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
909 # - 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
|
910 func_create_testdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
911 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
912 testdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
913 modules="$2" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
914 modules=`for m in $modules; do echo $m; done | sort | uniq` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
915 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
916 # Determine final module list. |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
917 func_modules_transitive_closure |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
918 echo "Module list with included dependencies:" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
919 echo "$modules" | sed -e 's/^/ /' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
920 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
921 # Determine final file list. |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
922 func_modules_to_filelist |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
923 echo "File list:" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
924 echo "$files" | sed -e 's/^/ /' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
925 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
926 # Create directories. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
927 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
|
928 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
|
929 mkdir -p "$testdir/$auxdir" |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
930 else |
4175
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
931 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
|
932 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
933 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
934 |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
935 # Copy files or make symbolic links. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
936 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
|
937 case "$f" in |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
938 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
|
939 *) g="$f" ;; |
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
940 esac |
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
941 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
|
942 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
|
943 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
|
944 else |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
945 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
|
946 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
947 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
948 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
949 # Create lib/Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
950 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
|
951 func_emit_lib_Makefile_am > "$testdir/lib/Makefile.am" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
952 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
953 # Create m4/Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
954 mkdir -p "$testdir/m4" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
955 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
956 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
957 echo "EXTRA_DIST =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
958 for f in $files; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
959 case "$f" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
960 m4/* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
961 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
962 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
963 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
964 ) > "$testdir/m4/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
965 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
966 subdirs="lib m4" |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
967 subdirs_with_configure_ac="" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
968 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
969 if test -f "$testdir"/m4/gettext.m4; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
970 # Avoid stupid error message from automake: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
971 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
972 mkdir -p "$testdir/po" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
973 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
974 ) > "$testdir/po/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
975 subdirs="$subdirs po" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
976 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
977 |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
978 if test -n "$inctests"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
979 test -d "$testdir/tests" || mkdir "$testdir/tests" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
980 # Create tests/Makefile.am. |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
981 sourcebase=lib |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
982 func_emit_tests_Makefile_am > "$testdir/tests/Makefile.am" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
983 # Create tests/configure.ac. |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
984 (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
|
985 echo "AC_INIT([dummy], [0])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
986 echo "AC_CONFIG_AUX_DIR([../$auxdir])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
987 echo "AM_INIT_AUTOMAKE" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
988 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
989 echo "AM_CONFIG_HEADER([config.h])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
990 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
991 echo "AC_PROG_CC" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
992 echo "AC_PROG_INSTALL" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
993 echo "AC_PROG_MAKE_SET" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
994 echo "AC_PROG_RANLIB" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
995 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
996 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
|
997 echo "AC_GNU_SOURCE" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
998 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
999 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1000 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
|
1001 echo "gl_USE_SYSTEM_EXTENSIONS" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1002 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1003 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1004 # 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
|
1005 # 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
|
1006 # those of the tests. |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1007 for module in $modules; do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1008 func_verify_nontests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1009 if test -n "$module"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1010 func_get_autoconf_snippet "$module" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1011 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1012 done |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1013 for module in $modules; do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1014 func_verify_tests_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1015 if test -n "$module"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1016 func_get_autoconf_snippet "$module" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1017 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1018 done |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1019 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1020 # 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
|
1021 # "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
|
1022 echo "AH_TOP([#include \"../config.h\"])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1023 echo |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1024 echo "AC_OUTPUT([Makefile])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1025 ) > "$testdir/tests/configure.ac" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1026 subdirs="$subdirs tests" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1027 subdirs_with_configure_ac="$subdirs_with_configure_ac tests" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1028 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1029 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1030 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1031 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1032 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1033 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1034 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1035 echo "SUBDIRS = $subdirs" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1036 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1037 echo "ACLOCAL_AMFLAGS = -I m4" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1038 ) > "$testdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1039 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1040 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1041 (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
|
1042 echo "AC_INIT([dummy], [0])" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1043 if test "$auxdir" != "."; then |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1044 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1045 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1046 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1047 echo |
6106
66bd85c8a9cd
Proper autoconf macro argument quoting.
Bruno Haible <bruno@clisp.org>
parents:
6039
diff
changeset
|
1048 echo "AM_CONFIG_HEADER([config.h])" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1049 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1050 echo "AC_PROG_CC" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1051 echo "AC_PROG_INSTALL" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1052 echo "AC_PROG_MAKE_SET" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1053 echo "AC_PROG_RANLIB" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1054 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1055 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
|
1056 echo "AC_GNU_SOURCE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1057 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1058 fi |
4586
eb1b4acf2e86
Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents:
4325
diff
changeset
|
1059 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
|
1060 echo "gl_USE_SYSTEM_EXTENSIONS" |
eb1b4acf2e86
Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents:
4325
diff
changeset
|
1061 echo |
eb1b4acf2e86
Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents:
4325
diff
changeset
|
1062 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1063 for module in $modules; do |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1064 func_verify_nontests_module |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1065 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1066 func_get_autoconf_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1067 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1068 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1069 echo |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1070 if test -n "$subdirs_with_configure_ac"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1071 echo "AC_CONFIG_SUBDIRS(["`echo $subdirs_with_configure_ac`"])" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1072 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1073 makefiles="Makefile" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1074 for d in $subdirs; do |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1075 # 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
|
1076 # 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
|
1077 case " $subdirs_with_configure_ac " in |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1078 *" $d "*) ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1079 *) makefiles="$makefiles $d/Makefile" ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1080 esac |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1081 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1082 echo "AC_OUTPUT([$makefiles])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1083 ) > "$testdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1084 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1085 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1086 (cd "$testdir" |
5237
bd85db908172
Replace various ad-hoc automake/autoconf/aclocal
Paul Eggert <eggert@cs.ucla.edu>
parents:
5202
diff
changeset
|
1087 echo "executing ${AUTORECONF} --force --install" |
bd85db908172
Replace various ad-hoc automake/autoconf/aclocal
Paul Eggert <eggert@cs.ucla.edu>
parents:
5202
diff
changeset
|
1088 ${AUTORECONF} --force --install |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1089 ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1090 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
|
1091 (cd "$testdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1092 ./configure |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1093 cd lib |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1094 built_sources=`grep '^BUILT_SOURCES *=' Makefile.in | sed -e 's/^BUILT_SOURCES *=//'` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1095 if test -n "$built_sources"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1096 make $built_sources |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1097 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1098 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1099 make distclean |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1100 ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1101 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1102 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1103 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1104 # func_create_megatestdir megatestdir allmodules |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1105 # Input: |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1106 # - 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
|
1107 func_create_megatestdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1108 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1109 megatestdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1110 allmodules="$2" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1111 if test -z "$allmodules"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1112 allmodules=`func_all_modules` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1113 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1114 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1115 megasubdirs= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1116 # First, all modules one by one. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1117 for onemodule in $allmodules; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1118 func_create_testdir "$megatestdir/$onemodule" $onemodule |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1119 megasubdirs="${megasubdirs}$onemodule " |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1120 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1121 # Then, all modules all together. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1122 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1123 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
|
1124 func_create_testdir "$megatestdir/ALL" "$allmodules" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1125 megasubdirs="${megasubdirs}ALL" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1126 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1127 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1128 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1129 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1130 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1131 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1132 echo "SUBDIRS = $megasubdirs" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1133 ) > "$megatestdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1134 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1135 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1136 (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
|
1137 echo "AC_INIT([dummy], [0])" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1138 if test "$auxdir" != "."; then |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1139 echo "AC_CONFIG_AUX_DIR([$auxdir])" |
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1140 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1141 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1142 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1143 echo "AC_PROG_MAKE_SET" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1144 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1145 echo "AC_CONFIG_SUBDIRS([$megasubdirs])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1146 echo "AC_OUTPUT([Makefile])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1147 ) > "$megatestdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1148 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1149 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1150 (cd "$megatestdir" |
6110 | 1151 echo "executing ${AUTORECONF} --install" |
1152 ${AUTORECONF} --install | |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1153 ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1154 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1155 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1156 case $mode in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1157 "" ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1158 func_fatal_error "no mode specified" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1159 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1160 list ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1161 func_all_modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1162 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1163 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1164 import ) |
5343 | 1165 # Where to import. |
1166 if test -z "$destdir"; then | |
1167 destdir=. | |
1168 fi | |
1169 test -d "$destdir" \ | |
1170 || 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
|
1171 |
5343 | 1172 # Prefer configure.ac to configure.in |
6159
a544c5156698
Protect references to destdir with double-quotes.
Bruno Haible <bruno@clisp.org>
parents:
6113
diff
changeset
|
1173 test -f "$destdir"/configure.in && configure_ac="$destdir/configure.in" |
a544c5156698
Protect references to destdir with double-quotes.
Bruno Haible <bruno@clisp.org>
parents:
6113
diff
changeset
|
1174 test -f "$destdir"/configure.ac && configure_ac="$destdir/configure.ac" |
5343 | 1175 test -f "$configure_ac" \ |
1176 || func_fatal_error "cannot find $destdir/configure.ac" | |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1177 |
5343 | 1178 # Get settings. |
1179 my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; | |
1180 /gl_MODULES[^_]/ { | |
1181 s,^.*gl_MODULES([[ ]*\([^])]*\).*$,ac_modules="\1",; p; | |
1182 }; | |
6021 | 1183 /gl_AVOID[^_]/ { |
1184 s,^.*gl_AVOID([[ ]*\([^])]*\).*$,ac_avoidlist="\1",; p; | |
1185 }; | |
5343 | 1186 /gl_SOURCE_BASE/ { |
1187 s,^.*gl_SOURCE_BASE([[ ]*\([^])]*\).*$,ac_sourcebase="\1",; p; | |
1188 }; | |
1189 /gl_M4_BASE/ { | |
1190 s,^.*gl_M4_BASE([[ ]*\([^])]*\).*$,ac_m4base="\1",; p; | |
1191 }; | |
1192 /gl_LIB/ { | |
1193 s,^.*gl_LIB([[ ]*\([^])]*\).*$,ac_libname="\1",; p; | |
1194 }; | |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1195 /AC_CONFIG_AUX_DIR/ { |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1196 s,^.*AC_CONFIG_AUX_DIR([[ ]*\([^])]*\).*$,ac_auxdir="\1",; p; |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1197 } |
5343 | 1198 /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; }; |
1199 /LT_INIT/ { s,^.*$,seen_libtool=:,; p; }; | |
1200 /gl_LGPL/ { s,^.*$,lgpl=true,; p; }; | |
1201 d;' | |
1202 eval `cat $configure_ac | sed "$my_sed_traces"` | |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1203 |
5343 | 1204 # Override libname? |
1205 if test -z "$supplied_libname" && test -n "$ac_libname"; then | |
1206 libname="$ac_libname" | |
1207 fi | |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1208 |
5343 | 1209 # Set up source base. |
1210 test -z "$sourcebase" && sourcebase="$ac_sourcebase" | |
1211 test -z "$sourcebase" && sourcebase="lib" | |
1212 test -d "$destdir/$sourcebase" \ | |
6108
407f87744cd3
Use compound statement instead of subshell.
Bruno Haible <bruno@clisp.org>
parents:
6107
diff
changeset
|
1213 || { test -z "$dry_run" && mkdir "$destdir/$sourcebase"; } \ |
5343 | 1214 || func_fatal_error "source base $destdir/$sourcebase doesn't exist" |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1215 |
5343 | 1216 # Set up m4 base. |
1217 test -z "$m4base" && m4base="$ac_m4base" | |
1218 test -z "$m4base" && m4base="m4" | |
1219 test -d "$destdir/$m4base" \ | |
6108
407f87744cd3
Use compound statement instead of subshell.
Bruno Haible <bruno@clisp.org>
parents:
6107
diff
changeset
|
1220 || { test -z "$dry_run" && mkdir "$destdir/$m4base"; } \ |
5343 | 1221 || func_fatal_error "m4 base $destdir/$m4base doesn't exist" |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1222 |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1223 # Set up auxiliary directory. |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1224 test -z "$auxdir" && auxdir="$ac_auxdir" |
6107
286b9067dfd4
Change --aux-dir default to "build-aux".
Bruno Haible <bruno@clisp.org>
parents:
6106
diff
changeset
|
1225 test -z "$auxdir" && auxdir="build-aux" |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1226 test -d "$destdir/$auxdir" \ |
6108
407f87744cd3
Use compound statement instead of subshell.
Bruno Haible <bruno@clisp.org>
parents:
6107
diff
changeset
|
1227 || { test -z "$dry_run" && mkdir "$destdir/$auxdir"; } \ |
5798
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1228 || func_fatal_error "aux directory $destdir/$auxdir doesn't exist" |
49900d80eaaf
2005-04-15 Oskar Liljeblad <oskar@osk.mine.nu>
Simon Josefsson <simon@josefsson.org>
parents:
5685
diff
changeset
|
1229 |
5343 | 1230 # Using libtool? |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1231 if test -n "$seen_libtool"; then |
5343 | 1232 libtool=true |
1233 fi | |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
1234 |
5343 | 1235 # What modules to extract. |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1236 if test $# = 0; then |
5343 | 1237 modules="$ac_modules" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1238 else |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1239 modules="$*" |
5343 | 1240 fi |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
1241 |
6021 | 1242 # Which modules to avoid? |
6161
09720f424348
Avoid unnecessary spaces in $avoidlist.
Bruno Haible <bruno@clisp.org>
parents:
6160
diff
changeset
|
1243 avoidlist=`echo $avoidlist $ac_avoidlist` |
6021 | 1244 |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
1245 func_import "$modules" |
5343 | 1246 ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1247 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1248 create-testdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1249 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1250 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1251 fi |
4126
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
1252 mkdir "$destdir" |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
1253 test -d "$destdir" \ |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
1254 || func_fatal_error "could not create destination directory" |
6109
a52f596fdf00
Generalize support for --aux-dir.
Bruno Haible <bruno@clisp.org>
parents:
6108
diff
changeset
|
1255 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1256 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1257 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1258 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1259 create-megatestdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1260 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1261 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1262 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1263 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
|
1264 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1265 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1266 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1267 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1268 test ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1269 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1270 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
|
1271 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1272 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1273 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1274 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1275 cd build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1276 ../configure |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1277 make |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1278 make check |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1279 make distclean |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1280 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1281 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1282 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1283 echo "gnulib-tool: *** Stop." 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1284 exit 1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1285 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1286 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1287 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1288 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1289 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1290 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1291 megatest ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1292 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1293 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
|
1294 test -n "$auxdir" || auxdir="build-aux" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1295 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1296 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1297 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1298 cd build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1299 ../configure |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1300 make |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1301 make check |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1302 make distclean |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1303 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1304 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1305 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1306 echo "gnulib-tool: *** Stop." 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1307 exit 1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1308 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1309 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1310 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1311 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1312 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1313 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1314 extract-description ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1315 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1316 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1317 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1318 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1319 func_get_description "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1320 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1321 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1322 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1323 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1324 extract-filelist ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1325 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1326 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1327 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1328 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1329 func_get_filelist "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1330 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1331 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1332 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1333 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1334 extract-dependencies ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1335 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1336 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1337 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1338 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1339 func_get_dependencies "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1340 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1341 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1342 ;; |
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 extract-autoconf-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1345 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1346 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1347 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1348 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1349 func_get_autoconf_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1350 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1351 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1352 ;; |
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 extract-automake-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1355 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1356 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1357 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1358 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1359 func_get_automake_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1360 fi |
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 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1363 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1364 extract-include-directive ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1365 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1366 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1367 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1368 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1369 func_get_include_directive "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1370 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1371 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1372 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1373 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1374 extract-license ) |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1375 for module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1376 do |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1377 func_verify_module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1378 if test -n "$module"; then |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1379 func_get_license "$module" |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1380 fi |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1381 done |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1382 ;; |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
1383 |
4197 | 1384 extract-maintainer ) |
1385 for module | |
1386 do | |
1387 func_verify_module | |
1388 if test -n "$module"; then | |
1389 func_get_maintainer "$module" | |
1390 fi | |
1391 done | |
1392 ;; | |
1393 | |
6113
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1394 extract-tests-module ) |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1395 for module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1396 do |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1397 func_verify_module |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1398 if test -n "$module"; then |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1399 func_get_tests_module "$module" |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1400 fi |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1401 done |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1402 ;; |
dac0e048bd40
Support for unit test modules.
Bruno Haible <bruno@clisp.org>
parents:
6111
diff
changeset
|
1403 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1404 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1405 func_fatal_error "unknown operation mode --$mode" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1406 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1407 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1408 exit 0 |