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