2 # Common stub for a few missing GNU programs while installing.
3 # Copyright (C) 1996-1997, 1999-2000, 2002, 2015 Free Software
5 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
27 if test $# -eq 0; then
28 echo 1>&2 "Try \`$0 --help' for more information"
34 # In the cases where this matters, `missing' is being run in the
36 if test -f configure.ac; then
37 configure_ac=configure.ac
39 configure_ac=configure.in
44 # Try to run requested program, and just exit if it succeeds.
51 # If it does not exist, or fails to run (possibly an outdated version),
55 -h|--h|--he|--hel|--help)
57 $0 [OPTION]... PROGRAM [ARGUMENT]...
59 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
60 error status if there is no known handling for PROGRAM.
63 -h, --help display this help and exit
64 -v, --version output version information and exit
65 --run try to run the given command, and emulate it if it fails
67 Supported PROGRAM values:
68 aclocal touch file \`aclocal.m4'
69 autoconf touch file \`configure'
70 autoheader touch file \`config.h.in'
71 automake touch all \`Makefile.in' files
72 bison create \`y.tab.[ch]', if possible, from existing .[ch]
73 flex create \`lex.yy.c', if possible, from existing .c
74 help2man touch the output file
75 lex create \`lex.yy.c', if possible, from existing .c
76 makeinfo touch the output file
77 tar try tar, gnutar, gtar, then tar without non-portable flags
78 yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
81 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
82 echo "missing 0.4 - GNU automake"
86 echo 1>&2 "$0: Unknown \`$1' option"
87 echo 1>&2 "Try \`$0 --help' for more information"
92 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
93 # We have it, but it failed.
98 WARNING: \`$1' is missing on your system. You should only need it if
99 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
100 to install the \`Automake' and \`Perl' packages. Grab them from
101 any GNU archive site."
106 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
107 # We have it, but it failed.
112 WARNING: \`$1' is missing on your system. You should only need it if
113 you modified \`${configure_ac}'. You might want to install the
114 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
120 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
121 # We have it, but it failed.
126 WARNING: \`$1' is missing on your system. You should only need it if
127 you modified \`acconfig.h' or \`${configure_ac}'. You might want
128 to install the \`Autoconf' and \`GNU m4' packages. Grab them
129 from any GNU archive site."
130 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
131 test -z "$files" && files="config.h"
135 *:*) touch_files="$touch_files "`echo "$f" |
136 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
137 *) touch_files="$touch_files $f.in";;
144 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
145 # We have it, but it failed.
150 WARNING: \`$1' is missing on your system. You should only need it if
151 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
152 You might want to install the \`Automake' and \`Perl' packages.
153 Grab them from any GNU archive site."
154 find . -type f -name Makefile.am -print |
156 while read f; do touch "$f"; done
160 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
161 # We have it, but it failed.
166 WARNING: \`$1' is needed, and you do not seem to have it handy on your
167 system. You might have modified some files without having the
168 proper tools for further handling them.
169 You can get \`$1Help2man' as part of \`Autoconf' from any GNU
172 file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
173 test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
174 if test -f "$file"; then
177 test -z "$file" || exec >$file
179 echo "# Created by GNU Automake missing as a replacement of"
189 WARNING: \`$1' is missing on your system. You should only need it if
190 you modified a \`.y' file. You may need the \`Bison' package
191 in order for those modifications to take effect. You can get
192 \`Bison' from any GNU archive site."
193 rm -f y.tab.c y.tab.h
194 if [ $# -ne 1 ]; then
195 eval LASTARG="\${$#}"
198 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
199 if [ -f "$SRCFILE" ]; then
200 cp "$SRCFILE" y.tab.c
202 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
203 if [ -f "$SRCFILE" ]; then
204 cp "$SRCFILE" y.tab.h
209 if [ ! -f y.tab.h ]; then
212 if [ ! -f y.tab.c ]; then
213 echo 'main() { return 0; }' >y.tab.c
219 WARNING: \`$1' is missing on your system. You should only need it if
220 you modified a \`.l' file. You may need the \`Flex' package
221 in order for those modifications to take effect. You can get
222 \`Flex' from any GNU archive site."
224 if [ $# -ne 1 ]; then
225 eval LASTARG="\${$#}"
228 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
229 if [ -f "$SRCFILE" ]; then
230 cp "$SRCFILE" lex.yy.c
235 if [ ! -f lex.yy.c ]; then
236 echo 'main() { return 0; }' >lex.yy.c
241 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
242 # We have it, but it failed.
247 WARNING: \`$1' is missing on your system. You should only need it if
248 you modified a dependency of a manual page. You may need the
249 \`Help2man' package in order for those modifications to take
250 effect. You can get \`Help2man' from any GNU archive site."
252 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
253 if test -z "$file"; then
254 file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
256 if [ -f "$file" ]; then
259 test -z "$file" || exec >$file
260 echo ".ab help2man is required to generate this page"
266 if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
267 # We have makeinfo, but it failed.
272 WARNING: \`$1' is missing on your system. You should only need it if
273 you modified a \`.texi' or \`.texinfo' file, or any other file
274 indirectly affecting the aspect of the manual. The spurious
275 call might also be the consequence of using a buggy \`make' (AIX,
276 DU, IRIX). You might want to install the \`Texinfo' package or
277 the \`GNU make' package. Grab either from any GNU archive site."
278 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
279 if test -z "$file"; then
280 file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
281 file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
288 if test -n "$run"; then
289 echo 1>&2 "ERROR: \`tar' requires --run"
293 # We have already tried tar in the generic part.
294 # Look for gnutar/gtar before invocation to avoid ugly error
296 if (gnutar --version > /dev/null 2>&1); then
297 gnutar "$@" && exit 0
299 if (gtar --version > /dev/null 2>&1); then
306 firstarg=`echo "$firstarg" | sed s/o//`
307 tar "$firstarg" "$@" && exit 0
312 firstarg=`echo "$firstarg" | sed s/h//`
313 tar "$firstarg" "$@" && exit 0
319 WARNING: I can't seem to be able to run \`tar' with the given arguments.
320 You may want to install GNU tar or Free paxutils, or check the
321 command line arguments."
327 WARNING: \`$1' is needed, and you do not seem to have it handy on your
328 system. You might have modified some files without having the
329 proper tools for further handling them. Check the \`README' file,
330 it often tells you about the needed prerequirements for installing
331 this package. You may also peek at any GNU archive site, in case
332 some other package would contain this missing \`$1' program."