missing revision 1.1.1.1.2.2 1 1.1.1.1.2.2 snj #! /bin/sh
2 1.1.1.1.2.2 snj # Common stub for a few missing GNU programs while installing.
3 1.1.1.1.2.2 snj
4 1.1.1.1.2.2 snj scriptversion=2012-01-06.18; # UTC
5 1.1.1.1.2.2 snj
6 1.1.1.1.2.2 snj # Copyright (C) 1996-2012 Free Software Foundation, Inc.
7 1.1.1.1.2.2 snj # Originally by Fran,cois Pinard <pinard (at] iro.umontreal.ca>, 1996.
8 1.1.1.1.2.2 snj
9 1.1.1.1.2.2 snj # This program is free software; you can redistribute it and/or modify
10 1.1.1.1.2.2 snj # it under the terms of the GNU General Public License as published by
11 1.1.1.1.2.2 snj # the Free Software Foundation; either version 2, or (at your option)
12 1.1.1.1.2.2 snj # any later version.
13 1.1.1.1.2.2 snj
14 1.1.1.1.2.2 snj # This program is distributed in the hope that it will be useful,
15 1.1.1.1.2.2 snj # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 1.1.1.1.2.2 snj # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 1.1.1.1.2.2 snj # GNU General Public License for more details.
18 1.1.1.1.2.2 snj
19 1.1.1.1.2.2 snj # You should have received a copy of the GNU General Public License
20 1.1.1.1.2.2 snj # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 1.1.1.1.2.2 snj
22 1.1.1.1.2.2 snj # As a special exception to the GNU General Public License, if you
23 1.1.1.1.2.2 snj # distribute this file as part of a program that contains a
24 1.1.1.1.2.2 snj # configuration script generated by Autoconf, you may include it under
25 1.1.1.1.2.2 snj # the same distribution terms that you use for the rest of that program.
26 1.1.1.1.2.2 snj
27 1.1.1.1.2.2 snj if test $# -eq 0; then
28 1.1.1.1.2.2 snj echo 1>&2 "Try '$0 --help' for more information"
29 1.1.1.1.2.2 snj exit 1
30 1.1.1.1.2.2 snj fi
31 1.1.1.1.2.2 snj
32 1.1.1.1.2.2 snj run=:
33 1.1.1.1.2.2 snj sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
34 1.1.1.1.2.2 snj sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
35 1.1.1.1.2.2 snj
36 1.1.1.1.2.2 snj # In the cases where this matters, 'missing' is being run in the
37 1.1.1.1.2.2 snj # srcdir already.
38 1.1.1.1.2.2 snj if test -f configure.ac; then
39 1.1.1.1.2.2 snj configure_ac=configure.ac
40 1.1.1.1.2.2 snj else
41 1.1.1.1.2.2 snj configure_ac=configure.in
42 1.1.1.1.2.2 snj fi
43 1.1.1.1.2.2 snj
44 1.1.1.1.2.2 snj msg="missing on your system"
45 1.1.1.1.2.2 snj
46 1.1.1.1.2.2 snj case $1 in
47 1.1.1.1.2.2 snj --run)
48 1.1.1.1.2.2 snj # Try to run requested program, and just exit if it succeeds.
49 1.1.1.1.2.2 snj run=
50 1.1.1.1.2.2 snj shift
51 1.1.1.1.2.2 snj "$@" && exit 0
52 1.1.1.1.2.2 snj # Exit code 63 means version mismatch. This often happens
53 1.1.1.1.2.2 snj # when the user try to use an ancient version of a tool on
54 1.1.1.1.2.2 snj # a file that requires a minimum version. In this case we
55 1.1.1.1.2.2 snj # we should proceed has if the program had been absent, or
56 1.1.1.1.2.2 snj # if --run hadn't been passed.
57 1.1.1.1.2.2 snj if test $? = 63; then
58 1.1.1.1.2.2 snj run=:
59 1.1.1.1.2.2 snj msg="probably too old"
60 1.1.1.1.2.2 snj fi
61 1.1.1.1.2.2 snj ;;
62 1.1.1.1.2.2 snj
63 1.1.1.1.2.2 snj -h|--h|--he|--hel|--help)
64 1.1.1.1.2.2 snj echo "\
65 1.1.1.1.2.2 snj $0 [OPTION]... PROGRAM [ARGUMENT]...
66 1.1.1.1.2.2 snj
67 1.1.1.1.2.2 snj Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
68 1.1.1.1.2.2 snj error status if there is no known handling for PROGRAM.
69 1.1.1.1.2.2 snj
70 1.1.1.1.2.2 snj Options:
71 1.1.1.1.2.2 snj -h, --help display this help and exit
72 1.1.1.1.2.2 snj -v, --version output version information and exit
73 1.1.1.1.2.2 snj --run try to run the given command, and emulate it if it fails
74 1.1.1.1.2.2 snj
75 1.1.1.1.2.2 snj Supported PROGRAM values:
76 1.1.1.1.2.2 snj aclocal touch file 'aclocal.m4'
77 1.1.1.1.2.2 snj autoconf touch file 'configure'
78 1.1.1.1.2.2 snj autoheader touch file 'config.h.in'
79 1.1.1.1.2.2 snj autom4te touch the output file, or create a stub one
80 1.1.1.1.2.2 snj automake touch all 'Makefile.in' files
81 1.1.1.1.2.2 snj bison create 'y.tab.[ch]', if possible, from existing .[ch]
82 1.1.1.1.2.2 snj flex create 'lex.yy.c', if possible, from existing .c
83 1.1.1.1.2.2 snj help2man touch the output file
84 1.1.1.1.2.2 snj lex create 'lex.yy.c', if possible, from existing .c
85 1.1.1.1.2.2 snj makeinfo touch the output file
86 1.1.1.1.2.2 snj yacc create 'y.tab.[ch]', if possible, from existing .[ch]
87 1.1.1.1.2.2 snj
88 1.1.1.1.2.2 snj Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
89 1.1.1.1.2.2 snj 'g' are ignored when checking the name.
90 1.1.1.1.2.2 snj
91 1.1.1.1.2.2 snj Send bug reports to <bug-automake (at] gnu.org>."
92 1.1.1.1.2.2 snj exit $?
93 1.1.1.1.2.2 snj ;;
94 1.1.1.1.2.2 snj
95 1.1.1.1.2.2 snj -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
96 1.1.1.1.2.2 snj echo "missing $scriptversion (GNU Automake)"
97 1.1.1.1.2.2 snj exit $?
98 1.1.1.1.2.2 snj ;;
99 1.1.1.1.2.2 snj
100 1.1.1.1.2.2 snj -*)
101 1.1.1.1.2.2 snj echo 1>&2 "$0: Unknown '$1' option"
102 1.1.1.1.2.2 snj echo 1>&2 "Try '$0 --help' for more information"
103 1.1.1.1.2.2 snj exit 1
104 1.1.1.1.2.2 snj ;;
105 1.1.1.1.2.2 snj
106 1.1.1.1.2.2 snj esac
107 1.1.1.1.2.2 snj
108 1.1.1.1.2.2 snj # normalize program name to check for.
109 1.1.1.1.2.2 snj program=`echo "$1" | sed '
110 1.1.1.1.2.2 snj s/^gnu-//; t
111 1.1.1.1.2.2 snj s/^gnu//; t
112 1.1.1.1.2.2 snj s/^g//; t'`
113 1.1.1.1.2.2 snj
114 1.1.1.1.2.2 snj # Now exit if we have it, but it failed. Also exit now if we
115 1.1.1.1.2.2 snj # don't have it and --version was passed (most likely to detect
116 1.1.1.1.2.2 snj # the program). This is about non-GNU programs, so use $1 not
117 1.1.1.1.2.2 snj # $program.
118 1.1.1.1.2.2 snj case $1 in
119 1.1.1.1.2.2 snj lex*|yacc*)
120 1.1.1.1.2.2 snj # Not GNU programs, they don't have --version.
121 1.1.1.1.2.2 snj ;;
122 1.1.1.1.2.2 snj
123 1.1.1.1.2.2 snj *)
124 1.1.1.1.2.2 snj if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
125 1.1.1.1.2.2 snj # We have it, but it failed.
126 1.1.1.1.2.2 snj exit 1
127 1.1.1.1.2.2 snj elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
128 1.1.1.1.2.2 snj # Could not run --version or --help. This is probably someone
129 1.1.1.1.2.2 snj # running '$TOOL --version' or '$TOOL --help' to check whether
130 1.1.1.1.2.2 snj # $TOOL exists and not knowing $TOOL uses missing.
131 1.1.1.1.2.2 snj exit 1
132 1.1.1.1.2.2 snj fi
133 1.1.1.1.2.2 snj ;;
134 1.1.1.1.2.2 snj esac
135 1.1.1.1.2.2 snj
136 1.1.1.1.2.2 snj # If it does not exist, or fails to run (possibly an outdated version),
137 1.1.1.1.2.2 snj # try to emulate it.
138 1.1.1.1.2.2 snj case $program in
139 1.1.1.1.2.2 snj aclocal*)
140 1.1.1.1.2.2 snj echo 1>&2 "\
141 1.1.1.1.2.2 snj WARNING: '$1' is $msg. You should only need it if
142 1.1.1.1.2.2 snj you modified 'acinclude.m4' or '${configure_ac}'. You might want
143 1.1.1.1.2.2 snj to install the Automake and Perl packages. Grab them from
144 1.1.1.1.2.2 snj any GNU archive site."
145 1.1.1.1.2.2 snj touch aclocal.m4
146 1.1.1.1.2.2 snj ;;
147 1.1.1.1.2.2 snj
148 1.1.1.1.2.2 snj autoconf*)
149 1.1.1.1.2.2 snj echo 1>&2 "\
150 1.1.1.1.2.2 snj WARNING: '$1' is $msg. You should only need it if
151 1.1.1.1.2.2 snj you modified '${configure_ac}'. You might want to install the
152 1.1.1.1.2.2 snj Autoconf and GNU m4 packages. Grab them from any GNU
153 1.1.1.1.2.2 snj archive site."
154 1.1.1.1.2.2 snj touch configure
155 1.1.1.1.2.2 snj ;;
156 1.1.1.1.2.2 snj
157 1.1.1.1.2.2 snj autoheader*)
158 1.1.1.1.2.2 snj echo 1>&2 "\
159 1.1.1.1.2.2 snj WARNING: '$1' is $msg. You should only need it if
160 1.1.1.1.2.2 snj you modified 'acconfig.h' or '${configure_ac}'. You might want
161 1.1.1.1.2.2 snj to install the Autoconf and GNU m4 packages. Grab them
162 1.1.1.1.2.2 snj from any GNU archive site."
163 1.1.1.1.2.2 snj files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
164 1.1.1.1.2.2 snj test -z "$files" && files="config.h"
165 1.1.1.1.2.2 snj touch_files=
166 1.1.1.1.2.2 snj for f in $files; do
167 1.1.1.1.2.2 snj case $f in
168 1.1.1.1.2.2 snj *:*) touch_files="$touch_files "`echo "$f" |
169 1.1.1.1.2.2 snj sed -e 's/^[^:]*://' -e 's/:.*//'`;;
170 1.1.1.1.2.2 snj *) touch_files="$touch_files $f.in";;
171 1.1.1.1.2.2 snj esac
172 1.1.1.1.2.2 snj done
173 1.1.1.1.2.2 snj touch $touch_files
174 1.1.1.1.2.2 snj ;;
175 1.1.1.1.2.2 snj
176 1.1.1.1.2.2 snj automake*)
177 1.1.1.1.2.2 snj echo 1>&2 "\
178 1.1.1.1.2.2 snj WARNING: '$1' is $msg. You should only need it if
179 1.1.1.1.2.2 snj you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
180 1.1.1.1.2.2 snj You might want to install the Automake and Perl packages.
181 1.1.1.1.2.2 snj Grab them from any GNU archive site."
182 1.1.1.1.2.2 snj find . -type f -name Makefile.am -print |
183 1.1.1.1.2.2 snj sed 's/\.am$/.in/' |
184 1.1.1.1.2.2 snj while read f; do touch "$f"; done
185 1.1.1.1.2.2 snj ;;
186 1.1.1.1.2.2 snj
187 1.1.1.1.2.2 snj autom4te*)
188 1.1.1.1.2.2 snj echo 1>&2 "\
189 1.1.1.1.2.2 snj WARNING: '$1' is needed, but is $msg.
190 1.1.1.1.2.2 snj You might have modified some files without having the
191 1.1.1.1.2.2 snj proper tools for further handling them.
192 1.1.1.1.2.2 snj You can get '$1' as part of Autoconf from any GNU
193 1.1.1.1.2.2 snj archive site."
194 1.1.1.1.2.2 snj
195 1.1.1.1.2.2 snj file=`echo "$*" | sed -n "$sed_output"`
196 1.1.1.1.2.2 snj test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
197 1.1.1.1.2.2 snj if test -f "$file"; then
198 1.1.1.1.2.2 snj touch $file
199 1.1.1.1.2.2 snj else
200 1.1.1.1.2.2 snj test -z "$file" || exec >$file
201 1.1.1.1.2.2 snj echo "#! /bin/sh"
202 1.1.1.1.2.2 snj echo "# Created by GNU Automake missing as a replacement of"
203 1.1.1.1.2.2 snj echo "# $ $@"
204 1.1.1.1.2.2 snj echo "exit 0"
205 1.1.1.1.2.2 snj chmod +x $file
206 1.1.1.1.2.2 snj exit 1
207 1.1.1.1.2.2 snj fi
208 1.1.1.1.2.2 snj ;;
209 1.1.1.1.2.2 snj
210 1.1.1.1.2.2 snj bison*|yacc*)
211 1.1.1.1.2.2 snj echo 1>&2 "\
212 1.1.1.1.2.2 snj WARNING: '$1' $msg. You should only need it if
213 1.1.1.1.2.2 snj you modified a '.y' file. You may need the Bison package
214 1.1.1.1.2.2 snj in order for those modifications to take effect. You can get
215 1.1.1.1.2.2 snj Bison from any GNU archive site."
216 1.1.1.1.2.2 snj rm -f y.tab.c y.tab.h
217 1.1.1.1.2.2 snj if test $# -ne 1; then
218 1.1.1.1.2.2 snj eval LASTARG=\${$#}
219 1.1.1.1.2.2 snj case $LASTARG in
220 1.1.1.1.2.2 snj *.y)
221 1.1.1.1.2.2 snj SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
222 1.1.1.1.2.2 snj if test -f "$SRCFILE"; then
223 1.1.1.1.2.2 snj cp "$SRCFILE" y.tab.c
224 1.1.1.1.2.2 snj fi
225 1.1.1.1.2.2 snj SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
226 1.1.1.1.2.2 snj if test -f "$SRCFILE"; then
227 1.1.1.1.2.2 snj cp "$SRCFILE" y.tab.h
228 1.1.1.1.2.2 snj fi
229 1.1.1.1.2.2 snj ;;
230 1.1.1.1.2.2 snj esac
231 1.1.1.1.2.2 snj fi
232 1.1.1.1.2.2 snj if test ! -f y.tab.h; then
233 1.1.1.1.2.2 snj echo >y.tab.h
234 1.1.1.1.2.2 snj fi
235 1.1.1.1.2.2 snj if test ! -f y.tab.c; then
236 1.1.1.1.2.2 snj echo 'main() { return 0; }' >y.tab.c
237 1.1.1.1.2.2 snj fi
238 1.1.1.1.2.2 snj ;;
239 1.1.1.1.2.2 snj
240 1.1.1.1.2.2 snj lex*|flex*)
241 1.1.1.1.2.2 snj echo 1>&2 "\
242 1.1.1.1.2.2 snj WARNING: '$1' is $msg. You should only need it if
243 1.1.1.1.2.2 snj you modified a '.l' file. You may need the Flex package
244 1.1.1.1.2.2 snj in order for those modifications to take effect. You can get
245 1.1.1.1.2.2 snj Flex from any GNU archive site."
246 1.1.1.1.2.2 snj rm -f lex.yy.c
247 1.1.1.1.2.2 snj if test $# -ne 1; then
248 1.1.1.1.2.2 snj eval LASTARG=\${$#}
249 1.1.1.1.2.2 snj case $LASTARG in
250 1.1.1.1.2.2 snj *.l)
251 1.1.1.1.2.2 snj SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
252 1.1.1.1.2.2 snj if test -f "$SRCFILE"; then
253 1.1.1.1.2.2 snj cp "$SRCFILE" lex.yy.c
254 1.1.1.1.2.2 snj fi
255 1.1.1.1.2.2 snj ;;
256 1.1.1.1.2.2 snj esac
257 1.1.1.1.2.2 snj fi
258 1.1.1.1.2.2 snj if test ! -f lex.yy.c; then
259 1.1.1.1.2.2 snj echo 'main() { return 0; }' >lex.yy.c
260 1.1.1.1.2.2 snj fi
261 1.1.1.1.2.2 snj ;;
262 1.1.1.1.2.2 snj
263 1.1.1.1.2.2 snj help2man*)
264 1.1.1.1.2.2 snj echo 1>&2 "\
265 1.1.1.1.2.2 snj WARNING: '$1' is $msg. You should only need it if
266 1.1.1.1.2.2 snj you modified a dependency of a manual page. You may need the
267 1.1.1.1.2.2 snj Help2man package in order for those modifications to take
268 1.1.1.1.2.2 snj effect. You can get Help2man from any GNU archive site."
269 1.1.1.1.2.2 snj
270 1.1.1.1.2.2 snj file=`echo "$*" | sed -n "$sed_output"`
271 1.1.1.1.2.2 snj test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
272 1.1.1.1.2.2 snj if test -f "$file"; then
273 1.1.1.1.2.2 snj touch $file
274 1.1.1.1.2.2 snj else
275 1.1.1.1.2.2 snj test -z "$file" || exec >$file
276 1.1.1.1.2.2 snj echo ".ab help2man is required to generate this page"
277 1.1.1.1.2.2 snj exit $?
278 1.1.1.1.2.2 snj fi
279 1.1.1.1.2.2 snj ;;
280 1.1.1.1.2.2 snj
281 1.1.1.1.2.2 snj makeinfo*)
282 1.1.1.1.2.2 snj echo 1>&2 "\
283 1.1.1.1.2.2 snj WARNING: '$1' is $msg. You should only need it if
284 1.1.1.1.2.2 snj you modified a '.texi' or '.texinfo' file, or any other file
285 1.1.1.1.2.2 snj indirectly affecting the aspect of the manual. The spurious
286 1.1.1.1.2.2 snj call might also be the consequence of using a buggy 'make' (AIX,
287 1.1.1.1.2.2 snj DU, IRIX). You might want to install the Texinfo package or
288 1.1.1.1.2.2 snj the GNU make package. Grab either from any GNU archive site."
289 1.1.1.1.2.2 snj # The file to touch is that specified with -o ...
290 1.1.1.1.2.2 snj file=`echo "$*" | sed -n "$sed_output"`
291 1.1.1.1.2.2 snj test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
292 1.1.1.1.2.2 snj if test -z "$file"; then
293 1.1.1.1.2.2 snj # ... or it is the one specified with @setfilename ...
294 1.1.1.1.2.2 snj infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
295 1.1.1.1.2.2 snj file=`sed -n '
296 1.1.1.1.2.2 snj /^@setfilename/{
297 1.1.1.1.2.2 snj s/.* \([^ ]*\) *$/\1/
298 1.1.1.1.2.2 snj p
299 1.1.1.1.2.2 snj q
300 1.1.1.1.2.2 snj }' $infile`
301 1.1.1.1.2.2 snj # ... or it is derived from the source name (dir/f.texi becomes f.info)
302 1.1.1.1.2.2 snj test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
303 1.1.1.1.2.2 snj fi
304 1.1.1.1.2.2 snj # If the file does not exist, the user really needs makeinfo;
305 1.1.1.1.2.2 snj # let's fail without touching anything.
306 1.1.1.1.2.2 snj test -f $file || exit 1
307 1.1.1.1.2.2 snj touch $file
308 1.1.1.1.2.2 snj ;;
309 1.1.1.1.2.2 snj
310 1.1.1.1.2.2 snj *)
311 1.1.1.1.2.2 snj echo 1>&2 "\
312 1.1.1.1.2.2 snj WARNING: '$1' is needed, and is $msg.
313 1.1.1.1.2.2 snj You might have modified some files without having the
314 1.1.1.1.2.2 snj proper tools for further handling them. Check the 'README' file,
315 1.1.1.1.2.2 snj it often tells you about the needed prerequisites for installing
316 1.1.1.1.2.2 snj this package. You may also peek at any GNU archive site, in case
317 1.1.1.1.2.2 snj some other package would contain this missing '$1' program."
318 1.1.1.1.2.2 snj exit 1
319 1.1.1.1.2.2 snj ;;
320 1.1.1.1.2.2 snj esac
321 1.1.1.1.2.2 snj
322 1.1.1.1.2.2 snj exit 0
323 1.1.1.1.2.2 snj
324 1.1.1.1.2.2 snj # Local variables:
325 1.1.1.1.2.2 snj # eval: (add-hook 'write-file-hooks 'time-stamp)
326 1.1.1.1.2.2 snj # time-stamp-start: "scriptversion="
327 1.1.1.1.2.2 snj # time-stamp-format: "%:y-%02m-%02d.%02H"
328 1.1.1.1.2.2 snj # time-stamp-time-zone: "UTC"
329 1.1.1.1.2.2 snj # time-stamp-end: "; # UTC"
330 1.1.1.1.2.2 snj # End:
331