missing revision 54569438
1692f60a7Smrg#! /bin/sh 2692f60a7Smrg# Common stub for a few missing GNU programs while installing. 3692f60a7Smrg 454569438Smrgscriptversion=2006-05-10.23 5692f60a7Smrg 654569438Smrg# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 7692f60a7Smrg# Free Software Foundation, Inc. 8692f60a7Smrg# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. 9692f60a7Smrg 10692f60a7Smrg# This program is free software; you can redistribute it and/or modify 11692f60a7Smrg# it under the terms of the GNU General Public License as published by 12692f60a7Smrg# the Free Software Foundation; either version 2, or (at your option) 13692f60a7Smrg# any later version. 14692f60a7Smrg 15692f60a7Smrg# This program is distributed in the hope that it will be useful, 16692f60a7Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 17692f60a7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18692f60a7Smrg# GNU General Public License for more details. 19692f60a7Smrg 20692f60a7Smrg# You should have received a copy of the GNU General Public License 21692f60a7Smrg# along with this program; if not, write to the Free Software 22692f60a7Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 23692f60a7Smrg# 02110-1301, USA. 24692f60a7Smrg 25692f60a7Smrg# As a special exception to the GNU General Public License, if you 26692f60a7Smrg# distribute this file as part of a program that contains a 27692f60a7Smrg# configuration script generated by Autoconf, you may include it under 28692f60a7Smrg# the same distribution terms that you use for the rest of that program. 29692f60a7Smrg 30692f60a7Smrgif test $# -eq 0; then 31692f60a7Smrg echo 1>&2 "Try \`$0 --help' for more information" 32692f60a7Smrg exit 1 33692f60a7Smrgfi 34692f60a7Smrg 35692f60a7Smrgrun=: 3654569438Smrgsed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 3754569438Smrgsed_minuso='s/.* -o \([^ ]*\).*/\1/p' 38692f60a7Smrg 39692f60a7Smrg# In the cases where this matters, `missing' is being run in the 40692f60a7Smrg# srcdir already. 41692f60a7Smrgif test -f configure.ac; then 42692f60a7Smrg configure_ac=configure.ac 43692f60a7Smrgelse 44692f60a7Smrg configure_ac=configure.in 45692f60a7Smrgfi 46692f60a7Smrg 47692f60a7Smrgmsg="missing on your system" 48692f60a7Smrg 4954569438Smrgcase $1 in 50692f60a7Smrg--run) 51692f60a7Smrg # Try to run requested program, and just exit if it succeeds. 52692f60a7Smrg run= 53692f60a7Smrg shift 54692f60a7Smrg "$@" && exit 0 55692f60a7Smrg # Exit code 63 means version mismatch. This often happens 56692f60a7Smrg # when the user try to use an ancient version of a tool on 57692f60a7Smrg # a file that requires a minimum version. In this case we 58692f60a7Smrg # we should proceed has if the program had been absent, or 59692f60a7Smrg # if --run hadn't been passed. 60692f60a7Smrg if test $? = 63; then 61692f60a7Smrg run=: 62692f60a7Smrg msg="probably too old" 63692f60a7Smrg fi 64692f60a7Smrg ;; 65692f60a7Smrg 66692f60a7Smrg -h|--h|--he|--hel|--help) 67692f60a7Smrg echo "\ 68692f60a7Smrg$0 [OPTION]... PROGRAM [ARGUMENT]... 69692f60a7Smrg 70692f60a7SmrgHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 71692f60a7Smrgerror status if there is no known handling for PROGRAM. 72692f60a7Smrg 73692f60a7SmrgOptions: 74692f60a7Smrg -h, --help display this help and exit 75692f60a7Smrg -v, --version output version information and exit 76692f60a7Smrg --run try to run the given command, and emulate it if it fails 77692f60a7Smrg 78692f60a7SmrgSupported PROGRAM values: 79692f60a7Smrg aclocal touch file \`aclocal.m4' 80692f60a7Smrg autoconf touch file \`configure' 81692f60a7Smrg autoheader touch file \`config.h.in' 8254569438Smrg autom4te touch the output file, or create a stub one 83692f60a7Smrg automake touch all \`Makefile.in' files 84692f60a7Smrg bison create \`y.tab.[ch]', if possible, from existing .[ch] 85692f60a7Smrg flex create \`lex.yy.c', if possible, from existing .c 86692f60a7Smrg help2man touch the output file 87692f60a7Smrg lex create \`lex.yy.c', if possible, from existing .c 88692f60a7Smrg makeinfo touch the output file 89692f60a7Smrg tar try tar, gnutar, gtar, then tar without non-portable flags 90692f60a7Smrg yacc create \`y.tab.[ch]', if possible, from existing .[ch] 91692f60a7Smrg 92692f60a7SmrgSend bug reports to <bug-automake@gnu.org>." 93692f60a7Smrg exit $? 94692f60a7Smrg ;; 95692f60a7Smrg 96692f60a7Smrg -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 97692f60a7Smrg echo "missing $scriptversion (GNU Automake)" 98692f60a7Smrg exit $? 99692f60a7Smrg ;; 100692f60a7Smrg 101692f60a7Smrg -*) 102692f60a7Smrg echo 1>&2 "$0: Unknown \`$1' option" 103692f60a7Smrg echo 1>&2 "Try \`$0 --help' for more information" 104692f60a7Smrg exit 1 105692f60a7Smrg ;; 106692f60a7Smrg 107692f60a7Smrgesac 108692f60a7Smrg 109692f60a7Smrg# Now exit if we have it, but it failed. Also exit now if we 110692f60a7Smrg# don't have it and --version was passed (most likely to detect 111692f60a7Smrg# the program). 11254569438Smrgcase $1 in 113692f60a7Smrg lex|yacc) 114692f60a7Smrg # Not GNU programs, they don't have --version. 115692f60a7Smrg ;; 116692f60a7Smrg 117692f60a7Smrg tar) 118692f60a7Smrg if test -n "$run"; then 119692f60a7Smrg echo 1>&2 "ERROR: \`tar' requires --run" 120692f60a7Smrg exit 1 121692f60a7Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 122692f60a7Smrg exit 1 123692f60a7Smrg fi 124692f60a7Smrg ;; 125692f60a7Smrg 126692f60a7Smrg *) 127692f60a7Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 128692f60a7Smrg # We have it, but it failed. 129692f60a7Smrg exit 1 130692f60a7Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 131692f60a7Smrg # Could not run --version or --help. This is probably someone 132692f60a7Smrg # running `$TOOL --version' or `$TOOL --help' to check whether 133692f60a7Smrg # $TOOL exists and not knowing $TOOL uses missing. 134692f60a7Smrg exit 1 135692f60a7Smrg fi 136692f60a7Smrg ;; 137692f60a7Smrgesac 138692f60a7Smrg 139692f60a7Smrg# If it does not exist, or fails to run (possibly an outdated version), 140692f60a7Smrg# try to emulate it. 14154569438Smrgcase $1 in 142692f60a7Smrg aclocal*) 143692f60a7Smrg echo 1>&2 "\ 144692f60a7SmrgWARNING: \`$1' is $msg. You should only need it if 145692f60a7Smrg you modified \`acinclude.m4' or \`${configure_ac}'. You might want 146692f60a7Smrg to install the \`Automake' and \`Perl' packages. Grab them from 147692f60a7Smrg any GNU archive site." 148692f60a7Smrg touch aclocal.m4 149692f60a7Smrg ;; 150692f60a7Smrg 151692f60a7Smrg autoconf) 152692f60a7Smrg echo 1>&2 "\ 153692f60a7SmrgWARNING: \`$1' is $msg. You should only need it if 154692f60a7Smrg you modified \`${configure_ac}'. You might want to install the 155692f60a7Smrg \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 156692f60a7Smrg archive site." 157692f60a7Smrg touch configure 158692f60a7Smrg ;; 159692f60a7Smrg 160692f60a7Smrg autoheader) 161692f60a7Smrg echo 1>&2 "\ 162692f60a7SmrgWARNING: \`$1' is $msg. You should only need it if 163692f60a7Smrg you modified \`acconfig.h' or \`${configure_ac}'. You might want 164692f60a7Smrg to install the \`Autoconf' and \`GNU m4' packages. Grab them 165692f60a7Smrg from any GNU archive site." 166692f60a7Smrg files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 167692f60a7Smrg test -z "$files" && files="config.h" 168692f60a7Smrg touch_files= 169692f60a7Smrg for f in $files; do 17054569438Smrg case $f in 171692f60a7Smrg *:*) touch_files="$touch_files "`echo "$f" | 172692f60a7Smrg sed -e 's/^[^:]*://' -e 's/:.*//'`;; 173692f60a7Smrg *) touch_files="$touch_files $f.in";; 174692f60a7Smrg esac 175692f60a7Smrg done 176692f60a7Smrg touch $touch_files 177692f60a7Smrg ;; 178692f60a7Smrg 179692f60a7Smrg automake*) 180692f60a7Smrg echo 1>&2 "\ 181692f60a7SmrgWARNING: \`$1' is $msg. You should only need it if 182692f60a7Smrg you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 183692f60a7Smrg You might want to install the \`Automake' and \`Perl' packages. 184692f60a7Smrg Grab them from any GNU archive site." 185692f60a7Smrg find . -type f -name Makefile.am -print | 186692f60a7Smrg sed 's/\.am$/.in/' | 187692f60a7Smrg while read f; do touch "$f"; done 188692f60a7Smrg ;; 189692f60a7Smrg 190692f60a7Smrg autom4te) 191692f60a7Smrg echo 1>&2 "\ 192692f60a7SmrgWARNING: \`$1' is needed, but is $msg. 193692f60a7Smrg You might have modified some files without having the 194692f60a7Smrg proper tools for further handling them. 195692f60a7Smrg You can get \`$1' as part of \`Autoconf' from any GNU 196692f60a7Smrg archive site." 197692f60a7Smrg 19854569438Smrg file=`echo "$*" | sed -n "$sed_output"` 19954569438Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 200692f60a7Smrg if test -f "$file"; then 201692f60a7Smrg touch $file 202692f60a7Smrg else 203692f60a7Smrg test -z "$file" || exec >$file 204692f60a7Smrg echo "#! /bin/sh" 205692f60a7Smrg echo "# Created by GNU Automake missing as a replacement of" 206692f60a7Smrg echo "# $ $@" 207692f60a7Smrg echo "exit 0" 208692f60a7Smrg chmod +x $file 209692f60a7Smrg exit 1 210692f60a7Smrg fi 211692f60a7Smrg ;; 212692f60a7Smrg 213692f60a7Smrg bison|yacc) 214692f60a7Smrg echo 1>&2 "\ 215692f60a7SmrgWARNING: \`$1' $msg. You should only need it if 216692f60a7Smrg you modified a \`.y' file. You may need the \`Bison' package 217692f60a7Smrg in order for those modifications to take effect. You can get 218692f60a7Smrg \`Bison' from any GNU archive site." 219692f60a7Smrg rm -f y.tab.c y.tab.h 22054569438Smrg if test $# -ne 1; then 221692f60a7Smrg eval LASTARG="\${$#}" 22254569438Smrg case $LASTARG in 223692f60a7Smrg *.y) 224692f60a7Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 22554569438Smrg if test -f "$SRCFILE"; then 226692f60a7Smrg cp "$SRCFILE" y.tab.c 227692f60a7Smrg fi 228692f60a7Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 22954569438Smrg if test -f "$SRCFILE"; then 230692f60a7Smrg cp "$SRCFILE" y.tab.h 231692f60a7Smrg fi 232692f60a7Smrg ;; 233692f60a7Smrg esac 234692f60a7Smrg fi 23554569438Smrg if test ! -f y.tab.h; then 236692f60a7Smrg echo >y.tab.h 237692f60a7Smrg fi 23854569438Smrg if test ! -f y.tab.c; then 239692f60a7Smrg echo 'main() { return 0; }' >y.tab.c 240692f60a7Smrg fi 241692f60a7Smrg ;; 242692f60a7Smrg 243692f60a7Smrg lex|flex) 244692f60a7Smrg echo 1>&2 "\ 245692f60a7SmrgWARNING: \`$1' is $msg. You should only need it if 246692f60a7Smrg you modified a \`.l' file. You may need the \`Flex' package 247692f60a7Smrg in order for those modifications to take effect. You can get 248692f60a7Smrg \`Flex' from any GNU archive site." 249692f60a7Smrg rm -f lex.yy.c 25054569438Smrg if test $# -ne 1; then 251692f60a7Smrg eval LASTARG="\${$#}" 25254569438Smrg case $LASTARG in 253692f60a7Smrg *.l) 254692f60a7Smrg SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 25554569438Smrg if test -f "$SRCFILE"; then 256692f60a7Smrg cp "$SRCFILE" lex.yy.c 257692f60a7Smrg fi 258692f60a7Smrg ;; 259692f60a7Smrg esac 260692f60a7Smrg fi 26154569438Smrg if test ! -f lex.yy.c; then 262692f60a7Smrg echo 'main() { return 0; }' >lex.yy.c 263692f60a7Smrg fi 264692f60a7Smrg ;; 265692f60a7Smrg 266692f60a7Smrg help2man) 267692f60a7Smrg echo 1>&2 "\ 268692f60a7SmrgWARNING: \`$1' is $msg. You should only need it if 269692f60a7Smrg you modified a dependency of a manual page. You may need the 270692f60a7Smrg \`Help2man' package in order for those modifications to take 271692f60a7Smrg effect. You can get \`Help2man' from any GNU archive site." 272692f60a7Smrg 27354569438Smrg file=`echo "$*" | sed -n "$sed_output"` 27454569438Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 27554569438Smrg if test -f "$file"; then 276692f60a7Smrg touch $file 277692f60a7Smrg else 278692f60a7Smrg test -z "$file" || exec >$file 279692f60a7Smrg echo ".ab help2man is required to generate this page" 280692f60a7Smrg exit 1 281692f60a7Smrg fi 282692f60a7Smrg ;; 283692f60a7Smrg 284692f60a7Smrg makeinfo) 285692f60a7Smrg echo 1>&2 "\ 286692f60a7SmrgWARNING: \`$1' is $msg. You should only need it if 287692f60a7Smrg you modified a \`.texi' or \`.texinfo' file, or any other file 288692f60a7Smrg indirectly affecting the aspect of the manual. The spurious 289692f60a7Smrg call might also be the consequence of using a buggy \`make' (AIX, 290692f60a7Smrg DU, IRIX). You might want to install the \`Texinfo' package or 291692f60a7Smrg the \`GNU make' package. Grab either from any GNU archive site." 292692f60a7Smrg # The file to touch is that specified with -o ... 29354569438Smrg file=`echo "$*" | sed -n "$sed_output"` 29454569438Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 295692f60a7Smrg if test -z "$file"; then 296692f60a7Smrg # ... or it is the one specified with @setfilename ... 297692f60a7Smrg infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 29854569438Smrg file=`sed -n ' 29954569438Smrg /^@setfilename/{ 30054569438Smrg s/.* \([^ ]*\) *$/\1/ 30154569438Smrg p 30254569438Smrg q 30354569438Smrg }' $infile` 304692f60a7Smrg # ... or it is derived from the source name (dir/f.texi becomes f.info) 305692f60a7Smrg test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 306692f60a7Smrg fi 307692f60a7Smrg # If the file does not exist, the user really needs makeinfo; 308692f60a7Smrg # let's fail without touching anything. 309692f60a7Smrg test -f $file || exit 1 310692f60a7Smrg touch $file 311692f60a7Smrg ;; 312692f60a7Smrg 313692f60a7Smrg tar) 314692f60a7Smrg shift 315692f60a7Smrg 316692f60a7Smrg # We have already tried tar in the generic part. 317692f60a7Smrg # Look for gnutar/gtar before invocation to avoid ugly error 318692f60a7Smrg # messages. 319692f60a7Smrg if (gnutar --version > /dev/null 2>&1); then 320692f60a7Smrg gnutar "$@" && exit 0 321692f60a7Smrg fi 322692f60a7Smrg if (gtar --version > /dev/null 2>&1); then 323692f60a7Smrg gtar "$@" && exit 0 324692f60a7Smrg fi 325692f60a7Smrg firstarg="$1" 326692f60a7Smrg if shift; then 32754569438Smrg case $firstarg in 328692f60a7Smrg *o*) 329692f60a7Smrg firstarg=`echo "$firstarg" | sed s/o//` 330692f60a7Smrg tar "$firstarg" "$@" && exit 0 331692f60a7Smrg ;; 332692f60a7Smrg esac 33354569438Smrg case $firstarg in 334692f60a7Smrg *h*) 335692f60a7Smrg firstarg=`echo "$firstarg" | sed s/h//` 336692f60a7Smrg tar "$firstarg" "$@" && exit 0 337692f60a7Smrg ;; 338692f60a7Smrg esac 339692f60a7Smrg fi 340692f60a7Smrg 341692f60a7Smrg echo 1>&2 "\ 342692f60a7SmrgWARNING: I can't seem to be able to run \`tar' with the given arguments. 343692f60a7Smrg You may want to install GNU tar or Free paxutils, or check the 344692f60a7Smrg command line arguments." 345692f60a7Smrg exit 1 346692f60a7Smrg ;; 347692f60a7Smrg 348692f60a7Smrg *) 349692f60a7Smrg echo 1>&2 "\ 350692f60a7SmrgWARNING: \`$1' is needed, and is $msg. 351692f60a7Smrg You might have modified some files without having the 352692f60a7Smrg proper tools for further handling them. Check the \`README' file, 353692f60a7Smrg it often tells you about the needed prerequisites for installing 354692f60a7Smrg this package. You may also peek at any GNU archive site, in case 355692f60a7Smrg some other package would contain this missing \`$1' program." 356692f60a7Smrg exit 1 357692f60a7Smrg ;; 358692f60a7Smrgesac 359692f60a7Smrg 360692f60a7Smrgexit 0 361692f60a7Smrg 362692f60a7Smrg# Local variables: 363692f60a7Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 364692f60a7Smrg# time-stamp-start: "scriptversion=" 365692f60a7Smrg# time-stamp-format: "%:y-%02m-%02d.%02H" 366692f60a7Smrg# time-stamp-end: "$" 367692f60a7Smrg# End: 368