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