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