2 # Common wrapper for a few potentially missing GNU programs.
4 scriptversion=2012-06-23.01; # UTC
6 # Copyright (C) 1996-2012 Free Software Foundation, Inc.
7 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
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"
32 # In the cases where this matters, 'missing' is being run in the
34 if test -f configure.ac; then
35 configure_ac=configure.ac
37 configure_ac=configure.in
43 # Used by our autoconf macros to check whether the available missing
44 # script is modern enough.
48 -h|--h|--he|--hel|--help)
50 $0 [OPTION]... PROGRAM [ARGUMENT]...
52 Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
53 to PROGRAM being missing or too old.
56 -h, --help display this help and exit
57 -v, --version output version information and exit
59 Supported PROGRAM values:
60 aclocal autoconf autoheader autom4te automake makeinfo
61 bison yacc flex lex help2man
63 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
64 'g' are ignored when checking the name.
66 Send bug reports to <bug-automake@gnu.org>."
70 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
71 echo "missing $scriptversion (GNU Automake)"
76 echo 1>&2 "$0: unknown '$1' option"
77 echo 1>&2 "Try '$0 --help' for more information"
83 # Run the given program, remember its exit status.
86 # If it succeeded, we are done.
87 test $st -eq 0 && exit 0
89 # Also exit now if we it failed (or wasn't found), and '--version' was
90 # passed; such an option is passed most likely to detect whether the
91 # program is present and works.
92 case $2 in --version|--help) exit $st;; esac
94 # Exit code 63 means version mismatch. This often happens when the user
95 # tries to use an ancient version of a tool on a file that requires a
97 if test $st -eq 63; then
98 msg="probably too old"
99 elif test $st -eq 127; then
100 # Program was missing.
101 msg="missing on your system"
103 # Program was found and executed, but failed. Give up.
107 perl_URL=http://www.perl.org/
108 flex_URL=http://flex.sourceforge.net/
109 gnu_software_URL=http://www.gnu.org/software
115 echo "The '$1' program is part of the GNU Automake package:"
116 echo "<$gnu_software_URL/automake>"
117 echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
118 echo "<$gnu_software_URL/autoconf>"
119 echo "<$gnu_software_URL/m4/>"
122 autoconf|autom4te|autoheader)
123 echo "The '$1' program is part of the GNU Autoconf package:"
124 echo "<$gnu_software_URL/autoconf/>"
125 echo "It also requires GNU m4 and Perl in order to run:"
126 echo "<$gnu_software_URL/m4/>"
134 # Normalize program name to check for.
135 normalized_program=`echo "$1" | sed '
140 printf '%s\n' "'$1' is $msg."
142 configure_deps="'${configure_ac}' or m4 files included by '${configure_ac}'"
143 case $normalized_program in
145 echo "You should only need it if you modified '${configure_ac}',"
146 echo "or m4 files included by it."
147 program_details 'autoconf'
150 echo "You should only need it if you modified 'acconfig.h' or"
151 echo "$configure_deps."
152 program_details 'autoheader'
155 echo "You should only need it if you modified 'Makefile.am' or"
156 echo "$configure_deps."
157 program_details 'automake'
160 echo "You should only need it if you modified 'acinclude.m4' or"
161 echo "$configure_deps."
162 program_details 'aclocal'
165 echo "You might have modified some maintainer files that require"
166 echo "the 'automa4te' program to be rebuilt."
167 program_details 'autom4te'
170 echo "You should only need it if you modified a '.y' file."
171 echo "You may want to install the GNU Bison package:"
172 echo "<$gnu_software_URL/bison/>"
175 echo "You should only need it if you modified a '.l' file."
176 echo "You may want to install the Fast Lexical Analyzer package:"
180 echo "You should only need it if you modified a dependency" \
182 echo "You may want to install the GNU Help2man package:"
183 echo "<$gnu_software_URL/help2man/>"
186 echo "You should only need it if you modified a '.texi' file, or"
187 echo "any other file indirectly affecting the aspect of the manual."
188 echo "You might want to install the Texinfo package:"
189 echo "<$gnu_software_URL/texinfo/>"
190 echo "The spurious makeinfo call might also be the consequence of"
191 echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
192 echo "want to install GNU make:"
193 echo "<$gnu_software_URL/make/>"
196 echo "You might have modified some files without having the proper"
197 echo "tools for further handling them. Check the 'README' file, it"
198 echo "often tells you about the needed prerequisites for installing"
199 echo "this package. You may also peek at any GNU archive site, in"
200 echo "case some other package contains this missing '$1' program."
205 give_advice "$1" | sed -e '1s/^/WARNING: /' \
208 # Propagate the correct exit status (expected to be 127 for a program
209 # not found, 63 for a program that failed due to version mismatch).
213 # eval: (add-hook 'write-file-hooks 'time-stamp)
214 # time-stamp-start: "scriptversion="
215 # time-stamp-format: "%:y-%02m-%02d.%02H"
216 # time-stamp-time-zone: "UTC"
217 # time-stamp-end: "; # UTC"