2 # Common stub for a few missing GNU programs while installing.
\r
4 scriptversion=2005-06-08.21
\r
6 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
\r
7 # Free Software Foundation, Inc.
\r
8 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
\r
10 # This program is free software; you can redistribute it and/or modify
\r
11 # it under the terms of the GNU General Public License as published by
\r
12 # the Free Software Foundation; either version 2, or (at your option)
\r
13 # any later version.
\r
15 # This program is distributed in the hope that it will be useful,
\r
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
18 # GNU General Public License for more details.
\r
20 # You should have received a copy of the GNU General Public License
\r
21 # along with this program; if not, write to the Free Software
\r
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
\r
25 # As a special exception to the GNU General Public License, if you
\r
26 # distribute this file as part of a program that contains a
\r
27 # configuration script generated by Autoconf, you may include it under
\r
28 # the same distribution terms that you use for the rest of that program.
\r
30 if test $# -eq 0; then
\r
31 echo 1>&2 "Try \`$0 --help' for more information"
\r
37 # In the cases where this matters, `missing' is being run in the
\r
39 if test -f configure.ac; then
\r
40 configure_ac=configure.ac
\r
42 configure_ac=configure.in
\r
45 msg="missing on your system"
\r
49 # Try to run requested program, and just exit if it succeeds.
\r
53 # Exit code 63 means version mismatch. This often happens
\r
54 # when the user try to use an ancient version of a tool on
\r
55 # a file that requires a minimum version. In this case we
\r
56 # we should proceed has if the program had been absent, or
\r
57 # if --run hadn't been passed.
\r
58 if test $? = 63; then
\r
60 msg="probably too old"
\r
64 -h|--h|--he|--hel|--help)
\r
66 $0 [OPTION]... PROGRAM [ARGUMENT]...
\r
68 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
\r
69 error status if there is no known handling for PROGRAM.
\r
72 -h, --help display this help and exit
\r
73 -v, --version output version information and exit
\r
74 --run try to run the given command, and emulate it if it fails
\r
76 Supported PROGRAM values:
\r
77 aclocal touch file \`aclocal.m4'
\r
78 autoconf touch file \`configure'
\r
79 autoheader touch file \`config.h.in'
\r
80 automake touch all \`Makefile.in' files
\r
81 bison create \`y.tab.[ch]', if possible, from existing .[ch]
\r
82 flex create \`lex.yy.c', if possible, from existing .c
\r
83 help2man touch the output file
\r
84 lex create \`lex.yy.c', if possible, from existing .c
\r
85 makeinfo touch the output file
\r
86 tar try tar, gnutar, gtar, then tar without non-portable flags
\r
87 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
\r
89 Send bug reports to <bug-automake@gnu.org>."
\r
93 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
\r
94 echo "missing $scriptversion (GNU Automake)"
\r
99 echo 1>&2 "$0: Unknown \`$1' option"
\r
100 echo 1>&2 "Try \`$0 --help' for more information"
\r
106 # Now exit if we have it, but it failed. Also exit now if we
\r
107 # don't have it and --version was passed (most likely to detect
\r
111 # Not GNU programs, they don't have --version.
\r
115 if test -n "$run"; then
\r
116 echo 1>&2 "ERROR: \`tar' requires --run"
\r
118 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
\r
124 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
\r
125 # We have it, but it failed.
\r
127 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
\r
128 # Could not run --version or --help. This is probably someone
\r
129 # running `$TOOL --version' or `$TOOL --help' to check whether
\r
130 # $TOOL exists and not knowing $TOOL uses missing.
\r
136 # If it does not exist, or fails to run (possibly an outdated version),
\r
137 # try to emulate it.
\r
141 WARNING: \`$1' is $msg. You should only need it if
\r
142 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
\r
143 to install the \`Automake' and \`Perl' packages. Grab them from
\r
144 any GNU archive site."
\r
150 WARNING: \`$1' is $msg. You should only need it if
\r
151 you modified \`${configure_ac}'. You might want to install the
\r
152 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
\r
159 WARNING: \`$1' is $msg. You should only need it if
\r
160 you modified \`acconfig.h' or \`${configure_ac}'. You might want
\r
161 to install the \`Autoconf' and \`GNU m4' packages. Grab them
\r
162 from any GNU archive site."
\r
163 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
\r
164 test -z "$files" && files="config.h"
\r
166 for f in $files; do
\r
168 *:*) touch_files="$touch_files "`echo "$f" |
\r
169 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
\r
170 *) touch_files="$touch_files $f.in";;
\r
178 WARNING: \`$1' is $msg. You should only need it if
\r
179 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
\r
180 You might want to install the \`Automake' and \`Perl' packages.
\r
181 Grab them from any GNU archive site."
\r
182 find . -type f -name Makefile.am -print |
\r
183 sed 's/\.am$/.in/' |
\r
184 while read f; do touch "$f"; done
\r
189 WARNING: \`$1' is needed, but is $msg.
\r
190 You might have modified some files without having the
\r
191 proper tools for further handling them.
\r
192 You can get \`$1' as part of \`Autoconf' from any GNU
\r
195 file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
\r
196 test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
\r
197 if test -f "$file"; then
\r
200 test -z "$file" || exec >$file
\r
202 echo "# Created by GNU Automake missing as a replacement of"
\r
212 WARNING: \`$1' $msg. You should only need it if
\r
213 you modified a \`.y' file. You may need the \`Bison' package
\r
214 in order for those modifications to take effect. You can get
\r
215 \`Bison' from any GNU archive site."
\r
216 rm -f y.tab.c y.tab.h
\r
217 if [ $# -ne 1 ]; then
\r
218 eval LASTARG="\${$#}"
\r
221 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
\r
222 if [ -f "$SRCFILE" ]; then
\r
223 cp "$SRCFILE" y.tab.c
\r
225 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
\r
226 if [ -f "$SRCFILE" ]; then
\r
227 cp "$SRCFILE" y.tab.h
\r
232 if [ ! -f y.tab.h ]; then
\r
235 if [ ! -f y.tab.c ]; then
\r
236 echo 'main() { return 0; }' >y.tab.c
\r
242 WARNING: \`$1' is $msg. You should only need it if
\r
243 you modified a \`.l' file. You may need the \`Flex' package
\r
244 in order for those modifications to take effect. You can get
\r
245 \`Flex' from any GNU archive site."
\r
247 if [ $# -ne 1 ]; then
\r
248 eval LASTARG="\${$#}"
\r
251 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
\r
252 if [ -f "$SRCFILE" ]; then
\r
253 cp "$SRCFILE" lex.yy.c
\r
258 if [ ! -f lex.yy.c ]; then
\r
259 echo 'main() { return 0; }' >lex.yy.c
\r
265 WARNING: \`$1' is $msg. You should only need it if
\r
266 you modified a dependency of a manual page. You may need the
\r
267 \`Help2man' package in order for those modifications to take
\r
268 effect. You can get \`Help2man' from any GNU archive site."
\r
270 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
\r
271 if test -z "$file"; then
\r
272 file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
\r
274 if [ -f "$file" ]; then
\r
277 test -z "$file" || exec >$file
\r
278 echo ".ab help2man is required to generate this page"
\r
285 WARNING: \`$1' is $msg. You should only need it if
\r
286 you modified a \`.texi' or \`.texinfo' file, or any other file
\r
287 indirectly affecting the aspect of the manual. The spurious
\r
288 call might also be the consequence of using a buggy \`make' (AIX,
\r
289 DU, IRIX). You might want to install the \`Texinfo' package or
\r
290 the \`GNU make' package. Grab either from any GNU archive site."
\r
291 # The file to touch is that specified with -o ...
\r
292 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
\r
293 if test -z "$file"; then
\r
294 # ... or it is the one specified with @setfilename ...
\r
295 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
\r
296 file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
\r
297 # ... or it is derived from the source name (dir/f.texi becomes f.info)
\r
298 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
\r
300 # If the file does not exist, the user really needs makeinfo;
\r
301 # let's fail without touching anything.
\r
302 test -f $file || exit 1
\r
309 # We have already tried tar in the generic part.
\r
310 # Look for gnutar/gtar before invocation to avoid ugly error
\r
312 if (gnutar --version > /dev/null 2>&1); then
\r
313 gnutar "$@" && exit 0
\r
315 if (gtar --version > /dev/null 2>&1); then
\r
316 gtar "$@" && exit 0
\r
320 case "$firstarg" in
\r
322 firstarg=`echo "$firstarg" | sed s/o//`
\r
323 tar "$firstarg" "$@" && exit 0
\r
326 case "$firstarg" in
\r
328 firstarg=`echo "$firstarg" | sed s/h//`
\r
329 tar "$firstarg" "$@" && exit 0
\r
335 WARNING: I can't seem to be able to run \`tar' with the given arguments.
\r
336 You may want to install GNU tar or Free paxutils, or check the
\r
337 command line arguments."
\r
343 WARNING: \`$1' is needed, and is $msg.
\r
344 You might have modified some files without having the
\r
345 proper tools for further handling them. Check the \`README' file,
\r
346 it often tells you about the needed prerequisites for installing
\r
347 this package. You may also peek at any GNU archive site, in case
\r
348 some other package would contain this missing \`$1' program."
\r
356 # eval: (add-hook 'write-file-hooks 'time-stamp)
\r
357 # time-stamp-start: "scriptversion="
\r
358 # time-stamp-format: "%:y-%02m-%02d.%02H"
\r
359 # time-stamp-end: "$"
\r