init version.
[bush.git] / support / missing
blob31977a1ed7d41c09c79f180eaab630149cbd9cbc
1 #! /bin/sh
2 # Common stub for a few missing GNU programs while installing.
3 # Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 # Franc,ois 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 3 of the License, or
9 # (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
20 if test $# -eq 0; then
21 echo 1>&2 "Try \`$0 --help' for more information"
22 exit 1
25 case "$1" in
27 -h|--h|--he|--hel|--help)
28 echo "\
29 $0 [OPTION]... PROGRAM [ARGUMENT]...
31 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
32 error status if there is no known handling for PROGRAM.
34 Options:
35 -h, --help display this help and exit
36 -v, --version output version information and exit
38 Supported PROGRAM values:
39 aclocal touch file \`aclocal.m4'
40 autoconf touch file \`configure'
41 autoheader touch file \`config.h.in'
42 automake touch all \`Makefile.in' files
43 bison create \`y.tab.[ch]', if possible, from existing .[ch]
44 flex create \`lex.yy.c', if possible, from existing .c
45 lex create \`lex.yy.c', if possible, from existing .c
46 makeinfo touch the output file
47 yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
50 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
51 echo "missing - GNU libit 0.0"
54 -*)
55 echo 1>&2 "$0: Unknown \`$1' option"
56 echo 1>&2 "Try \`$0 --help' for more information"
57 exit 1
60 aclocal)
61 echo 1>&2 "\
62 WARNING: \`$1' is missing on your system. You should only need it if
63 you modified \`acinclude.m4' or \`configure.in'. You might want
64 to install the \`Automake' and \`Perl' packages. Grab them from
65 any GNU archive site."
66 touch aclocal.m4
69 autoconf)
70 echo 1>&2 "\
71 WARNING: \`$1' is missing on your system. You should only need it if
72 you modified \`configure.in'. You might want to install the
73 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
74 archive site."
75 touch configure
78 autoheader)
79 echo 1>&2 "\
80 WARNING: \`$1' is missing on your system. You should only need it if
81 you modified \`acconfig.h' or \`configure.in'. You might want
82 to install the \`Autoconf' and \`GNU m4' packages. Grab them
83 from any GNU archive site."
84 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in`
85 if test -z "$files"; then
86 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in`
87 test -z "$files" || files="$files.in"
88 else
89 files=`echo "$files" | sed -e 's/:/ /g'`
91 test -z "$files" && files="config.h.in"
92 touch $files
95 automake)
96 echo 1>&2 "\
97 WARNING: \`$1' is missing on your system. You should only need it if
98 you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
99 You might want to install the \`Automake' and \`Perl' packages.
100 Grab them from any GNU archive site."
101 find . -type f -name Makefile.am -print \
102 | sed 's/^\(.*\).am$/touch \1.in/' \
103 | sh
106 bison|yacc)
107 echo 1>&2 "\
108 WARNING: \`$1' is missing on your system. You should only need it if
109 you modified a \`.y' file. You may need the \`Bison' package
110 in order for those modifications to take effect. You can get
111 \`Bison' from any GNU archive site."
112 rm -f y.tab.c y.tab.h
113 if [ $# -ne 1 ]; then
114 eval LASTARG="\${$#}"
115 case "$LASTARG" in
116 *.y)
117 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
118 if [ -f "$SRCFILE" ]; then
119 cp "$SRCFILE" y.tab.c
121 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
122 if [ -f "$SRCFILE" ]; then
123 cp "$SRCFILE" y.tab.h
126 esac
128 if [ ! -f y.tab.h ]; then
129 echo >y.tab.h
131 if [ ! -f y.tab.c ]; then
132 echo 'main() { return 0; }' >y.tab.c
136 lex|flex)
137 echo 1>&2 "\
138 WARNING: \`$1' is missing on your system. You should only need it if
139 you modified a \`.l' file. You may need the \`Flex' package
140 in order for those modifications to take effect. You can get
141 \`Flex' from any GNU archive site."
142 rm -f lex.yy.c
143 if [ $# -ne 1 ]; then
144 eval LASTARG="\${$#}"
145 case "$LASTARG" in
146 *.l)
147 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
148 if [ -f "$SRCFILE" ]; then
149 cp "$SRCFILE" lex.yy.c
152 esac
154 if [ ! -f lex.yy.c ]; then
155 echo 'main() { return 0; }' >lex.yy.c
159 makeinfo)
160 echo 1>&2 "\
161 WARNING: \`$1' is missing on your system. You should only need it if
162 you modified a \`.texi' or \`.texinfo' file, or any other file
163 indirectly affecting the aspect of the manual. The spurious
164 call might also be the consequence of using a buggy \`make' (AIX,
165 DU, IRIX). You might want to install the \`Texinfo' package or
166 the \`GNU make' package. Grab either from any GNU archive site."
167 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
168 if test -z "$file"; then
169 file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
170 file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
172 touch $file
176 echo 1>&2 "\
177 WARNING: \`$1' is needed, and you do not seem to have it handy on your
178 system. You might have modified some files without having the
179 proper tools for further handling them. Check the \`README' file,
180 it often tells you about the needed prerequirements for installing
181 this package. You may also peek at any GNU archive site, in case
182 some other package would contain this missing \`$1' program."
183 exit 1
185 esac
187 exit 0