2 # Common wrapper for a few potentially missing GNU programs.
4 scriptversion=2012-06-14.10; # 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 # Normalize program name to check for.
108 program=`echo "$1" | sed '
113 # If it does not exist, or fails to run (possibly an outdated version),
114 # advise the user how to get it.
119 WARNING: '$1' is $msg. You should only need it if
120 you modified 'acinclude.m4' or '${configure_ac}'. You might want
121 to install the Automake and Perl packages. Grab them from
122 any GNU archive site."
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 WARNING: '$1' is $msg. You should only need it if
136 you modified 'acconfig.h' or '${configure_ac}'. You might want
137 to install the Autoconf and GNU m4 packages. Grab them
138 from any GNU archive site."
143 WARNING: '$1' is $msg. You should only need it if
144 you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
145 You might want to install the Automake and Perl packages.
146 Grab them from any GNU archive site."
151 WARNING: '$1' is needed, but is $msg.
152 You might have modified some files without having the
153 proper tools for further handling them.
154 You can get '$1' as part of Autoconf from any GNU
160 WARNING: '$1' $msg. You should only need it if
161 you modified a '.y' file. You may need the Bison package
162 in order for those modifications to take effect. You can get
163 Bison from any GNU archive site."
168 WARNING: '$1' is $msg. You should only need it if
169 you modified a '.l' file. You may need the Flex package
170 in order for those modifications to take effect. You can get
171 Flex from any GNU archive site."
176 WARNING: '$1' is $msg. You should only need it if
177 you modified a dependency of a manual page. You may need the
178 Help2man package in order for those modifications to take
179 effect. You can get Help2man from any GNU archive site."
184 WARNING: '$1' is $msg. You should only need it if
185 you modified a '.texi' or '.texinfo' file, or any other file
186 indirectly affecting the aspect of the manual. The spurious
187 call might also be the consequence of using a buggy 'make' (AIX,
188 DU, IRIX). You might want to install the Texinfo package or
189 the GNU make package. Grab either from any GNU archive site."
194 WARNING: '$1' is needed, and is $msg.
195 You might have modified some files without having the
196 proper tools for further handling them. Check the 'README' file,
197 it often tells you about the needed prerequisites for installing
198 this package. You may also peek at any GNU archive site, in case
199 some other package would contain this missing '$1' program."
204 # Propagate the correct exit status (expected to be 127 for a program
205 # not found, 63 for a program that failed due to version mismatch).
209 # eval: (add-hook 'write-file-hooks 'time-stamp)
210 # time-stamp-start: "scriptversion="
211 # time-stamp-format: "%:y-%02m-%02d.%02H"
212 # time-stamp-time-zone: "UTC"
213 # time-stamp-end: "; # UTC"