missing

Wed, 31 May 2017 12:20:04 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 31 May 2017 12:20:04 +0200
changeset 48
0d2c13c24fd0
permissions
-rwxr-xr-x

adds remaining autoconf files

universe@48 1 #! /bin/sh
universe@48 2 # Common wrapper for a few potentially missing GNU programs.
universe@48 3
universe@48 4 scriptversion=2012-06-26.16; # UTC
universe@48 5
universe@48 6 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
universe@48 7 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
universe@48 8
universe@48 9 # This program is free software; you can redistribute it and/or modify
universe@48 10 # it under the terms of the GNU General Public License as published by
universe@48 11 # the Free Software Foundation; either version 2, or (at your option)
universe@48 12 # any later version.
universe@48 13
universe@48 14 # This program is distributed in the hope that it will be useful,
universe@48 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
universe@48 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
universe@48 17 # GNU General Public License for more details.
universe@48 18
universe@48 19 # You should have received a copy of the GNU General Public License
universe@48 20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
universe@48 21
universe@48 22 # As a special exception to the GNU General Public License, if you
universe@48 23 # distribute this file as part of a program that contains a
universe@48 24 # configuration script generated by Autoconf, you may include it under
universe@48 25 # the same distribution terms that you use for the rest of that program.
universe@48 26
universe@48 27 if test $# -eq 0; then
universe@48 28 echo 1>&2 "Try '$0 --help' for more information"
universe@48 29 exit 1
universe@48 30 fi
universe@48 31
universe@48 32 case $1 in
universe@48 33
universe@48 34 --is-lightweight)
universe@48 35 # Used by our autoconf macros to check whether the available missing
universe@48 36 # script is modern enough.
universe@48 37 exit 0
universe@48 38 ;;
universe@48 39
universe@48 40 --run)
universe@48 41 # Back-compat with the calling convention used by older automake.
universe@48 42 shift
universe@48 43 ;;
universe@48 44
universe@48 45 -h|--h|--he|--hel|--help)
universe@48 46 echo "\
universe@48 47 $0 [OPTION]... PROGRAM [ARGUMENT]...
universe@48 48
universe@48 49 Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
universe@48 50 to PROGRAM being missing or too old.
universe@48 51
universe@48 52 Options:
universe@48 53 -h, --help display this help and exit
universe@48 54 -v, --version output version information and exit
universe@48 55
universe@48 56 Supported PROGRAM values:
universe@48 57 aclocal autoconf autoheader autom4te automake makeinfo
universe@48 58 bison yacc flex lex help2man
universe@48 59
universe@48 60 Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
universe@48 61 'g' are ignored when checking the name.
universe@48 62
universe@48 63 Send bug reports to <bug-automake@gnu.org>."
universe@48 64 exit $?
universe@48 65 ;;
universe@48 66
universe@48 67 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
universe@48 68 echo "missing $scriptversion (GNU Automake)"
universe@48 69 exit $?
universe@48 70 ;;
universe@48 71
universe@48 72 -*)
universe@48 73 echo 1>&2 "$0: unknown '$1' option"
universe@48 74 echo 1>&2 "Try '$0 --help' for more information"
universe@48 75 exit 1
universe@48 76 ;;
universe@48 77
universe@48 78 esac
universe@48 79
universe@48 80 # Run the given program, remember its exit status.
universe@48 81 "$@"; st=$?
universe@48 82
universe@48 83 # If it succeeded, we are done.
universe@48 84 test $st -eq 0 && exit 0
universe@48 85
universe@48 86 # Also exit now if we it failed (or wasn't found), and '--version' was
universe@48 87 # passed; such an option is passed most likely to detect whether the
universe@48 88 # program is present and works.
universe@48 89 case $2 in --version|--help) exit $st;; esac
universe@48 90
universe@48 91 # Exit code 63 means version mismatch. This often happens when the user
universe@48 92 # tries to use an ancient version of a tool on a file that requires a
universe@48 93 # minimum version.
universe@48 94 if test $st -eq 63; then
universe@48 95 msg="probably too old"
universe@48 96 elif test $st -eq 127; then
universe@48 97 # Program was missing.
universe@48 98 msg="missing on your system"
universe@48 99 else
universe@48 100 # Program was found and executed, but failed. Give up.
universe@48 101 exit $st
universe@48 102 fi
universe@48 103
universe@48 104 perl_URL=http://www.perl.org/
universe@48 105 flex_URL=http://flex.sourceforge.net/
universe@48 106 gnu_software_URL=http://www.gnu.org/software
universe@48 107
universe@48 108 program_details ()
universe@48 109 {
universe@48 110 case $1 in
universe@48 111 aclocal|automake)
universe@48 112 echo "The '$1' program is part of the GNU Automake package:"
universe@48 113 echo "<$gnu_software_URL/automake>"
universe@48 114 echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
universe@48 115 echo "<$gnu_software_URL/autoconf>"
universe@48 116 echo "<$gnu_software_URL/m4/>"
universe@48 117 echo "<$perl_URL>"
universe@48 118 ;;
universe@48 119 autoconf|autom4te|autoheader)
universe@48 120 echo "The '$1' program is part of the GNU Autoconf package:"
universe@48 121 echo "<$gnu_software_URL/autoconf/>"
universe@48 122 echo "It also requires GNU m4 and Perl in order to run:"
universe@48 123 echo "<$gnu_software_URL/m4/>"
universe@48 124 echo "<$perl_URL>"
universe@48 125 ;;
universe@48 126 esac
universe@48 127 }
universe@48 128
universe@48 129 give_advice ()
universe@48 130 {
universe@48 131 # Normalize program name to check for.
universe@48 132 normalized_program=`echo "$1" | sed '
universe@48 133 s/^gnu-//; t
universe@48 134 s/^gnu//; t
universe@48 135 s/^g//; t'`
universe@48 136
universe@48 137 printf '%s\n' "'$1' is $msg."
universe@48 138
universe@48 139 configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
universe@48 140 case $normalized_program in
universe@48 141 autoconf*)
universe@48 142 echo "You should only need it if you modified 'configure.ac',"
universe@48 143 echo "or m4 files included by it."
universe@48 144 program_details 'autoconf'
universe@48 145 ;;
universe@48 146 autoheader*)
universe@48 147 echo "You should only need it if you modified 'acconfig.h' or"
universe@48 148 echo "$configure_deps."
universe@48 149 program_details 'autoheader'
universe@48 150 ;;
universe@48 151 automake*)
universe@48 152 echo "You should only need it if you modified 'Makefile.am' or"
universe@48 153 echo "$configure_deps."
universe@48 154 program_details 'automake'
universe@48 155 ;;
universe@48 156 aclocal*)
universe@48 157 echo "You should only need it if you modified 'acinclude.m4' or"
universe@48 158 echo "$configure_deps."
universe@48 159 program_details 'aclocal'
universe@48 160 ;;
universe@48 161 autom4te*)
universe@48 162 echo "You might have modified some maintainer files that require"
universe@48 163 echo "the 'automa4te' program to be rebuilt."
universe@48 164 program_details 'autom4te'
universe@48 165 ;;
universe@48 166 bison*|yacc*)
universe@48 167 echo "You should only need it if you modified a '.y' file."
universe@48 168 echo "You may want to install the GNU Bison package:"
universe@48 169 echo "<$gnu_software_URL/bison/>"
universe@48 170 ;;
universe@48 171 lex*|flex*)
universe@48 172 echo "You should only need it if you modified a '.l' file."
universe@48 173 echo "You may want to install the Fast Lexical Analyzer package:"
universe@48 174 echo "<$flex_URL>"
universe@48 175 ;;
universe@48 176 help2man*)
universe@48 177 echo "You should only need it if you modified a dependency" \
universe@48 178 "of a man page."
universe@48 179 echo "You may want to install the GNU Help2man package:"
universe@48 180 echo "<$gnu_software_URL/help2man/>"
universe@48 181 ;;
universe@48 182 makeinfo*)
universe@48 183 echo "You should only need it if you modified a '.texi' file, or"
universe@48 184 echo "any other file indirectly affecting the aspect of the manual."
universe@48 185 echo "You might want to install the Texinfo package:"
universe@48 186 echo "<$gnu_software_URL/texinfo/>"
universe@48 187 echo "The spurious makeinfo call might also be the consequence of"
universe@48 188 echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
universe@48 189 echo "want to install GNU make:"
universe@48 190 echo "<$gnu_software_URL/make/>"
universe@48 191 ;;
universe@48 192 *)
universe@48 193 echo "You might have modified some files without having the proper"
universe@48 194 echo "tools for further handling them. Check the 'README' file, it"
universe@48 195 echo "often tells you about the needed prerequisites for installing"
universe@48 196 echo "this package. You may also peek at any GNU archive site, in"
universe@48 197 echo "case some other package contains this missing '$1' program."
universe@48 198 ;;
universe@48 199 esac
universe@48 200 }
universe@48 201
universe@48 202 give_advice "$1" | sed -e '1s/^/WARNING: /' \
universe@48 203 -e '2,$s/^/ /' >&2
universe@48 204
universe@48 205 # Propagate the correct exit status (expected to be 127 for a program
universe@48 206 # not found, 63 for a program that failed due to version mismatch).
universe@48 207 exit $st
universe@48 208
universe@48 209 # Local variables:
universe@48 210 # eval: (add-hook 'write-file-hooks 'time-stamp)
universe@48 211 # time-stamp-start: "scriptversion="
universe@48 212 # time-stamp-format: "%:y-%02m-%02d.%02H"
universe@48 213 # time-stamp-time-zone: "UTC"
universe@48 214 # time-stamp-end: "; # UTC"
universe@48 215 # End:

mercurial