annotate gnulib-tool @ 4586:eb1b4acf2e86

Avoid autoconf/autoheader warning "AC_COMPILE_IFELSE was called before gl_USE_SYSTEM_EXTENSIONS"
author Bruno Haible <bruno@clisp.org>
date Sun, 17 Aug 2003 15:25:00 +0000
parents db705903ccfc
children 39841d2009ed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 #
4124
5b5f22d7530e (last_checkin_date): don't expand the $Date here.
Karl Berry <karl@freefriends.org>
parents: 4112
diff changeset
3 # Copyright (C) 2002, 2003 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
4586
eb1b4acf2e86 Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents: 4325
diff changeset
25 cvsdatestamp='$Date: 2003-08-17 15:25:00 $'
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=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 case $USER in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 bruno )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 AUTOCONFBINDIR=/packages/gnu-inst-autoconf/2.57/bin
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 AUTOCONFPATH="eval env PATH=${AUTOCONFBINDIR}:\$PATH "
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 AUTOCONF="${AUTOCONFPATH}autoconf"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 AUTOHEADER="${AUTOCONFPATH}autoheader"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 AUTOMAKE="${AUTOCONFPATH}automake-1.7"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 ACLOCAL="aclocal-1.7"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 # func_usage
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 # outputs to stdout the --help usage message.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 func_usage ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 echo "\
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 Usage: gnulib-tool --list
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 gnulib-tool --import module1 ... moduleN
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 gnulib-tool --create-testdir --dir=directory module1 ... moduleN
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 gnulib-tool --create-megatestdir --dir=directory [module1 ... moduleN]
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 gnulib-tool --test --dir=directory module1 ... moduleN
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 gnulib-tool --megatest --dir=directory [module1 ... moduleN]
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 gnulib-tool --extract-description module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 gnulib-tool --extract-filelist module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 gnulib-tool --extract-dependencies module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 gnulib-tool --extract-autoconf-snippet module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 gnulib-tool --extract-automake-snippet module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 gnulib-tool --extract-include-directive module
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
60 gnulib-tool --extract-maintainer module
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 Operation modes:
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 --list print the available module names
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 --import import the given modules into the current package
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 --create-testdir create a scratch package with the given modules
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 --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
67 one by one and all together
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 --test test the combination of the given modules
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
69 (recommended to use CC=\"gcc -Wall\" here)
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 --megatest test the given modules one by one and all together
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
71 (recommended to use CC=\"gcc -Wall\" here)
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 --extract-description extract the description
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 --extract-filelist extract the list of files
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 --extract-dependencies extract the dependencies
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 --extract-autoconf-snippet extract the snippet for configure.ac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 --extract-automake-snippet extract the snippet for lib/Makefile.am
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 --extract-include-directive extract the #include directive
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
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
4325
db705903ccfc trivial help message fix
Karl Berry <karl@freefriends.org>
parents: 4200
diff changeset
82 --lib=LIBRARY specify the library name
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 --no-changelog don't update or create ChangeLog files
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 Report bugs to <bug-gnulib@gnu.org>."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 # func_version
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 # outputs to stdout the --version message.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 func_version ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 echo "$progname (GNU $package) $version"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 echo "Copyright (C) 2002 Free Software Foundation, Inc.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 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
95 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
96 echo "Written by" "Bruno Haible"
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
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 # func_fatal_error message
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 # 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
101 func_fatal_error ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 echo "gnulib-tool: *** $1" 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 echo "gnulib-tool: *** Stop." 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 exit 1
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 }
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 # Command-line option processing.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 # Removes the OPTIONS from the arguments. Sets the variables:
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 # - mode list or import or create-testdir or create-megatestdir
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 # - destdir from --dir
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 # - libname from --lib
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 # - do_changelog false if --no-changelog was given, : otherwise
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 mode=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 destdir=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 libname=libfoo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 do_changelog=:
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 while test $# -gt 0; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 case "$1" in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 --list | --lis )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 mode=list
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 --import | --impor | --impo | --imp | --im | --i )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126 mode=import
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 --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
129 mode=create-testdir
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131 --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
132 mode=create-megatestdir
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
134 --test | --tes | --te | --t )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 mode=test
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137 --megatest | --megates | --megate | --megat | --mega | --meg | --me | --m )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 mode=megatest
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 --extract-* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 mode=`echo "X$1" | sed -e 's/^X--//'`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 --dir )
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 if test $# = 0; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 func_fatal_error "missing argument for --dir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 destdir=$1
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
150 --dir=* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
151 destdir=`echo "X$1" | sed -e 's/^X--dir=//'`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
152 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
153 --lib )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
154 shift
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
155 if test $# = 0; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
156 func_fatal_error "missing argument for --lib"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
157 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
158 libname=$1
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 --lib=* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
161 libname=`echo "X$1" | sed -e 's/^X--lib=//'`
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 --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
164 do_changelog=false
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
165 shift ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
166 --help | --hel | --he | --h )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
167 func_usage
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
168 exit 0 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
169 --version | --versio | --versi | --vers | --ver | --ve | --v )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
170 func_version
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
171 exit 0 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
172 -- )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
173 # Stop option prcessing
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 break ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
176 -* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
177 echo "gnulib-tool: unknown option $1" 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
178 echo "Try 'gnulib-tool --help' for more information." 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
179 exit 1 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
180 * )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
181 break ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
182 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
183 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
184 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
185
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
186 case "$0" in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
187 /*) self_abspathname="$0" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
188 */*) self_abspathname=`pwd`/"$0" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
189 *) 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
190 if test -x "$d/$0" && test ! -d "$d/$0"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
191 self_abspathname="$d/$0"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
192 break
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
193 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
194 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
195 if test -z "$self_abspathname"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
196 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
197 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
198 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
199 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
200 while test -L "$self_abspathname"; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
201 # Resolve symbolic link.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
202 sedexpr1='s, -> ,#%%#,'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
203 sedexpr2='s,^.*#%%#\(.*\)$,\1,p'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
204 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
205 test -n "$linkval" || break
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
206 case "$linkval" in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
207 /* ) self_abspathname="$linkval" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
208 * ) self_abspathname=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`/"$linkval" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
209 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
210 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
211 gnulib_dir=`echo "$self_abspathname" | sed -e 's,/[^/]*$,,'`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
212
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
213 # func_all_modules
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
214 func_all_modules ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
215 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
216 (cd "$gnulib_dir/modules" && ls -1) \
4150
60149b6a8a43 Ignore Emacs backup files.
Bruno Haible <bruno@clisp.org>
parents: 4128
diff changeset
217 | 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
218 | sort
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
219 }
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 # func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
222 # verifies a module name
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
223 func_verify_module ()
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 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
226 || test "CVS" = "$module" \
1346b5405a74 (func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents: 4126
diff changeset
227 || test "ChangeLog" = "$module" \
1346b5405a74 (func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents: 4126
diff changeset
228 || test "TEMPLATE" = "$module"; then
1346b5405a74 (func_verify_module): report module name $module
Karl Berry <karl@freefriends.org>
parents: 4126
diff changeset
229 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
230 module=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
231 fi
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
4200
b021702e6680 Correctly separate Include from Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4197
diff changeset
234 tags_regexp='\(Description\|Files\|Depends-on\|configure\.ac\|Makefile\.am\|Include\|Maintainer\)'
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
235 sed_extract_prog=':[ ]*$/ {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
236 :a
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
237 n
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
238 s/^'"$tags_regexp"':[ ]*$//
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
239 tb
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
240 p
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
241 ba
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
242 :b
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
243 }'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
244
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
245 # func_get_description module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
246 func_get_description ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
247 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
248 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
249 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
250
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
251 # func_get_filelist module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
252 func_get_filelist ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
253 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
254 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
255 #echo m4/onceonly.m4
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
256 echo m4/onceonly_2_57.m4
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
257 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
258
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
259 # func_get_dependencies module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
260 func_get_dependencies ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
261 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
262 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
263 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
264
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
265 # func_get_autoconf_snippet module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
266 func_get_autoconf_snippet ()
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 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
269 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
270
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
271 # func_get_automake_snippet module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
272 func_get_automake_snippet ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
273 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
274 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
275 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
276
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
277 # func_get_include_directive module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
278 func_get_include_directive ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
279 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
280 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
281 sed -e 's/^\(["<]\)/#include \1/'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
282 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
283
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
284 # func_get_maintainer module
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
285 func_get_maintainer ()
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
286 {
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
287 sed -n -e "/^Maintainer$sed_extract_prog" < "$gnulib_dir/modules/$1"
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
288 }
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
289
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
290 # func_create_testdir testdir modules
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
291 func_create_testdir ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
292 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
293 testdir="$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
294 modules="$2"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
295 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
296
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
297 # Determine final module list.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
298 while true; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
299 xmodules=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
300 for module in $modules; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
301 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
302 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
303 xmodules="$xmodules $module "`func_get_dependencies $module`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
304 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
305 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
306 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
307 if test "$xmodules" = "$modules"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
308 break
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
309 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
310 modules="$xmodules"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
311 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
312 echo "Module list with included dependencies:"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
313 echo "$modules" | sed -e 's/^/ /'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
314
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
315 # Determine final file list.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
316 files=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
317 for module in $modules; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
318 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
319 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
320 files="$files "`func_get_filelist $module`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
321 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
322 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
323 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
324 echo "File list:"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
325 echo "$files" | sed -e 's/^/ /'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
326
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
327 # Create directories.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
328 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
329 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
330 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
331 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
332 done
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 # Copy files.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
335 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
336 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
337 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
338 *) g="$f" ;;
ace040a2b821 Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents: 4171
diff changeset
339 esac
ace040a2b821 Files meant for the AUX_DIR are now in the config subdirectory.
Bruno Haible <bruno@clisp.org>
parents: 4171
diff changeset
340 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
341 cp -p "$gnulib_dir/$f" "$testdir/$g"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
342 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
343
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
344 # Create lib/Makefile.am.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
345 mkdir -p "$testdir/lib"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
346 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
347 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
348 echo "AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
349 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
350 echo "noinst_LIBRARIES = $libname.a"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
351 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
352 echo "$libname"'_a_SOURCES ='
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
353 echo "$libname"'_a_LIBADD = @LIBOBJS@'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
354 echo '#'"$libname"'_la_LIBADD = @LTLIBOBJS@'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
355 echo "EXTRA_DIST ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
356 echo "BUILT_SOURCES ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
357 echo "SUFFIXES ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
358 echo "MOSTLYCLEANFILES ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
359 echo "CLEANFILES ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
360 echo "DISTCLEANFILES ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
361 echo "MAINTAINERCLEANFILES ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
362 for module in $modules; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
363 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
364 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
365 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
366 if test "$module" = 'alloca'; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
367 echo "$libname"'_a_LIBADD += @ALLOCA@'
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
368 echo '#'"$libname"'_la_LIBADD += @LTALLOCA@'
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 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
371 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
372 ) > "$testdir/lib/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
373
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
374 # Create m4/Makefile.am.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
375 mkdir -p "$testdir/m4"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
376 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
377 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
378 echo "EXTRA_DIST ="
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
379 for f in $files; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
380 case "$f" in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
381 m4/* )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
382 echo "EXTRA_DIST += "`echo "$f" | sed -e 's,^m4/,,'` ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
383 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
384 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
385 ) > "$testdir/m4/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
386
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
387 subdirs="lib m4"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
388
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
389 if test -f "$testdir"/m4/gettext.m4; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
390 # Avoid stupid error message from automake:
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
391 # "AM_GNU_GETTEXT used but `po' not in SUBDIRS"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
392 mkdir -p "$testdir/po"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
393 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
394 ) > "$testdir/po/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
395 subdirs="$subdirs po"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
396 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
397
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
398 # Create Makefile.am.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
399 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
400 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
401 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
402 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
403 echo "SUBDIRS = $subdirs"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
404 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
405 echo "ACLOCAL_AMFLAGS = -I m4"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
406 ) > "$testdir/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
407
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
408 # Create configure.ac.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
409 (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
410 echo "AC_INIT(dummy,0)"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
411 echo "AM_INIT_AUTOMAKE"
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 "AM_CONFIG_HEADER(config.h)"
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 "AC_PROG_CC"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
416 echo "AC_PROG_INSTALL"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
417 echo "AC_PROG_MAKE_SET"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
418 echo "AC_PROG_RANLIB"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
419 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
420 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
421 echo "AC_GNU_SOURCE"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
422 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
423 fi
4586
eb1b4acf2e86 Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents: 4325
diff changeset
424 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
425 echo "gl_USE_SYSTEM_EXTENSIONS"
eb1b4acf2e86 Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents: 4325
diff changeset
426 echo
eb1b4acf2e86 Avoid autoconf/autoheader warning
Bruno Haible <bruno@clisp.org>
parents: 4325
diff changeset
427 fi
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
428 for module in $modules; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
429 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
430 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
431 func_get_autoconf_snippet "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
432 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
433 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
434 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
435 makefiles="Makefile"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
436 for d in $subdirs; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
437 makefiles="$makefiles $d/Makefile"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
438 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
439 echo "AC_OUTPUT([$makefiles])"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
440 ) > "$testdir/configure.ac"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
441
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
442 # Create autogenerated files.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
443 (cd "$testdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
444 echo "executing ${ACLOCAL} -I m4"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
445 ${ACLOCAL} -I m4
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
446 echo "executing ${AUTOHEADER}"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
447 ${AUTOHEADER}
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
448 echo "executing ${AUTOCONF}"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
449 ${AUTOCONF}
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
450 echo "executing ${AUTOMAKE} --add-missing --copy"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
451 ${AUTOMAKE} --add-missing --copy
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
452 )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
453 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
454 (cd "$testdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
455 ./configure
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
456 cd lib
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
457 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
458 if test -n "$built_sources"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
459 make $built_sources
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
460 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
461 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
462 make distclean
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
463 )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
464 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
465 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
466
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
467 # func_create_megatestdir megatestdir allmodules
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
468 func_create_megatestdir ()
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
469 {
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
470 megatestdir="$1"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
471 allmodules="$2"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
472 if test -z "$allmodules"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
473 allmodules=`func_all_modules`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
474 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
475
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
476 megasubdirs=
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
477 # First, all modules one by one.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
478 for onemodule in $allmodules; do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
479 func_create_testdir "$megatestdir/$onemodule" $onemodule
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
480 megasubdirs="${megasubdirs}$onemodule "
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
481 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
482 # Then, all modules all together.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
483 # Except fnmatch-posix, which conflicts with fnmatch-gnu. FIXME.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
484 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
485 func_create_testdir "$megatestdir/ALL" "$allmodules"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
486 megasubdirs="${megasubdirs}ALL"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
487
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
488 # Create Makefile.am.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
489 (echo "## Process this file with automake to produce Makefile.in."
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
490 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
491 echo "AUTOMAKE_OPTIONS = 1.5 foreign"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
492 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
493 echo "SUBDIRS = $megasubdirs"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
494 ) > "$megatestdir/Makefile.am"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
495
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
496 # Create configure.ac.
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
497 (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
498 echo "AC_INIT(dummy,0)"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
499 echo "AM_INIT_AUTOMAKE"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
500 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
501 echo "AC_PROG_MAKE_SET"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
502 echo
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
503 echo "AC_CONFIG_SUBDIRS([$megasubdirs])"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
504 echo "AC_OUTPUT([Makefile])"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
505 ) > "$megatestdir/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 "$megatestdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
509 echo "executing ${ACLOCAL}"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
510 ${ACLOCAL}
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
511 echo "executing ${AUTOCONF}"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
512 ${AUTOCONF}
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
513 echo "executing ${AUTOMAKE} --add-missing --copy Makefile"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
514 ${AUTOMAKE} --add-missing --copy Makefile
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
515 )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
516 }
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
517
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
518 case $mode in
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
519 "" )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
520 func_fatal_error "no mode specified" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
521
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
522 list )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
523 func_all_modules
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 import )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
527 func_fatal_error "NYI" ;;
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 create-testdir )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
530 if test -z "$destdir"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
531 func_fatal_error "please specify --dir option"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
532 fi
4126
e8caa337b4e1 (create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents: 4124
diff changeset
533 mkdir "$destdir"
e8caa337b4e1 (create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents: 4124
diff changeset
534 test -d "$destdir" \
e8caa337b4e1 (create-testdir): don't complain if destdir
Karl Berry <karl@freefriends.org>
parents: 4124
diff changeset
535 || func_fatal_error "could not create destination directory"
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
536 func_create_testdir "$destdir" "$*"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
537 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
538
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
539 create-megatestdir )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
540 if test -z "$destdir"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
541 func_fatal_error "please specify --dir option"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
542 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
543 mkdir "$destdir" || func_fatal_error "could not create destination directory"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
544 func_create_megatestdir "$destdir" "$*"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
545 ;;
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 test )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
548 test -n "$destdir" || destdir=testdir$$
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
549 mkdir "$destdir" || func_fatal_error "could not create destination directory"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
550 func_create_testdir "$destdir" "$*"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
551 cd "$destdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
552 mkdir build
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
553 cd build
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
554 ../configure
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
555 make
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
556 make check
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
557 make distclean
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
558 remaining=`find . -type f -print`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
559 if test -n "$remaining"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
560 echo "Remaining files:" $remaining 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
561 echo "gnulib-tool: *** Stop." 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
562 exit 1
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
563 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
564 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
565 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
566 rm -rf "$destdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
567 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
568
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
569 megatest )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
570 test -n "$destdir" || destdir=testdir$$
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
571 mkdir "$destdir" || func_fatal_error "could not create destination directory"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
572 func_create_megatestdir "$destdir" "$*"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
573 cd "$destdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
574 mkdir build
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
575 cd build
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
576 ../configure
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
577 make
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
578 make check
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
579 make distclean
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
580 remaining=`find . -type f -print`
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
581 if test -n "$remaining"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
582 echo "Remaining files:" $remaining 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
583 echo "gnulib-tool: *** Stop." 1>&2
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
584 exit 1
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
585 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
586 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
587 cd ..
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
588 rm -rf "$destdir"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
589 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
590
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
591 extract-description )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
592 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
593 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
594 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
595 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
596 func_get_description "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
597 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
598 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
599 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
600
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
601 extract-filelist )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
602 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
603 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
604 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
605 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
606 func_get_filelist "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
607 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
608 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
609 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
610
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
611 extract-dependencies )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
612 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
613 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
614 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
615 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
616 func_get_dependencies "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
617 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
618 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
619 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
620
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
621 extract-autoconf-snippet )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
622 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
623 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
624 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
625 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
626 func_get_autoconf_snippet "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
627 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
628 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
629 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
630
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
631 extract-automake-snippet )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
632 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
633 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
634 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
635 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
636 func_get_automake_snippet "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
637 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
638 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
639 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
640
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
641 extract-include-directive )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
642 for module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
643 do
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
644 func_verify_module
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
645 if test -n "$module"; then
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
646 func_get_include_directive "$module"
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
647 fi
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
648 done
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
649 ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
650
4197
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
651 extract-maintainer )
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
652 for module
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
653 do
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
654 func_verify_module
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
655 if test -n "$module"; then
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
656 func_get_maintainer "$module"
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
657 fi
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
658 done
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
659 ;;
3ccc6d0d52bb Add a Maintainer.
Bruno Haible <bruno@clisp.org>
parents: 4175
diff changeset
660
4112
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
661 * )
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
662 func_fatal_error "unknown operation mode --$mode" ;;
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
663 esac
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
664
98e795b64056 Tool for managing gnulib modules.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
665 exit 0