missing revision a99f82b8
1a99f82b8Smrg#! /bin/sh 2a99f82b8Smrg# Common stub for a few missing GNU programs while installing. 3a99f82b8Smrg# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. 4a99f82b8Smrg# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. 5a99f82b8Smrg 6a99f82b8Smrg# This program is free software; you can redistribute it and/or modify 7a99f82b8Smrg# it under the terms of the GNU General Public License as published by 8a99f82b8Smrg# the Free Software Foundation; either version 2, or (at your option) 9a99f82b8Smrg# any later version. 10a99f82b8Smrg 11a99f82b8Smrg# This program is distributed in the hope that it will be useful, 12a99f82b8Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 13a99f82b8Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14a99f82b8Smrg# GNU General Public License for more details. 15a99f82b8Smrg 16a99f82b8Smrg# You should have received a copy of the GNU General Public License 17a99f82b8Smrg# along with this program; if not, write to the Free Software 18a99f82b8Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19a99f82b8Smrg# 02111-1307, USA. 20a99f82b8Smrg 21a99f82b8Smrg# As a special exception to the GNU General Public License, if you 22a99f82b8Smrg# distribute this file as part of a program that contains a 23a99f82b8Smrg# configuration script generated by Autoconf, you may include it under 24a99f82b8Smrg# the same distribution terms that you use for the rest of that program. 25a99f82b8Smrg 26a99f82b8Smrgif test $# -eq 0; then 27a99f82b8Smrg echo 1>&2 "Try \`$0 --help' for more information" 28a99f82b8Smrg exit 1 29a99f82b8Smrgfi 30a99f82b8Smrg 31a99f82b8Smrgrun=: 32a99f82b8Smrg 33a99f82b8Smrg# In the cases where this matters, `missing' is being run in the 34a99f82b8Smrg# srcdir already. 35a99f82b8Smrgif test -f configure.ac; then 36a99f82b8Smrg configure_ac=configure.ac 37a99f82b8Smrgelse 38a99f82b8Smrg configure_ac=configure.in 39a99f82b8Smrgfi 40a99f82b8Smrg 41a99f82b8Smrgcase "$1" in 42a99f82b8Smrg--run) 43a99f82b8Smrg # Try to run requested program, and just exit if it succeeds. 44a99f82b8Smrg run= 45a99f82b8Smrg shift 46a99f82b8Smrg "$@" && exit 0 47a99f82b8Smrg ;; 48a99f82b8Smrgesac 49a99f82b8Smrg 50a99f82b8Smrg# If it does not exist, or fails to run (possibly an outdated version), 51a99f82b8Smrg# try to emulate it. 52a99f82b8Smrgcase "$1" in 53a99f82b8Smrg 54a99f82b8Smrg -h|--h|--he|--hel|--help) 55a99f82b8Smrg echo "\ 56a99f82b8Smrg$0 [OPTION]... PROGRAM [ARGUMENT]... 57a99f82b8Smrg 58a99f82b8SmrgHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 59a99f82b8Smrgerror status if there is no known handling for PROGRAM. 60a99f82b8Smrg 61a99f82b8SmrgOptions: 62a99f82b8Smrg -h, --help display this help and exit 63a99f82b8Smrg -v, --version output version information and exit 64a99f82b8Smrg --run try to run the given command, and emulate it if it fails 65a99f82b8Smrg 66a99f82b8SmrgSupported PROGRAM values: 67a99f82b8Smrg aclocal touch file \`aclocal.m4' 68a99f82b8Smrg autoconf touch file \`configure' 69a99f82b8Smrg autoheader touch file \`config.h.in' 70a99f82b8Smrg automake touch all \`Makefile.in' files 71a99f82b8Smrg bison create \`y.tab.[ch]', if possible, from existing .[ch] 72a99f82b8Smrg flex create \`lex.yy.c', if possible, from existing .c 73a99f82b8Smrg help2man touch the output file 74a99f82b8Smrg lex create \`lex.yy.c', if possible, from existing .c 75a99f82b8Smrg makeinfo touch the output file 76a99f82b8Smrg tar try tar, gnutar, gtar, then tar without non-portable flags 77a99f82b8Smrg yacc create \`y.tab.[ch]', if possible, from existing .[ch]" 78a99f82b8Smrg ;; 79a99f82b8Smrg 80a99f82b8Smrg -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 81a99f82b8Smrg echo "missing 0.4 - GNU automake" 82a99f82b8Smrg ;; 83a99f82b8Smrg 84a99f82b8Smrg -*) 85a99f82b8Smrg echo 1>&2 "$0: Unknown \`$1' option" 86a99f82b8Smrg echo 1>&2 "Try \`$0 --help' for more information" 87a99f82b8Smrg exit 1 88a99f82b8Smrg ;; 89a99f82b8Smrg 90a99f82b8Smrg aclocal*) 91a99f82b8Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 92a99f82b8Smrg # We have it, but it failed. 93a99f82b8Smrg exit 1 94a99f82b8Smrg fi 95a99f82b8Smrg 96a99f82b8Smrg echo 1>&2 "\ 97a99f82b8SmrgWARNING: \`$1' is missing on your system. You should only need it if 98a99f82b8Smrg you modified \`acinclude.m4' or \`${configure_ac}'. You might want 99a99f82b8Smrg to install the \`Automake' and \`Perl' packages. Grab them from 100a99f82b8Smrg any GNU archive site." 101a99f82b8Smrg touch aclocal.m4 102a99f82b8Smrg ;; 103a99f82b8Smrg 104a99f82b8Smrg autoconf) 105a99f82b8Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 106a99f82b8Smrg # We have it, but it failed. 107a99f82b8Smrg exit 1 108a99f82b8Smrg fi 109a99f82b8Smrg 110a99f82b8Smrg echo 1>&2 "\ 111a99f82b8SmrgWARNING: \`$1' is missing on your system. You should only need it if 112a99f82b8Smrg you modified \`${configure_ac}'. You might want to install the 113a99f82b8Smrg \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 114a99f82b8Smrg archive site." 115a99f82b8Smrg touch configure 116a99f82b8Smrg ;; 117a99f82b8Smrg 118a99f82b8Smrg autoheader) 119a99f82b8Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 120a99f82b8Smrg # We have it, but it failed. 121a99f82b8Smrg exit 1 122a99f82b8Smrg fi 123a99f82b8Smrg 124a99f82b8Smrg echo 1>&2 "\ 125a99f82b8SmrgWARNING: \`$1' is missing on your system. You should only need it if 126a99f82b8Smrg you modified \`acconfig.h' or \`${configure_ac}'. You might want 127a99f82b8Smrg to install the \`Autoconf' and \`GNU m4' packages. Grab them 128a99f82b8Smrg from any GNU archive site." 129a99f82b8Smrg files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 130a99f82b8Smrg test -z "$files" && files="config.h" 131a99f82b8Smrg touch_files= 132a99f82b8Smrg for f in $files; do 133a99f82b8Smrg case "$f" in 134a99f82b8Smrg *:*) touch_files="$touch_files "`echo "$f" | 135a99f82b8Smrg sed -e 's/^[^:]*://' -e 's/:.*//'`;; 136a99f82b8Smrg *) touch_files="$touch_files $f.in";; 137a99f82b8Smrg esac 138a99f82b8Smrg done 139a99f82b8Smrg touch $touch_files 140a99f82b8Smrg ;; 141a99f82b8Smrg 142a99f82b8Smrg automake*) 143a99f82b8Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 144a99f82b8Smrg # We have it, but it failed. 145a99f82b8Smrg exit 1 146a99f82b8Smrg fi 147a99f82b8Smrg 148a99f82b8Smrg echo 1>&2 "\ 149a99f82b8SmrgWARNING: \`$1' is missing on your system. You should only need it if 150a99f82b8Smrg you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 151a99f82b8Smrg You might want to install the \`Automake' and \`Perl' packages. 152a99f82b8Smrg Grab them from any GNU archive site." 153a99f82b8Smrg find . -type f -name Makefile.am -print | 154a99f82b8Smrg sed 's/\.am$/.in/' | 155a99f82b8Smrg while read f; do touch "$f"; done 156a99f82b8Smrg ;; 157a99f82b8Smrg 158a99f82b8Smrg autom4te) 159a99f82b8Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 160a99f82b8Smrg # We have it, but it failed. 161a99f82b8Smrg exit 1 162a99f82b8Smrg fi 163a99f82b8Smrg 164a99f82b8Smrg echo 1>&2 "\ 165a99f82b8SmrgWARNING: \`$1' is needed, and you do not seem to have it handy on your 166a99f82b8Smrg system. You might have modified some files without having the 167a99f82b8Smrg proper tools for further handling them. 168a99f82b8Smrg You can get \`$1' as part of \`Autoconf' from any GNU 169a99f82b8Smrg archive site." 170a99f82b8Smrg 171a99f82b8Smrg file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` 172a99f82b8Smrg test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 173a99f82b8Smrg if test -f "$file"; then 174a99f82b8Smrg touch $file 175a99f82b8Smrg else 176a99f82b8Smrg test -z "$file" || exec >$file 177a99f82b8Smrg echo "#! /bin/sh" 178a99f82b8Smrg echo "# Created by GNU Automake missing as a replacement of" 179a99f82b8Smrg echo "# $ $@" 180a99f82b8Smrg echo "exit 0" 181a99f82b8Smrg chmod +x $file 182a99f82b8Smrg exit 1 183a99f82b8Smrg fi 184a99f82b8Smrg ;; 185a99f82b8Smrg 186a99f82b8Smrg bison|yacc) 187a99f82b8Smrg echo 1>&2 "\ 188a99f82b8SmrgWARNING: \`$1' is missing on your system. You should only need it if 189a99f82b8Smrg you modified a \`.y' file. You may need the \`Bison' package 190a99f82b8Smrg in order for those modifications to take effect. You can get 191a99f82b8Smrg \`Bison' from any GNU archive site." 192a99f82b8Smrg rm -f y.tab.c y.tab.h 193a99f82b8Smrg if [ $# -ne 1 ]; then 194a99f82b8Smrg eval LASTARG="\${$#}" 195a99f82b8Smrg case "$LASTARG" in 196a99f82b8Smrg *.y) 197a99f82b8Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 198a99f82b8Smrg if [ -f "$SRCFILE" ]; then 199a99f82b8Smrg cp "$SRCFILE" y.tab.c 200a99f82b8Smrg fi 201a99f82b8Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 202a99f82b8Smrg if [ -f "$SRCFILE" ]; then 203a99f82b8Smrg cp "$SRCFILE" y.tab.h 204a99f82b8Smrg fi 205a99f82b8Smrg ;; 206a99f82b8Smrg esac 207a99f82b8Smrg fi 208a99f82b8Smrg if [ ! -f y.tab.h ]; then 209a99f82b8Smrg echo >y.tab.h 210a99f82b8Smrg fi 211a99f82b8Smrg if [ ! -f y.tab.c ]; then 212a99f82b8Smrg echo 'main() { return 0; }' >y.tab.c 213a99f82b8Smrg fi 214a99f82b8Smrg ;; 215a99f82b8Smrg 216a99f82b8Smrg lex|flex) 217a99f82b8Smrg echo 1>&2 "\ 218a99f82b8SmrgWARNING: \`$1' is missing on your system. You should only need it if 219a99f82b8Smrg you modified a \`.l' file. You may need the \`Flex' package 220a99f82b8Smrg in order for those modifications to take effect. You can get 221a99f82b8Smrg \`Flex' from any GNU archive site." 222a99f82b8Smrg rm -f lex.yy.c 223a99f82b8Smrg if [ $# -ne 1 ]; then 224a99f82b8Smrg eval LASTARG="\${$#}" 225a99f82b8Smrg case "$LASTARG" in 226a99f82b8Smrg *.l) 227a99f82b8Smrg SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 228a99f82b8Smrg if [ -f "$SRCFILE" ]; then 229a99f82b8Smrg cp "$SRCFILE" lex.yy.c 230a99f82b8Smrg fi 231a99f82b8Smrg ;; 232a99f82b8Smrg esac 233a99f82b8Smrg fi 234a99f82b8Smrg if [ ! -f lex.yy.c ]; then 235a99f82b8Smrg echo 'main() { return 0; }' >lex.yy.c 236a99f82b8Smrg fi 237a99f82b8Smrg ;; 238a99f82b8Smrg 239a99f82b8Smrg help2man) 240a99f82b8Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 241a99f82b8Smrg # We have it, but it failed. 242a99f82b8Smrg exit 1 243a99f82b8Smrg fi 244a99f82b8Smrg 245a99f82b8Smrg echo 1>&2 "\ 246a99f82b8SmrgWARNING: \`$1' is missing on your system. You should only need it if 247a99f82b8Smrg you modified a dependency of a manual page. You may need the 248a99f82b8Smrg \`Help2man' package in order for those modifications to take 249a99f82b8Smrg effect. You can get \`Help2man' from any GNU archive site." 250a99f82b8Smrg 251a99f82b8Smrg file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 252a99f82b8Smrg if test -z "$file"; then 253a99f82b8Smrg file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` 254a99f82b8Smrg fi 255a99f82b8Smrg if [ -f "$file" ]; then 256a99f82b8Smrg touch $file 257a99f82b8Smrg else 258a99f82b8Smrg test -z "$file" || exec >$file 259a99f82b8Smrg echo ".ab help2man is required to generate this page" 260a99f82b8Smrg exit 1 261a99f82b8Smrg fi 262a99f82b8Smrg ;; 263a99f82b8Smrg 264a99f82b8Smrg makeinfo) 265a99f82b8Smrg if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then 266a99f82b8Smrg # We have makeinfo, but it failed. 267a99f82b8Smrg exit 1 268a99f82b8Smrg fi 269a99f82b8Smrg 270a99f82b8Smrg echo 1>&2 "\ 271a99f82b8SmrgWARNING: \`$1' is missing on your system. You should only need it if 272a99f82b8Smrg you modified a \`.texi' or \`.texinfo' file, or any other file 273a99f82b8Smrg indirectly affecting the aspect of the manual. The spurious 274a99f82b8Smrg call might also be the consequence of using a buggy \`make' (AIX, 275a99f82b8Smrg DU, IRIX). You might want to install the \`Texinfo' package or 276a99f82b8Smrg the \`GNU make' package. Grab either from any GNU archive site." 277a99f82b8Smrg file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 278a99f82b8Smrg if test -z "$file"; then 279a99f82b8Smrg file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 280a99f82b8Smrg file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` 281a99f82b8Smrg fi 282a99f82b8Smrg touch $file 283a99f82b8Smrg ;; 284a99f82b8Smrg 285a99f82b8Smrg tar) 286a99f82b8Smrg shift 287a99f82b8Smrg if test -n "$run"; then 288a99f82b8Smrg echo 1>&2 "ERROR: \`tar' requires --run" 289a99f82b8Smrg exit 1 290a99f82b8Smrg fi 291a99f82b8Smrg 292a99f82b8Smrg # We have already tried tar in the generic part. 293a99f82b8Smrg # Look for gnutar/gtar before invocation to avoid ugly error 294a99f82b8Smrg # messages. 295a99f82b8Smrg if (gnutar --version > /dev/null 2>&1); then 296a99f82b8Smrg gnutar "$@" && exit 0 297a99f82b8Smrg fi 298a99f82b8Smrg if (gtar --version > /dev/null 2>&1); then 299a99f82b8Smrg gtar "$@" && exit 0 300a99f82b8Smrg fi 301a99f82b8Smrg firstarg="$1" 302a99f82b8Smrg if shift; then 303a99f82b8Smrg case "$firstarg" in 304a99f82b8Smrg *o*) 305a99f82b8Smrg firstarg=`echo "$firstarg" | sed s/o//` 306a99f82b8Smrg tar "$firstarg" "$@" && exit 0 307a99f82b8Smrg ;; 308a99f82b8Smrg esac 309a99f82b8Smrg case "$firstarg" in 310a99f82b8Smrg *h*) 311a99f82b8Smrg firstarg=`echo "$firstarg" | sed s/h//` 312a99f82b8Smrg tar "$firstarg" "$@" && exit 0 313a99f82b8Smrg ;; 314a99f82b8Smrg esac 315a99f82b8Smrg fi 316a99f82b8Smrg 317a99f82b8Smrg echo 1>&2 "\ 318a99f82b8SmrgWARNING: I can't seem to be able to run \`tar' with the given arguments. 319a99f82b8Smrg You may want to install GNU tar or Free paxutils, or check the 320a99f82b8Smrg command line arguments." 321a99f82b8Smrg exit 1 322a99f82b8Smrg ;; 323a99f82b8Smrg 324a99f82b8Smrg *) 325a99f82b8Smrg echo 1>&2 "\ 326a99f82b8SmrgWARNING: \`$1' is needed, and you do not seem to have it handy on your 327a99f82b8Smrg system. You might have modified some files without having the 328a99f82b8Smrg proper tools for further handling them. Check the \`README' file, 329a99f82b8Smrg it often tells you about the needed prerequisites for installing 330a99f82b8Smrg this package. You may also peek at any GNU archive site, in case 331a99f82b8Smrg some other package would contain this missing \`$1' program." 332a99f82b8Smrg exit 1 333a99f82b8Smrg ;; 334a99f82b8Smrgesac 335a99f82b8Smrg 336a99f82b8Smrgexit 0 337