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