annotate src/libsamplerate-0.1.9/Cfg/missing @ 41:481f5f8c5634

Current libsamplerate source
author Chris Cannam
date Tue, 18 Oct 2016 13:24:45 +0100
parents
children
rev   line source
Chris@41 1 #! /bin/sh
Chris@41 2 # Common stub for a few missing GNU programs while installing.
Chris@41 3
Chris@41 4 scriptversion=2009-04-28.21; # UTC
Chris@41 5
Chris@41 6 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
Chris@41 7 # 2008, 2009 Free Software Foundation, Inc.
Chris@41 8 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
Chris@41 9
Chris@41 10 # This program is free software; you can redistribute it and/or modify
Chris@41 11 # it under the terms of the GNU General Public License as published by
Chris@41 12 # the Free Software Foundation; either version 2, or (at your option)
Chris@41 13 # any later version.
Chris@41 14
Chris@41 15 # This program is distributed in the hope that it will be useful,
Chris@41 16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@41 17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@41 18 # GNU General Public License for more details.
Chris@41 19
Chris@41 20 # You should have received a copy of the GNU General Public License
Chris@41 21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
Chris@41 22
Chris@41 23 # As a special exception to the GNU General Public License, if you
Chris@41 24 # distribute this file as part of a program that contains a
Chris@41 25 # configuration script generated by Autoconf, you may include it under
Chris@41 26 # the same distribution terms that you use for the rest of that program.
Chris@41 27
Chris@41 28 if test $# -eq 0; then
Chris@41 29 echo 1>&2 "Try \`$0 --help' for more information"
Chris@41 30 exit 1
Chris@41 31 fi
Chris@41 32
Chris@41 33 run=:
Chris@41 34 sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
Chris@41 35 sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
Chris@41 36
Chris@41 37 # In the cases where this matters, `missing' is being run in the
Chris@41 38 # srcdir already.
Chris@41 39 if test -f configure.ac; then
Chris@41 40 configure_ac=configure.ac
Chris@41 41 else
Chris@41 42 configure_ac=configure.in
Chris@41 43 fi
Chris@41 44
Chris@41 45 msg="missing on your system"
Chris@41 46
Chris@41 47 case $1 in
Chris@41 48 --run)
Chris@41 49 # Try to run requested program, and just exit if it succeeds.
Chris@41 50 run=
Chris@41 51 shift
Chris@41 52 "$@" && exit 0
Chris@41 53 # Exit code 63 means version mismatch. This often happens
Chris@41 54 # when the user try to use an ancient version of a tool on
Chris@41 55 # a file that requires a minimum version. In this case we
Chris@41 56 # we should proceed has if the program had been absent, or
Chris@41 57 # if --run hadn't been passed.
Chris@41 58 if test $? = 63; then
Chris@41 59 run=:
Chris@41 60 msg="probably too old"
Chris@41 61 fi
Chris@41 62 ;;
Chris@41 63
Chris@41 64 -h|--h|--he|--hel|--help)
Chris@41 65 echo "\
Chris@41 66 $0 [OPTION]... PROGRAM [ARGUMENT]...
Chris@41 67
Chris@41 68 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
Chris@41 69 error status if there is no known handling for PROGRAM.
Chris@41 70
Chris@41 71 Options:
Chris@41 72 -h, --help display this help and exit
Chris@41 73 -v, --version output version information and exit
Chris@41 74 --run try to run the given command, and emulate it if it fails
Chris@41 75
Chris@41 76 Supported PROGRAM values:
Chris@41 77 aclocal touch file \`aclocal.m4'
Chris@41 78 autoconf touch file \`configure'
Chris@41 79 autoheader touch file \`config.h.in'
Chris@41 80 autom4te touch the output file, or create a stub one
Chris@41 81 automake touch all \`Makefile.in' files
Chris@41 82 bison create \`y.tab.[ch]', if possible, from existing .[ch]
Chris@41 83 flex create \`lex.yy.c', if possible, from existing .c
Chris@41 84 help2man touch the output file
Chris@41 85 lex create \`lex.yy.c', if possible, from existing .c
Chris@41 86 makeinfo touch the output file
Chris@41 87 tar try tar, gnutar, gtar, then tar without non-portable flags
Chris@41 88 yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Chris@41 89
Chris@41 90 Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
Chris@41 91 \`g' are ignored when checking the name.
Chris@41 92
Chris@41 93 Send bug reports to <bug-automake@gnu.org>."
Chris@41 94 exit $?
Chris@41 95 ;;
Chris@41 96
Chris@41 97 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
Chris@41 98 echo "missing $scriptversion (GNU Automake)"
Chris@41 99 exit $?
Chris@41 100 ;;
Chris@41 101
Chris@41 102 -*)
Chris@41 103 echo 1>&2 "$0: Unknown \`$1' option"
Chris@41 104 echo 1>&2 "Try \`$0 --help' for more information"
Chris@41 105 exit 1
Chris@41 106 ;;
Chris@41 107
Chris@41 108 esac
Chris@41 109
Chris@41 110 # normalize program name to check for.
Chris@41 111 program=`echo "$1" | sed '
Chris@41 112 s/^gnu-//; t
Chris@41 113 s/^gnu//; t
Chris@41 114 s/^g//; t'`
Chris@41 115
Chris@41 116 # Now exit if we have it, but it failed. Also exit now if we
Chris@41 117 # don't have it and --version was passed (most likely to detect
Chris@41 118 # the program). This is about non-GNU programs, so use $1 not
Chris@41 119 # $program.
Chris@41 120 case $1 in
Chris@41 121 lex*|yacc*)
Chris@41 122 # Not GNU programs, they don't have --version.
Chris@41 123 ;;
Chris@41 124
Chris@41 125 tar*)
Chris@41 126 if test -n "$run"; then
Chris@41 127 echo 1>&2 "ERROR: \`tar' requires --run"
Chris@41 128 exit 1
Chris@41 129 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
Chris@41 130 exit 1
Chris@41 131 fi
Chris@41 132 ;;
Chris@41 133
Chris@41 134 *)
Chris@41 135 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
Chris@41 136 # We have it, but it failed.
Chris@41 137 exit 1
Chris@41 138 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
Chris@41 139 # Could not run --version or --help. This is probably someone
Chris@41 140 # running `$TOOL --version' or `$TOOL --help' to check whether
Chris@41 141 # $TOOL exists and not knowing $TOOL uses missing.
Chris@41 142 exit 1
Chris@41 143 fi
Chris@41 144 ;;
Chris@41 145 esac
Chris@41 146
Chris@41 147 # If it does not exist, or fails to run (possibly an outdated version),
Chris@41 148 # try to emulate it.
Chris@41 149 case $program in
Chris@41 150 aclocal*)
Chris@41 151 echo 1>&2 "\
Chris@41 152 WARNING: \`$1' is $msg. You should only need it if
Chris@41 153 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
Chris@41 154 to install the \`Automake' and \`Perl' packages. Grab them from
Chris@41 155 any GNU archive site."
Chris@41 156 touch aclocal.m4
Chris@41 157 ;;
Chris@41 158
Chris@41 159 autoconf*)
Chris@41 160 echo 1>&2 "\
Chris@41 161 WARNING: \`$1' is $msg. You should only need it if
Chris@41 162 you modified \`${configure_ac}'. You might want to install the
Chris@41 163 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
Chris@41 164 archive site."
Chris@41 165 touch configure
Chris@41 166 ;;
Chris@41 167
Chris@41 168 autoheader*)
Chris@41 169 echo 1>&2 "\
Chris@41 170 WARNING: \`$1' is $msg. You should only need it if
Chris@41 171 you modified \`acconfig.h' or \`${configure_ac}'. You might want
Chris@41 172 to install the \`Autoconf' and \`GNU m4' packages. Grab them
Chris@41 173 from any GNU archive site."
Chris@41 174 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
Chris@41 175 test -z "$files" && files="config.h"
Chris@41 176 touch_files=
Chris@41 177 for f in $files; do
Chris@41 178 case $f in
Chris@41 179 *:*) touch_files="$touch_files "`echo "$f" |
Chris@41 180 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
Chris@41 181 *) touch_files="$touch_files $f.in";;
Chris@41 182 esac
Chris@41 183 done
Chris@41 184 touch $touch_files
Chris@41 185 ;;
Chris@41 186
Chris@41 187 automake*)
Chris@41 188 echo 1>&2 "\
Chris@41 189 WARNING: \`$1' is $msg. You should only need it if
Chris@41 190 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
Chris@41 191 You might want to install the \`Automake' and \`Perl' packages.
Chris@41 192 Grab them from any GNU archive site."
Chris@41 193 find . -type f -name Makefile.am -print |
Chris@41 194 sed 's/\.am$/.in/' |
Chris@41 195 while read f; do touch "$f"; done
Chris@41 196 ;;
Chris@41 197
Chris@41 198 autom4te*)
Chris@41 199 echo 1>&2 "\
Chris@41 200 WARNING: \`$1' is needed, but is $msg.
Chris@41 201 You might have modified some files without having the
Chris@41 202 proper tools for further handling them.
Chris@41 203 You can get \`$1' as part of \`Autoconf' from any GNU
Chris@41 204 archive site."
Chris@41 205
Chris@41 206 file=`echo "$*" | sed -n "$sed_output"`
Chris@41 207 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
Chris@41 208 if test -f "$file"; then
Chris@41 209 touch $file
Chris@41 210 else
Chris@41 211 test -z "$file" || exec >$file
Chris@41 212 echo "#! /bin/sh"
Chris@41 213 echo "# Created by GNU Automake missing as a replacement of"
Chris@41 214 echo "# $ $@"
Chris@41 215 echo "exit 0"
Chris@41 216 chmod +x $file
Chris@41 217 exit 1
Chris@41 218 fi
Chris@41 219 ;;
Chris@41 220
Chris@41 221 bison*|yacc*)
Chris@41 222 echo 1>&2 "\
Chris@41 223 WARNING: \`$1' $msg. You should only need it if
Chris@41 224 you modified a \`.y' file. You may need the \`Bison' package
Chris@41 225 in order for those modifications to take effect. You can get
Chris@41 226 \`Bison' from any GNU archive site."
Chris@41 227 rm -f y.tab.c y.tab.h
Chris@41 228 if test $# -ne 1; then
Chris@41 229 eval LASTARG="\${$#}"
Chris@41 230 case $LASTARG in
Chris@41 231 *.y)
Chris@41 232 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
Chris@41 233 if test -f "$SRCFILE"; then
Chris@41 234 cp "$SRCFILE" y.tab.c
Chris@41 235 fi
Chris@41 236 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
Chris@41 237 if test -f "$SRCFILE"; then
Chris@41 238 cp "$SRCFILE" y.tab.h
Chris@41 239 fi
Chris@41 240 ;;
Chris@41 241 esac
Chris@41 242 fi
Chris@41 243 if test ! -f y.tab.h; then
Chris@41 244 echo >y.tab.h
Chris@41 245 fi
Chris@41 246 if test ! -f y.tab.c; then
Chris@41 247 echo 'main() { return 0; }' >y.tab.c
Chris@41 248 fi
Chris@41 249 ;;
Chris@41 250
Chris@41 251 lex*|flex*)
Chris@41 252 echo 1>&2 "\
Chris@41 253 WARNING: \`$1' is $msg. You should only need it if
Chris@41 254 you modified a \`.l' file. You may need the \`Flex' package
Chris@41 255 in order for those modifications to take effect. You can get
Chris@41 256 \`Flex' from any GNU archive site."
Chris@41 257 rm -f lex.yy.c
Chris@41 258 if test $# -ne 1; then
Chris@41 259 eval LASTARG="\${$#}"
Chris@41 260 case $LASTARG in
Chris@41 261 *.l)
Chris@41 262 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
Chris@41 263 if test -f "$SRCFILE"; then
Chris@41 264 cp "$SRCFILE" lex.yy.c
Chris@41 265 fi
Chris@41 266 ;;
Chris@41 267 esac
Chris@41 268 fi
Chris@41 269 if test ! -f lex.yy.c; then
Chris@41 270 echo 'main() { return 0; }' >lex.yy.c
Chris@41 271 fi
Chris@41 272 ;;
Chris@41 273
Chris@41 274 help2man*)
Chris@41 275 echo 1>&2 "\
Chris@41 276 WARNING: \`$1' is $msg. You should only need it if
Chris@41 277 you modified a dependency of a manual page. You may need the
Chris@41 278 \`Help2man' package in order for those modifications to take
Chris@41 279 effect. You can get \`Help2man' from any GNU archive site."
Chris@41 280
Chris@41 281 file=`echo "$*" | sed -n "$sed_output"`
Chris@41 282 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
Chris@41 283 if test -f "$file"; then
Chris@41 284 touch $file
Chris@41 285 else
Chris@41 286 test -z "$file" || exec >$file
Chris@41 287 echo ".ab help2man is required to generate this page"
Chris@41 288 exit $?
Chris@41 289 fi
Chris@41 290 ;;
Chris@41 291
Chris@41 292 makeinfo*)
Chris@41 293 echo 1>&2 "\
Chris@41 294 WARNING: \`$1' is $msg. You should only need it if
Chris@41 295 you modified a \`.texi' or \`.texinfo' file, or any other file
Chris@41 296 indirectly affecting the aspect of the manual. The spurious
Chris@41 297 call might also be the consequence of using a buggy \`make' (AIX,
Chris@41 298 DU, IRIX). You might want to install the \`Texinfo' package or
Chris@41 299 the \`GNU make' package. Grab either from any GNU archive site."
Chris@41 300 # The file to touch is that specified with -o ...
Chris@41 301 file=`echo "$*" | sed -n "$sed_output"`
Chris@41 302 test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
Chris@41 303 if test -z "$file"; then
Chris@41 304 # ... or it is the one specified with @setfilename ...
Chris@41 305 infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
Chris@41 306 file=`sed -n '
Chris@41 307 /^@setfilename/{
Chris@41 308 s/.* \([^ ]*\) *$/\1/
Chris@41 309 p
Chris@41 310 q
Chris@41 311 }' $infile`
Chris@41 312 # ... or it is derived from the source name (dir/f.texi becomes f.info)
Chris@41 313 test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
Chris@41 314 fi
Chris@41 315 # If the file does not exist, the user really needs makeinfo;
Chris@41 316 # let's fail without touching anything.
Chris@41 317 test -f $file || exit 1
Chris@41 318 touch $file
Chris@41 319 ;;
Chris@41 320
Chris@41 321 tar*)
Chris@41 322 shift
Chris@41 323
Chris@41 324 # We have already tried tar in the generic part.
Chris@41 325 # Look for gnutar/gtar before invocation to avoid ugly error
Chris@41 326 # messages.
Chris@41 327 if (gnutar --version > /dev/null 2>&1); then
Chris@41 328 gnutar "$@" && exit 0
Chris@41 329 fi
Chris@41 330 if (gtar --version > /dev/null 2>&1); then
Chris@41 331 gtar "$@" && exit 0
Chris@41 332 fi
Chris@41 333 firstarg="$1"
Chris@41 334 if shift; then
Chris@41 335 case $firstarg in
Chris@41 336 *o*)
Chris@41 337 firstarg=`echo "$firstarg" | sed s/o//`
Chris@41 338 tar "$firstarg" "$@" && exit 0
Chris@41 339 ;;
Chris@41 340 esac
Chris@41 341 case $firstarg in
Chris@41 342 *h*)
Chris@41 343 firstarg=`echo "$firstarg" | sed s/h//`
Chris@41 344 tar "$firstarg" "$@" && exit 0
Chris@41 345 ;;
Chris@41 346 esac
Chris@41 347 fi
Chris@41 348
Chris@41 349 echo 1>&2 "\
Chris@41 350 WARNING: I can't seem to be able to run \`tar' with the given arguments.
Chris@41 351 You may want to install GNU tar or Free paxutils, or check the
Chris@41 352 command line arguments."
Chris@41 353 exit 1
Chris@41 354 ;;
Chris@41 355
Chris@41 356 *)
Chris@41 357 echo 1>&2 "\
Chris@41 358 WARNING: \`$1' is needed, and is $msg.
Chris@41 359 You might have modified some files without having the
Chris@41 360 proper tools for further handling them. Check the \`README' file,
Chris@41 361 it often tells you about the needed prerequisites for installing
Chris@41 362 this package. You may also peek at any GNU archive site, in case
Chris@41 363 some other package would contain this missing \`$1' program."
Chris@41 364 exit 1
Chris@41 365 ;;
Chris@41 366 esac
Chris@41 367
Chris@41 368 exit 0
Chris@41 369
Chris@41 370 # Local variables:
Chris@41 371 # eval: (add-hook 'write-file-hooks 'time-stamp)
Chris@41 372 # time-stamp-start: "scriptversion="
Chris@41 373 # time-stamp-format: "%:y-%02m-%02d.%02H"
Chris@41 374 # time-stamp-time-zone: "UTC"
Chris@41 375 # time-stamp-end: "; # UTC"
Chris@41 376 # End: