annotate src/libsndfile-1.0.27/Cfg/missing @ 125:cd6cdf86811e

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