2 # Common stub for a few missing GNU programs while installing.
4 scriptversion
=2003-09-02.23
6 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003
7 # Free Software Foundation, Inc.
8 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2, or (at your option)
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 # As a special exception to the GNU General Public License, if you
25 # distribute this file as part of a program that contains a
26 # configuration script generated by Autoconf, you may include it under
27 # the same distribution terms that you use for the rest of that program.
29 if test $# -eq 0; then
30 echo 1>&2 "Try \`$0 --help' for more information"
36 # In the cases where this matters, `missing' is being run in the
38 if test -f configure.ac
; then
39 configure_ac
=configure.ac
41 configure_ac
=configure.
in
44 msg
="missing on your system"
48 # Try to run requested program, and just exit if it succeeds.
52 # Exit code 63 means version mismatch. This often happens
53 # when the user try to use an ancient version of a tool on
54 # a file that requires a minimum version. In this case we
55 # we should proceed has if the program had been absent, or
56 # if --run hadn't been passed.
59 msg
="probably too old"
64 # If it does not exist, or fails to run (possibly an outdated version),
68 -h|
--h|
--he|
--hel|
--help)
70 $0 [OPTION]... PROGRAM [ARGUMENT]...
72 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
73 error status if there is no known handling for PROGRAM.
76 -h, --help display this help and exit
77 -v, --version output version information and exit
78 --run try to run the given command, and emulate it if it fails
80 Supported PROGRAM values:
81 aclocal touch file \`aclocal.m4'
82 autoconf touch file \`configure'
83 autoheader touch file \`config.h.in'
84 automake touch all \`Makefile.in' files
85 bison create \`y.tab.[ch]', if possible, from existing .[ch]
86 flex create \`lex.yy.c', if possible, from existing .c
87 help2man touch the output file
88 lex create \`lex.yy.c', if possible, from existing .c
89 makeinfo touch the output file
90 tar try tar, gnutar, gtar, then tar without non-portable flags
91 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
93 Send bug reports to <bug-automake@gnu.org>."
96 -v|
--v|
--ve|
--ver|
--vers|
--versi|
--versio|
--version)
97 echo "missing $scriptversion (GNU Automake)"
101 echo 1>&2 "$0: Unknown \`$1' option"
102 echo 1>&2 "Try \`$0 --help' for more information"
107 if test -z "$run" && ($1 --version) > /dev
/null
2>&1; then
108 # We have it, but it failed.
113 WARNING: \`$1' is $msg. You should only need it if
114 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
115 to install the \`Automake' and \`Perl' packages. Grab them from
116 any GNU archive site."
121 if test -z "$run" && ($1 --version) > /dev
/null
2>&1; then
122 # We have it, but it failed.
127 WARNING: \`$1' is $msg. You should only need it if
128 you modified \`${configure_ac}'. You might want to install the
129 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
135 if test -z "$run" && ($1 --version) > /dev
/null
2>&1; then
136 # We have it, but it failed.
141 WARNING: \`$1' is $msg. You should only need it if
142 you modified \`acconfig.h' or \`${configure_ac}'. You might want
143 to install the \`Autoconf' and \`GNU m4' packages. Grab them
144 from any GNU archive site."
145 files
=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
146 test -z "$files" && files
="config.h"
150 *:*) touch_files
="$touch_files "`echo "$f" |
151 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
152 *) touch_files
="$touch_files $f.in";;
159 if test -z "$run" && ($1 --version) > /dev
/null
2>&1; then
160 # We have it, but it failed.
165 WARNING: \`$1' is $msg. You should only need it if
166 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
167 You might want to install the \`Automake' and \`Perl' packages.
168 Grab them from any GNU archive site."
169 find .
-type f
-name Makefile.am
-print |
171 while read f
; do touch "$f"; done
175 if test -z "$run" && ($1 --version) > /dev
/null
2>&1; then
176 # We have it, but it failed.
181 WARNING: \`$1' is needed, but is $msg.
182 You might have modified some files without having the
183 proper tools for further handling them.
184 You can get \`$1' as part of \`Autoconf' from any GNU
187 file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
188 test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
189 if test -f "$file"; then
192 test -z "$file" ||
exec >$file
194 echo "# Created by GNU Automake missing as a replacement of"
204 WARNING: \`$1' $msg. You should only need it if
205 you modified a \`.y' file. You may need the \`Bison' package
206 in order for those modifications to take effect. You can get
207 \`Bison' from any GNU archive site."
208 rm -f y.tab.c y.tab.h
209 if [ $# -ne 1 ]; then
210 eval LASTARG
="\${$#}"
213 SRCFILE
=`echo "$LASTARG" | sed 's/y$/c/'`
214 if [ -f "$SRCFILE" ]; then
215 cp "$SRCFILE" y.tab.c
217 SRCFILE
=`echo "$LASTARG" | sed 's/y$/h/'`
218 if [ -f "$SRCFILE" ]; then
219 cp "$SRCFILE" y.tab.h
224 if [ ! -f y.tab.h
]; then
227 if [ ! -f y.tab.c
]; then
228 echo 'main() { return 0; }' >y.tab.c
234 WARNING: \`$1' is $msg. You should only need it if
235 you modified a \`.l' file. You may need the \`Flex' package
236 in order for those modifications to take effect. You can get
237 \`Flex' from any GNU archive site."
239 if [ $# -ne 1 ]; then
240 eval LASTARG
="\${$#}"
243 SRCFILE
=`echo "$LASTARG" | sed 's/l$/c/'`
244 if [ -f "$SRCFILE" ]; then
245 cp "$SRCFILE" lex.yy.c
250 if [ ! -f lex.yy.c
]; then
251 echo 'main() { return 0; }' >lex.yy.c
256 if test -z "$run" && ($1 --version) > /dev
/null
2>&1; then
257 # We have it, but it failed.
262 WARNING: \`$1' is $msg. You should only need it if
263 you modified a dependency of a manual page. You may need the
264 \`Help2man' package in order for those modifications to take
265 effect. You can get \`Help2man' from any GNU archive site."
267 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
268 if test -z "$file"; then
269 file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
271 if [ -f "$file" ]; then
274 test -z "$file" ||
exec >$file
275 echo ".ab help2man is required to generate this page"
281 if test -z "$run" && (makeinfo
--version) > /dev
/null
2>&1; then
282 # We have makeinfo, but it failed.
287 WARNING: \`$1' is $msg. You should only need it if
288 you modified a \`.texi' or \`.texinfo' file, or any other file
289 indirectly affecting the aspect of the manual. The spurious
290 call might also be the consequence of using a buggy \`make' (AIX,
291 DU, IRIX). You might want to install the \`Texinfo' package or
292 the \`GNU make' package. Grab either from any GNU archive site."
293 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
294 if test -z "$file"; then
295 file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
296 file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
303 if test -n "$run"; then
304 echo 1>&2 "ERROR: \`tar' requires --run"
308 # We have already tried tar in the generic part.
309 # Look for gnutar/gtar before invocation to avoid ugly error
311 if (gnutar
--version > /dev
/null
2>&1); then
312 gnutar
"$@" && exit 0
314 if (gtar
--version > /dev
/null
2>&1); then
321 firstarg
=`echo "$firstarg" | sed s/o//`
322 tar "$firstarg" "$@" && exit 0
327 firstarg
=`echo "$firstarg" | sed s/h//`
328 tar "$firstarg" "$@" && exit 0
334 WARNING: I can't seem to be able to run \`tar' with the given arguments.
335 You may want to install GNU tar or Free paxutils, or check the
336 command line arguments."
342 WARNING: \`$1' is needed, and is $msg.
343 You might have modified some files without having the
344 proper tools for further handling them. Check the \`README' file,
345 it often tells you about the needed prerequisites for installing
346 this package. You may also peek at any GNU archive site, in case
347 some other package would contain this missing \`$1' program."
355 # eval: (add-hook 'write-file-hooks 'time-stamp)
356 # time-stamp-start: "scriptversion="
357 # time-stamp-format: "%:y-%02m-%02d.%02H"
358 # time-stamp-end: "$"