Mercurial > hg > octave-lojdl > gnulib-hg
annotate gnulib-tool @ 5348:6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 15 Oct 2004 15:40:45 +0000 |
parents | 0318c37925dc |
children | 3644893488ed |
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 # |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
3 # Copyright (C) 2002, 2003, 2004 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 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
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 |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
25 cvsdatestamp='$Date: 2004-10-15 15:40:45 $' |
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 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
59 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
60 Operation modes: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
61 --list print the available module names |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
62 --import import the given modules into the current package |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 --create-testdir create a scratch package with the given modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
64 --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
|
65 one by one and all together |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
66 --test test the combination of the given modules |
4197 | 67 (recommended to use CC=\"gcc -Wall\" here) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
68 --megatest test the given modules one by one and all together |
4197 | 69 (recommended to use CC=\"gcc -Wall\" here) |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
70 --extract-description extract the description |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
71 --extract-filelist extract the list of files |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
72 --extract-dependencies extract the dependencies |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
73 --extract-autoconf-snippet extract the snippet for configure.ac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
74 --extract-automake-snippet extract the snippet for lib/Makefile.am |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
75 --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
|
76 --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
|
77 under lib/ |
4197 | 78 --extract-maintainer report the maintainer(s) inside gnulib |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
79 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
80 Options: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
81 --dir=DIRECTORY specify the target directory |
5344
c2f5677fc6ed
Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents:
5343
diff
changeset
|
82 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
|
83 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
|
84 directory. |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
85 --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
|
86 --source-base=DIRECTORY |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
87 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
|
88 placed (default \"lib\"), for --import. |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
89 --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
|
90 placed (default \"m4\"), for --import. |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
91 --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
|
92 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
|
93 --libtool Use libtool rules, for --import. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
94 --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
|
95 --dry-run For --import, only print what would have been done. |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
96 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
97 Report bugs to <bug-gnulib@gnu.org>." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
98 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
99 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
100 # func_version |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
101 # outputs to stdout the --version message. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
102 func_version () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
103 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
104 echo "$progname (GNU $package) $version" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
105 echo "Copyright (C) 2002 Free Software Foundation, Inc. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
106 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
|
107 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
108 echo "Written by" "Bruno Haible" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
109 } |
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 # func_fatal_error message |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
112 # 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
|
113 func_fatal_error () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
114 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
115 echo "gnulib-tool: *** $1" 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
116 echo "gnulib-tool: *** Stop." 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
117 exit 1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
118 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
119 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
120 # Command-line option processing. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
121 # Removes the OPTIONS from the arguments. Sets the variables: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
122 # - mode list or import or create-testdir or create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
123 # - destdir from --dir |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
124 # - libname, supplied_libname from --lib |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
125 # - sourcebase from --source-base |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
126 # - m4base from --m4-base |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
127 # - libtool true if --libtool was given, blank otherwise |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
128 # - lgpl true if --lgpl was given, blank otherwise |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
129 # - 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
|
130 # - 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
|
131 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
132 mode= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
133 destdir= |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
134 libname=libgnu |
5344
c2f5677fc6ed
Initialize supplied_libname. Tweak usage message.
Bruno Haible <bruno@clisp.org>
parents:
5343
diff
changeset
|
135 supplied_libname= |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
136 sourcebase= |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
137 m4base= |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
138 libtool= |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
139 lgpl= |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
140 do_changelog=: |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
141 dry_run= |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
142 lgpl= |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
143 |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
144 supplied_opts="$@" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
145 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
146 while test $# -gt 0; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
147 case "$1" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
148 --list | --lis ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
149 mode=list |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
150 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
151 --import | --impor | --impo | --imp | --im | --i ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
152 mode=import |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
153 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
154 --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
|
155 mode=create-testdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
156 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
157 --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
|
158 mode=create-megatestdir |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
159 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
160 --test | --tes | --te | --t ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
161 mode=test |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
162 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
163 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
164 mode=megatest |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
165 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
166 --extract-* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
167 mode=`echo "X$1" | sed -e 's/^X--//'` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
168 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
169 --dir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
170 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
171 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
172 func_fatal_error "missing argument for --dir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
173 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
174 destdir=$1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
175 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
176 --dir=* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
177 destdir=`echo "X$1" | sed -e 's/^X--dir=//'` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
178 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
179 --lib ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
180 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
181 if test $# = 0; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
182 func_fatal_error "missing argument for --lib" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
183 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
184 libname=$1 |
5343 | 185 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
186 shift ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
187 --lib=* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
188 libname=`echo "X$1" | sed -e 's/^X--lib=//'` |
5343 | 189 supplied_libname=true |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
190 shift ;; |
5198
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
191 --source-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
192 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
193 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
194 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
|
195 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
196 sourcebase=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
197 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
198 --source-base=* ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
199 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
|
200 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
201 --m4-base ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
202 shift |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
203 if test $# = 0; then |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
204 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
|
205 fi |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
206 m4base=$1 |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
207 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
208 --m4-base=* ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
209 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
|
210 shift ;; |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
211 --libtool ) |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
212 libtool=true |
9317c9ebe82c
Add --source-base, --m4-base, --libtool options.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4717
diff
changeset
|
213 shift ;; |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
214 --lgpl ) |
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
215 lgpl=true |
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
216 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
217 --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
|
218 do_changelog=false |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
219 shift ;; |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
220 --dry-run ) |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
221 dry_run=true |
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
222 shift ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
223 --help | --hel | --he | --h ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
224 func_usage |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
225 exit 0 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
226 --version | --versio | --versi | --vers | --ver | --ve | --v ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
227 func_version |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
228 exit 0 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
229 -- ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
230 # Stop option prcessing |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
231 shift |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
232 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
233 -* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
234 echo "gnulib-tool: unknown option $1" 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
235 echo "Try 'gnulib-tool --help' for more information." 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
236 exit 1 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
237 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
238 break ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
239 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
240 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
241 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
242 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
243 case "$0" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
244 /*) self_abspathname="$0" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
245 */*) self_abspathname=`pwd`/"$0" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
246 *) 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
|
247 if test -x "$d/$0" && test ! -d "$d/$0"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
248 self_abspathname="$d/$0" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
249 break |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
250 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
251 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
252 if test -z "$self_abspathname"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
253 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
|
254 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
255 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
256 esac |
4717
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
257 while test -h "$self_abspathname"; do |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
258 # Resolve symbolic link. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
259 sedexpr1='s, -> ,#%%#,' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
260 sedexpr2='s,^.*#%%#\(.*\)$,\1,p' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
261 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
|
262 test -n "$linkval" || break |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
263 case "$linkval" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
264 /* ) self_abspathname="$linkval" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
265 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
266 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
267 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
268 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
269 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
270 # func_all_modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
271 func_all_modules () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
272 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
273 (cd "$gnulib_dir/modules" && ls -1) \ |
5312 | 274 | sed -e '/^CVS$/d' -e '/^ChangeLog$/d' -e '/^README$/d' -e '/^TEMPLATE$/d' -e '/~$/d' \ |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
275 | sort |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
276 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
277 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
278 # func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
279 # verifies a module name |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
280 func_verify_module () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
281 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
282 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
|
283 || test "CVS" = "$module" \ |
1346b5405a74
(func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents:
4126
diff
changeset
|
284 || test "ChangeLog" = "$module" \ |
5312 | 285 || test "README" = "$module" \ |
4128
1346b5405a74
(func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents:
4126
diff
changeset
|
286 || test "TEMPLATE" = "$module"; then |
1346b5405a74
(func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents:
4126
diff
changeset
|
287 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
|
288 module= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
289 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
290 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
291 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
292 sed_extract_prog=':[ ]*$/ { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
293 :a |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
294 n |
4717
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
295 s/^Description:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
296 s/^Files:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
297 s/^Depends-on:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
298 s/^configure\.ac:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
299 s/^Makefile\.am:[ ]*$// |
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
300 s/^Include:[ ]*$// |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
301 s/^License:[ ]*$// |
4717
ed7cd4050365
Port gnulib-tool to Solaris 8.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4712
diff
changeset
|
302 s/^Maintainer:[ ]*$// |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
303 tb |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
304 p |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
305 ba |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
306 :b |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
307 }' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
308 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
309 # func_get_description module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
310 func_get_description () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
311 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
312 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
|
313 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
314 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
315 # func_get_filelist module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
316 func_get_filelist () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
317 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
318 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
|
319 #echo m4/onceonly.m4 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
320 echo m4/onceonly_2_57.m4 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
321 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
322 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
323 # func_get_dependencies module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
324 func_get_dependencies () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
325 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
326 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
|
327 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
328 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
329 # func_get_autoconf_snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
330 func_get_autoconf_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
331 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
332 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
|
333 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
334 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
335 # func_get_automake_snippet module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
336 func_get_automake_snippet () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
337 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
338 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
|
339 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
340 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
341 # func_get_include_directive module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
342 func_get_include_directive () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
343 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
344 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
|
345 sed -e 's/^\(["<]\)/#include \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 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
348 # func_get_license module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
349 func_get_license () |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
350 { |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
351 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
|
352 } |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
353 |
4197 | 354 # func_get_maintainer module |
355 func_get_maintainer () | |
356 { | |
357 sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1" | |
358 } | |
359 | |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
360 # func_modules_transitive_closure |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
361 # Input: |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
362 # - modules list of specified modules |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
363 # Output: |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
364 # - 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
|
365 func_modules_transitive_closure () |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
366 { |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
367 while true; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
368 xmodules= |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
369 for module in $modules; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
370 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
371 if test -n "$module"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
372 # Duplicate dependenies are harmless, but Jim wants a warning. |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
373 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
|
374 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
|
375 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
|
376 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
377 xmodules="$xmodules $module "`func_get_dependencies $module` |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
378 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
379 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
380 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
|
381 if test "$xmodules" = "$modules"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
382 break |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
383 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
384 modules="$xmodules" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
385 done |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
386 } |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
387 |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
388 # func_modules_to_filelist |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
389 # Input: |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
390 # - 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
|
391 # Output: |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
392 # - files list of files |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
393 func_modules_to_filelist () |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
394 { |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
395 files= |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
396 for module in $modules; do |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
397 func_verify_module |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
398 if test -n "$module"; then |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
399 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
|
400 fi |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
401 done |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
402 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
|
403 } |
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
404 |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
405 # func_import modules |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
406 # Uses also the variables |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
407 # - destdir target directory |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
408 # - libname library name |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
409 # - 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
|
410 # - m4base directory relative to destdir where to place *.m4 macros |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
411 # - lgpl true if library's license shall be LGPL, blank otherwise |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
412 # - dry_run true if actions shall only be printed, blank otherwise |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
413 # - 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
|
414 func_import () |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
415 { |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
416 modules="$1" |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
417 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
|
418 |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
419 # Determine final module list. |
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
420 func_modules_transitive_closure |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
421 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
|
422 echo "$modules" | sed -e 's/^/ /' |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
423 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
424 # 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
|
425 if test -n "$lgpl"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
426 for module in $modules; do |
5346 | 427 license=`func_get_license $module` |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
428 if test $license != LGPL; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
429 func_fatal_error "incompatible license on module \`$module\`: $license" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
430 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
431 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
432 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
433 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
434 # Determine final file list. |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
435 func_modules_to_filelist |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
436 echo "File list:" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
437 echo "$files" | sed -e 's/^/ /' |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
438 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
439 test -n "$files" \ |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
440 || 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
|
441 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
442 # Copy files. |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
443 for f in $files; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
444 source= |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
445 case "$f" in |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
446 config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;; |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
447 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
|
448 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
|
449 *) g="$f" ;; |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
450 esac |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
451 test -n "$dry_run" && dry=echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
452 $dry cp -p "$gnulib_dir/$f" "$destdir/$g" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
453 # Update license. |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
454 if test -z "$dry_run" -a -n "$lgpl" -a -n "$source"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
455 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
|
456 -e 's/version 2([ ,])/version 2.1\1/g' \ |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
457 $destdir/$g |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
458 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
459 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
460 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
461 # 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
|
462 cmd="gnulib-tool $supplied_opts" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
463 opt_libtool= |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
464 if test -n "$libtool"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
465 opt_libtool="--libtool" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
466 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
467 if test -n "$lgpl"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
468 opt_lgpl="--lgpl" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
469 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
470 actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base $opt_libtool $opt_lgpl `echo $modules`" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
471 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
472 # Create lib/Makefile.am. |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
473 echo "Creating $destdir/$sourcebase/Makefile.am..." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
474 if test -n "$libtool"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
475 libext=la |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
476 perhapsLT=LT |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
477 else |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
478 libext=a |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
479 perhapsLT= |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
480 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
481 ( |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
482 if test -z "$dry_run"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
483 exec > $destdir/$sourcebase/Makefile.am |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
484 else |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
485 echo "# $destdir/$sourcebase/Makefile.am" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
486 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
487 echo "## Process this file with automake to produce Makefile.in." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
488 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
|
489 echo "#" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
490 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
|
491 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
|
492 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
|
493 echo "# that contains a configuration script generated by Automake, under" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
494 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
|
495 echo "#" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
496 echo "# Generated by gnulib-tool." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
497 echo "#" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
498 echo "# Invoked as: $cmd" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
499 echo "# Reproduce by: $actioncmd" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
500 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
501 echo "AUTOMAKE_OPTIONS = 1.8 gnits" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
502 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
503 echo "noinst_${perhapsLT}LIBRARIES = $libname.$libext" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
504 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
505 echo "${libname}_${libext}_SOURCES =" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
506 echo "${libname}_${libext}_LIBADD = @${perhapsLT}LIBOBJS@" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
507 echo "EXTRA_DIST =" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
508 echo "BUILT_SOURCES =" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
509 echo "SUFFIXES =" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
510 echo "MOSTLYCLEANFILES =" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
511 echo "CLEANFILES =" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
512 echo "DISTCLEANFILES =" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
513 echo "MAINTAINERCLEANFILES =" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
514 for module in $modules; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
515 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
516 if test -n "$module"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
517 func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,${libname}_${libext}_SOURCES,g" -e "s,lib_OBJECTS,${libname}_${libext}_OBJECTS,g" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
518 if test "$module" = 'alloca'; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
519 echo "${libname}_${libext}_LIBADD += @ALLOCA@" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
520 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
521 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
522 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
523 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
524 echo "# Makefile.am ends here" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
525 ) |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
526 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
527 # Create gnulib.m4. |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
528 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
|
529 ( |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
530 if test -z "$dry_run"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
531 exec > $destdir/$m4base/gnulib.m4 |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
532 else |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
533 echo "# $destdir/$m4base/gnulib.m4" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
534 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
535 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
|
536 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
|
537 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
|
538 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
|
539 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
|
540 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
|
541 echo "#" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
542 echo "# Generated by gnulib-tool." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
543 echo "#" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
544 echo "# Invoked as: $cmd" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
545 echo "# Reproduce by: $actioncmd" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
546 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
547 echo "AC_DEFUN([gl_EARLY]," |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
548 echo "[" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
549 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
|
550 echo " AC_GNU_SOURCE" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
551 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
552 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
|
553 echo " gl_USE_SYSTEM_EXTENSIONS" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
554 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
555 echo "])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
556 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
557 echo "AC_DEFUN([gl_INIT]," |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
558 echo "[" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
559 for module in $modules; do |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
560 func_verify_module |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
561 if test -n "$module"; then |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
562 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./' |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
563 fi |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
564 done |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
565 echo "])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
566 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
567 echo "dnl Usage: gl_MODULES(module1 module2 ...)" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
568 echo "AC_DEFUN([gl_MODULES], [])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
569 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
570 echo "dnl Usage: gl_SOURCE_BASE(DIR)" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
571 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
|
572 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
573 echo "dnl Usage: gl_M4_BASE(DIR)" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
574 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
|
575 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
576 echo "dnl Usage: gl_LIB(LIBNAME)" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
577 echo "AC_DEFUN([gl_LIB], [])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
578 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
579 echo "dnl Usage: gl_LGPL" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
580 echo "AC_DEFUN([gl_LGPL], [])" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
581 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
582 echo "# gnulib.m4 ends here" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
583 ) |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
584 echo "Finished." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
585 echo |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
586 echo "Don't forget to add \"$sourcebase/Makefile\"" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
587 echo "to AC_CONFIG_FILES in \"$configure_ac\" and to mention" |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
588 echo "\"`basename $sourcebase`\" in SUBDIRS in some Makefile.am." |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
589 } |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
590 |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
591 # func_create_testdir testdir modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
592 func_create_testdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
593 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
594 testdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
595 modules="$2" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
596 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
|
597 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
598 # Determine final module list. |
5347
0318c37925dc
Move duplicated code into function func_modules_transitive_closure().
Bruno Haible <bruno@clisp.org>
parents:
5346
diff
changeset
|
599 func_modules_transitive_closure |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
600 echo "Module list with included dependencies:" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
601 echo "$modules" | sed -e 's/^/ /' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
602 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
603 # Determine final file list. |
5348
6afb021e2fc1
Move duplicated code into function func_modules_to_filelist().
Bruno Haible <bruno@clisp.org>
parents:
5347
diff
changeset
|
604 func_modules_to_filelist |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
605 echo "File list:" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
606 echo "$files" | sed -e 's/^/ /' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
607 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
608 # Create directories. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
609 for d in `echo "$files" | sed -n -e 's,^\(.*\)/[^/]*,\1,p'`; do |
4175
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
610 if test "$d" != config; then |
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
611 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
|
612 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
613 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
614 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
615 # Copy files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
616 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
|
617 case "$f" in |
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
618 config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;; |
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
619 *) g="$f" ;; |
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
620 esac |
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
621 ln "$gnulib_dir/$f" "$testdir/$g" 2>/dev/null || |
ace040a2b821
Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents:
4171
diff
changeset
|
622 cp -p "$gnulib_dir/$f" "$testdir/$g" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
623 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
624 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
625 # Create lib/Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
626 mkdir -p "$testdir/lib" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
627 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
628 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
629 echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
630 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
631 echo "noinst_LIBRARIES = $libname.a" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
632 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
633 echo "$libname"'_a_SOURCES =' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
634 echo "$libname"'_a_LIBADD = @LIBOBJS@' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
635 echo '#'"$libname"'_la_LIBADD = @LTLIBOBJS@' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
636 echo "EXTRA_DIST =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
637 echo "BUILT_SOURCES =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
638 echo "SUFFIXES =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
639 echo "MOSTLYCLEANFILES =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
640 echo "CLEANFILES =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
641 echo "DISTCLEANFILES =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
642 echo "MAINTAINERCLEANFILES =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
643 for module in $modules; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
644 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
645 if test -n "$module"; then |
4171
c2c0e7e2e7bd
Ensure alloca.h and stdbool.h are created before compiling the library.
Bruno Haible <bruno@clisp.org>
parents:
4150
diff
changeset
|
646 func_get_automake_snippet "$module" | sed -e "s,lib_SOURCES,$libname"'_a_SOURCES,g' -e "s,lib_OBJECTS,$libname"'_a_OBJECTS,g' |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
647 if test "$module" = 'alloca'; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
648 echo "$libname"'_a_LIBADD += @ALLOCA@' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
649 echo '#'"$libname"'_la_LIBADD += @LTALLOCA@' |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
650 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
651 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
652 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
653 ) > "$testdir/lib/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
654 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
655 # Create m4/Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
656 mkdir -p "$testdir/m4" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
657 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
658 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
659 echo "EXTRA_DIST =" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
660 for f in $files; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
661 case "$f" in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
662 m4/* ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
663 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
664 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
665 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
666 ) > "$testdir/m4/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
667 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
668 subdirs="lib m4" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
669 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
670 if test -f "$testdir"/m4/gettext.m4; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
671 # Avoid stupid error message from automake: |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
672 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
673 mkdir -p "$testdir/po" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
674 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
675 ) > "$testdir/po/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
676 subdirs="$subdirs po" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
677 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
678 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
679 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
680 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
681 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
682 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
683 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
684 echo "SUBDIRS = $subdirs" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
685 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
686 echo "ACLOCAL_AMFLAGS = -I m4" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
687 ) > "$testdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
688 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
689 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
690 (echo "# Process this file with autoconf to produce a configure script." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
691 echo "AC_INIT(dummy,0)" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
692 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
693 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
694 echo "AM_CONFIG_HEADER(config.h)" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
695 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
696 echo "AC_PROG_CC" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
697 echo "AC_PROG_INSTALL" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
698 echo "AC_PROG_MAKE_SET" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
699 echo "AC_PROG_RANLIB" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
700 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
701 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
|
702 echo "AC_GNU_SOURCE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
703 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
704 fi |
4586
eb1b4acf2e86
Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents:
4325
diff
changeset
|
705 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
|
706 echo "gl_USE_SYSTEM_EXTENSIONS" |
eb1b4acf2e86
Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents:
4325
diff
changeset
|
707 echo |
eb1b4acf2e86
Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents:
4325
diff
changeset
|
708 fi |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
709 for module in $modules; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
710 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
711 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
712 func_get_autoconf_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
713 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
714 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
715 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
716 makefiles="Makefile" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
717 for d in $subdirs; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
718 makefiles="$makefiles $d/Makefile" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
719 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
720 echo "AC_OUTPUT([$makefiles])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
721 ) > "$testdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
722 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
723 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
724 (cd "$testdir" |
5237
bd85db908172
Replace various ad-hoc automake/autoconf/aclocal
Paul Eggert <eggert@cs.ucla.edu>
parents:
5202
diff
changeset
|
725 echo "executing ${AUTORECONF} --force --install" |
bd85db908172
Replace various ad-hoc automake/autoconf/aclocal
Paul Eggert <eggert@cs.ucla.edu>
parents:
5202
diff
changeset
|
726 ${AUTORECONF} --force --install |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
727 ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
728 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
|
729 (cd "$testdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
730 ./configure |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
731 cd lib |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
732 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
|
733 if test -n "$built_sources"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
734 make $built_sources |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
735 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
736 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
737 make distclean |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
738 ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
739 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
740 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
741 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
742 # func_create_megatestdir megatestdir allmodules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
743 func_create_megatestdir () |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
744 { |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
745 megatestdir="$1" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
746 allmodules="$2" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
747 if test -z "$allmodules"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
748 allmodules=`func_all_modules` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
749 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
750 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
751 megasubdirs= |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
752 # First, all modules one by one. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
753 for onemodule in $allmodules; do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
754 func_create_testdir "$megatestdir/$onemodule" $onemodule |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
755 megasubdirs="${megasubdirs}$onemodule " |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
756 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
757 # Then, all modules all together. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
758 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
759 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
|
760 func_create_testdir "$megatestdir/ALL" "$allmodules" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
761 megasubdirs="${megasubdirs}ALL" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
762 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
763 # Create Makefile.am. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
764 (echo "## Process this file with automake to produce Makefile.in." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
765 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
766 echo "AUTOMAKE_OPTIONS = 1.5 foreign" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
767 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
768 echo "SUBDIRS = $megasubdirs" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
769 ) > "$megatestdir/Makefile.am" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
770 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
771 # Create configure.ac. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
772 (echo "# Process this file with autoconf to produce a configure script." |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
773 echo "AC_INIT(dummy,0)" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
774 echo "AM_INIT_AUTOMAKE" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
775 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
776 echo "AC_PROG_MAKE_SET" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
777 echo |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
778 echo "AC_CONFIG_SUBDIRS([$megasubdirs])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
779 echo "AC_OUTPUT([Makefile])" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
780 ) > "$megatestdir/configure.ac" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
781 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
782 # Create autogenerated files. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
783 (cd "$megatestdir" |
5237
bd85db908172
Replace various ad-hoc automake/autoconf/aclocal
Paul Eggert <eggert@cs.ucla.edu>
parents:
5202
diff
changeset
|
784 echo "executing ${AUTORECONF} --force --install" |
bd85db908172
Replace various ad-hoc automake/autoconf/aclocal
Paul Eggert <eggert@cs.ucla.edu>
parents:
5202
diff
changeset
|
785 ${AUTORECONF} --force --install |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
786 ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
787 } |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
788 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
789 case $mode in |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
790 "" ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
791 func_fatal_error "no mode specified" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
792 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
793 list ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
794 func_all_modules |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
795 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
796 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
797 import ) |
5343 | 798 # Where to import. |
799 if test -z "$destdir"; then | |
800 destdir=. | |
801 fi | |
802 test -d "$destdir" \ | |
803 || 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
|
804 |
5343 | 805 # Prefer configure.ac to configure.in |
806 test -f $destdir/configure.in && configure_ac=$destdir/configure.in | |
807 test -f $destdir/configure.ac && configure_ac=$destdir/configure.ac | |
808 test -f "$configure_ac" \ | |
809 || 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
|
810 |
5343 | 811 # Get settings. |
812 my_sed_traces='s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; | |
813 /gl_MODULES[^_]/ { | |
814 s,^.*gl_MODULES([[ ]*\([^])]*\).*$,ac_modules="\1",; p; | |
815 }; | |
816 /gl_SOURCE_BASE/ { | |
817 s,^.*gl_SOURCE_BASE([[ ]*\([^])]*\).*$,ac_sourcebase="\1",; p; | |
818 }; | |
819 /gl_M4_BASE/ { | |
820 s,^.*gl_M4_BASE([[ ]*\([^])]*\).*$,ac_m4base="\1",; p; | |
821 }; | |
822 /gl_LIB/ { | |
823 s,^.*gl_LIB([[ ]*\([^])]*\).*$,ac_libname="\1",; p; | |
824 }; | |
825 /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; }; | |
826 /LT_INIT/ { s,^.*$,seen_libtool=:,; p; }; | |
827 /gl_LGPL/ { s,^.*$,lgpl=true,; p; }; | |
828 d;' | |
829 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
|
830 |
5343 | 831 # Override libname? |
832 if test -z "$supplied_libname" && test -n "$ac_libname"; then | |
833 libname="$ac_libname" | |
834 fi | |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
835 |
5343 | 836 # Set up source base. |
837 test -z "$sourcebase" && sourcebase="$ac_sourcebase" | |
838 test -z "$sourcebase" && sourcebase="lib" | |
839 test -d "$destdir/$sourcebase" \ | |
840 || (test -z "$dry_run" && mkdir "$destdir/$sourcebase") \ | |
841 || 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
|
842 |
5343 | 843 # Set up m4 base. |
844 test -z "$m4base" && m4base="$ac_m4base" | |
845 test -z "$m4base" && m4base="m4" | |
846 test -d "$destdir/$m4base" \ | |
847 || (test -z "$dry_run" && mkdir "$destdir/$m4base") \ | |
848 || 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
|
849 |
5343 | 850 # Using libtool? |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
851 if test -n "$seen_libtool"; then |
5343 | 852 libtool=true |
853 fi | |
5202
64446bf39961
Use sed instead of autoconf --trace, inspired by
Paul Eggert <eggert@cs.ucla.edu>
parents:
5198
diff
changeset
|
854 |
5343 | 855 # What modules to extract. |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
856 if test $# = 0; then |
5343 | 857 modules="$ac_modules" |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
858 else |
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
859 modules="$*" |
5343 | 860 fi |
5262
97ed4b64d853
New parameter --lgpl, to asseert that modules are
Paul Eggert <eggert@cs.ucla.edu>
parents:
5255
diff
changeset
|
861 |
5345
8394c9bf619f
Move a lot of code into function func_import().
Bruno Haible <bruno@clisp.org>
parents:
5344
diff
changeset
|
862 func_import "$modules" |
5343 | 863 ;; |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
864 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
865 create-testdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
866 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
867 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
868 fi |
4126
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
869 mkdir "$destdir" |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
870 test -d "$destdir" \ |
e8caa337b4e1
(create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents:
4124
diff
changeset
|
871 || func_fatal_error "could not create destination directory" |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
872 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
873 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
874 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
875 create-megatestdir ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
876 if test -z "$destdir"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
877 func_fatal_error "please specify --dir option" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
878 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
879 mkdir "$destdir" || func_fatal_error "could not create destination directory" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
880 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
881 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
882 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
883 test ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
884 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
885 mkdir "$destdir" || func_fatal_error "could not create destination directory" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
886 func_create_testdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
887 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
888 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
889 cd build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
890 ../configure |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
891 make |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
892 make check |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
893 make distclean |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
894 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
895 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
896 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
897 echo "gnulib-tool: *** Stop." 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
898 exit 1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
899 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
900 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
901 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
902 rm -rf "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
903 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
904 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
905 megatest ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
906 test -n "$destdir" || destdir=testdir$$ |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
907 mkdir "$destdir" || func_fatal_error "could not create destination directory" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
908 func_create_megatestdir "$destdir" "$*" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
909 cd "$destdir" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
910 mkdir build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
911 cd build |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
912 ../configure |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
913 make |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
914 make check |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
915 make distclean |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
916 remaining=`find . -type f -print` |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
917 if test -n "$remaining"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
918 echo "Remaining files:" $remaining 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
919 echo "gnulib-tool: *** Stop." 1>&2 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
920 exit 1 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
921 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
922 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
923 cd .. |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
924 rm -rf "$destdir" |
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 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
927 extract-description ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
928 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
929 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
930 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
931 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
932 func_get_description "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
933 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
934 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
935 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
936 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
937 extract-filelist ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
938 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
939 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
940 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
941 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
942 func_get_filelist "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
943 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
944 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
945 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
946 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
947 extract-dependencies ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
948 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
949 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
950 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
951 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
952 func_get_dependencies "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
953 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
954 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
955 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
956 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
957 extract-autoconf-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
958 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
959 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
960 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
961 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
962 func_get_autoconf_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
963 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
964 done |
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 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
967 extract-automake-snippet ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
968 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
969 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
970 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
971 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
972 func_get_automake_snippet "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
973 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
974 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
975 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
976 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
977 extract-include-directive ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
978 for module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
979 do |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
980 func_verify_module |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
981 if test -n "$module"; then |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
982 func_get_include_directive "$module" |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
983 fi |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
984 done |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
985 ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
986 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
987 extract-license ) |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
988 for module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
989 do |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
990 func_verify_module |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
991 if test -n "$module"; then |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
992 func_get_license "$module" |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
993 fi |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
994 done |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
995 ;; |
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5250
diff
changeset
|
996 |
4197 | 997 extract-maintainer ) |
998 for module | |
999 do | |
1000 func_verify_module | |
1001 if test -n "$module"; then | |
1002 func_get_maintainer "$module" | |
1003 fi | |
1004 done | |
1005 ;; | |
1006 | |
4112
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1007 * ) |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1008 func_fatal_error "unknown operation mode --$mode" ;; |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1009 esac |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1010 |
98e795b64056
Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1011 exit 0 |