2 # Common stub for a few missing GNU programs while installing.
3 # Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
4 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 if test $# -eq 0; then
22 echo 1>&2 "Try \`$0 --help' for more information"
28 if test -f configure.ac
; then
29 configure_ac
=configure.ac
31 configure_ac
=configure.
in
36 # Try to run requested program, and just exit if it succeeds.
43 # If it does not exist, or fails to run (possibly an outdated version),
47 -h|
--h|
--he|
--hel|
--help)
49 $0 [OPTION]... PROGRAM [ARGUMENT]...
51 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
52 error status if there is no known handling for PROGRAM.
55 -h, --help display this help and exit
56 -v, --version output version information and exit
57 --run try to run the given command, and emulate it if it fails
59 Supported PROGRAM values:
60 aclocal touch file \`aclocal.m4'
61 autoconf touch file \`configure'
62 autoheader touch file \`config.h.in'
63 automake touch all \`Makefile.in' files
64 bison create \`y.tab.[ch]', if possible, from existing .[ch]
65 flex create \`lex.yy.c', if possible, from existing .c
66 help2man touch the output file
67 lex create \`lex.yy.c', if possible, from existing .c
68 makeinfo touch the output file
69 tar try tar, gnutar, gtar, then tar without non-portable flags
70 yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
73 -v|
--v|
--ve|
--ver|
--vers|
--versi|
--versio|
--version)
74 echo "missing 0.3 - GNU automake"
78 echo 1>&2 "$0: Unknown \`$1' option"
79 echo 1>&2 "Try \`$0 --help' for more information"
85 WARNING: \`$1' is missing on your system. You should only need it if
86 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
87 to install the \`Automake' and \`Perl' packages. Grab them from
88 any GNU archive site."
94 WARNING: \`$1' is missing on your system. You should only need it if
95 you modified \`${configure_ac}'. You might want to install the
96 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
103 WARNING: \`$1' is missing on your system. You should only need it if
104 you modified \`acconfig.h' or \`${configure_ac}'. You might want
105 to install the \`Autoconf' and \`GNU m4' packages. Grab them
106 from any GNU archive site."
107 files
=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
108 test -z "$files" && files
="config.h"
112 *:*) touch_files
="$touch_files "`echo "$f" |
113 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
114 *) touch_files
="$touch_files $f.in";;
122 WARNING: \`$1' is missing on your system. You should only need it if
123 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
124 You might want to install the \`Automake' and \`Perl' packages.
125 Grab them from any GNU archive site."
126 find .
-type f
-name Makefile.am
-print |
128 while read f
; do touch "$f"; done
133 WARNING: \`$1' is missing on your system. You should only need it if
134 you modified a \`.y' file. You may need the \`Bison' package
135 in order for those modifications to take effect. You can get
136 \`Bison' from any GNU archive site."
137 rm -f y.tab.c y.tab.h
138 if [ $# -ne 1 ]; then
139 eval LASTARG
="\${$#}"
142 SRCFILE
=`echo "$LASTARG" | sed 's/y$/c/'`
143 if [ -f "$SRCFILE" ]; then
144 cp "$SRCFILE" y.tab.c
146 SRCFILE
=`echo "$LASTARG" | sed 's/y$/h/'`
147 if [ -f "$SRCFILE" ]; then
148 cp "$SRCFILE" y.tab.h
153 if [ ! -f y.tab.h
]; then
156 if [ ! -f y.tab.c
]; then
157 echo 'main() { return 0; }' >y.tab.c
163 WARNING: \`$1' is missing on your system. You should only need it if
164 you modified a \`.l' file. You may need the \`Flex' package
165 in order for those modifications to take effect. You can get
166 \`Flex' from any GNU archive site."
168 if [ $# -ne 1 ]; then
169 eval LASTARG
="\${$#}"
172 SRCFILE
=`echo "$LASTARG" | sed 's/l$/c/'`
173 if [ -f "$SRCFILE" ]; then
174 cp "$SRCFILE" lex.yy.c
179 if [ ! -f lex.yy.c
]; then
180 echo 'main() { return 0; }' >lex.yy.c
186 WARNING: \`$1' is missing on your system. You should only need it if
187 you modified a dependency of a manual page. You may need the
188 \`Help2man' package in order for those modifications to take
189 effect. You can get \`Help2man' from any GNU archive site."
191 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
192 if test -z "$file"; then
193 file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
195 if [ -f "$file" ]; then
198 test -z "$file" ||
exec >$file
199 echo ".ab help2man is required to generate this page"
206 WARNING: \`$1' is missing on your system. You should only need it if
207 you modified a \`.texi' or \`.texinfo' file, or any other file
208 indirectly affecting the aspect of the manual. The spurious
209 call might also be the consequence of using a buggy \`make' (AIX,
210 DU, IRIX). You might want to install the \`Texinfo' package or
211 the \`GNU make' package. Grab either from any GNU archive site."
212 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
213 if test -z "$file"; then
214 file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
215 file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
222 if test -n "$run"; then
223 echo 1>&2 "ERROR: \`tar' requires --run"
227 # We have already tried tar in the generic part.
228 # Look for gnutar/gtar before invocation to avoid ugly error
230 if (gnutar
--version > /dev
/null
2>&1); then
231 gnutar
${1+"$@"} && exit 0
233 if (gtar
--version > /dev
/null
2>&1); then
234 gtar
${1+"$@"} && exit 0
240 firstarg
=`echo "$firstarg" | sed s/o//`
241 tar "$firstarg" ${1+"$@"} && exit 0
246 firstarg
=`echo "$firstarg" | sed s/h//`
247 tar "$firstarg" ${1+"$@"} && exit 0
253 WARNING: I can't seem to be able to run \`tar' with the given arguments.
254 You may want to install GNU tar or Free paxutils, or check the
255 command line arguments."
261 WARNING: \`$1' is needed, and you do not seem to have it handy on your
262 system. You might have modified some files without having the
263 proper tools for further handling them. Check the \`README' file,
264 it often tells you about the needed prerequirements for installing
265 this package. You may also peek at any GNU archive site, in case
266 some other package would contain this missing \`$1' program."