missing revision 12391620
121c2f794Smrg#! /bin/sh 221c2f794Smrg# Common stub for a few missing GNU programs while installing. 321c2f794Smrg 412391620Smrgscriptversion=2009-04-28.21; # UTC 521c2f794Smrg 612391620Smrg# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 712391620Smrg# 2008, 2009 Free Software Foundation, Inc. 821c2f794Smrg# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. 921c2f794Smrg 1021c2f794Smrg# This program is free software; you can redistribute it and/or modify 1121c2f794Smrg# it under the terms of the GNU General Public License as published by 1221c2f794Smrg# the Free Software Foundation; either version 2, or (at your option) 1321c2f794Smrg# any later version. 1421c2f794Smrg 1521c2f794Smrg# This program is distributed in the hope that it will be useful, 1621c2f794Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 1721c2f794Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1821c2f794Smrg# GNU General Public License for more details. 1921c2f794Smrg 2021c2f794Smrg# You should have received a copy of the GNU General Public License 2112391620Smrg# along with this program. If not, see <http://www.gnu.org/licenses/>. 2221c2f794Smrg 2321c2f794Smrg# As a special exception to the GNU General Public License, if you 2421c2f794Smrg# distribute this file as part of a program that contains a 2521c2f794Smrg# configuration script generated by Autoconf, you may include it under 2621c2f794Smrg# the same distribution terms that you use for the rest of that program. 2721c2f794Smrg 2821c2f794Smrgif test $# -eq 0; then 2921c2f794Smrg echo 1>&2 "Try \`$0 --help' for more information" 3021c2f794Smrg exit 1 3121c2f794Smrgfi 3221c2f794Smrg 3321c2f794Smrgrun=: 3421c2f794Smrgsed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 3521c2f794Smrgsed_minuso='s/.* -o \([^ ]*\).*/\1/p' 3621c2f794Smrg 3721c2f794Smrg# In the cases where this matters, `missing' is being run in the 3821c2f794Smrg# srcdir already. 3921c2f794Smrgif test -f configure.ac; then 4021c2f794Smrg configure_ac=configure.ac 4121c2f794Smrgelse 4221c2f794Smrg configure_ac=configure.in 4321c2f794Smrgfi 4421c2f794Smrg 4521c2f794Smrgmsg="missing on your system" 4621c2f794Smrg 4721c2f794Smrgcase $1 in 4821c2f794Smrg--run) 4921c2f794Smrg # Try to run requested program, and just exit if it succeeds. 5021c2f794Smrg run= 5121c2f794Smrg shift 5221c2f794Smrg "$@" && exit 0 5321c2f794Smrg # Exit code 63 means version mismatch. This often happens 5421c2f794Smrg # when the user try to use an ancient version of a tool on 5521c2f794Smrg # a file that requires a minimum version. In this case we 5621c2f794Smrg # we should proceed has if the program had been absent, or 5721c2f794Smrg # if --run hadn't been passed. 5821c2f794Smrg if test $? = 63; then 5921c2f794Smrg run=: 6021c2f794Smrg msg="probably too old" 6121c2f794Smrg fi 6221c2f794Smrg ;; 6321c2f794Smrg 6421c2f794Smrg -h|--h|--he|--hel|--help) 6521c2f794Smrg echo "\ 6621c2f794Smrg$0 [OPTION]... PROGRAM [ARGUMENT]... 6721c2f794Smrg 6821c2f794SmrgHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 6921c2f794Smrgerror status if there is no known handling for PROGRAM. 7021c2f794Smrg 7121c2f794SmrgOptions: 7221c2f794Smrg -h, --help display this help and exit 7321c2f794Smrg -v, --version output version information and exit 7421c2f794Smrg --run try to run the given command, and emulate it if it fails 7521c2f794Smrg 7621c2f794SmrgSupported PROGRAM values: 7721c2f794Smrg aclocal touch file \`aclocal.m4' 7821c2f794Smrg autoconf touch file \`configure' 7921c2f794Smrg autoheader touch file \`config.h.in' 8021c2f794Smrg autom4te touch the output file, or create a stub one 8121c2f794Smrg automake touch all \`Makefile.in' files 8221c2f794Smrg bison create \`y.tab.[ch]', if possible, from existing .[ch] 8321c2f794Smrg flex create \`lex.yy.c', if possible, from existing .c 8421c2f794Smrg help2man touch the output file 8521c2f794Smrg lex create \`lex.yy.c', if possible, from existing .c 8621c2f794Smrg makeinfo touch the output file 8721c2f794Smrg tar try tar, gnutar, gtar, then tar without non-portable flags 8821c2f794Smrg yacc create \`y.tab.[ch]', if possible, from existing .[ch] 8921c2f794Smrg 9012391620SmrgVersion suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 9112391620Smrg\`g' are ignored when checking the name. 9212391620Smrg 9321c2f794SmrgSend bug reports to <bug-automake@gnu.org>." 9421c2f794Smrg exit $? 9521c2f794Smrg ;; 9621c2f794Smrg 9721c2f794Smrg -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 9821c2f794Smrg echo "missing $scriptversion (GNU Automake)" 9921c2f794Smrg exit $? 10021c2f794Smrg ;; 10121c2f794Smrg 10221c2f794Smrg -*) 10321c2f794Smrg echo 1>&2 "$0: Unknown \`$1' option" 10421c2f794Smrg echo 1>&2 "Try \`$0 --help' for more information" 10521c2f794Smrg exit 1 10621c2f794Smrg ;; 10721c2f794Smrg 10821c2f794Smrgesac 10921c2f794Smrg 11012391620Smrg# normalize program name to check for. 11112391620Smrgprogram=`echo "$1" | sed ' 11212391620Smrg s/^gnu-//; t 11312391620Smrg s/^gnu//; t 11412391620Smrg s/^g//; t'` 11512391620Smrg 11621c2f794Smrg# Now exit if we have it, but it failed. Also exit now if we 11721c2f794Smrg# don't have it and --version was passed (most likely to detect 11812391620Smrg# the program). This is about non-GNU programs, so use $1 not 11912391620Smrg# $program. 12021c2f794Smrgcase $1 in 12112391620Smrg lex*|yacc*) 12221c2f794Smrg # Not GNU programs, they don't have --version. 12321c2f794Smrg ;; 12421c2f794Smrg 12512391620Smrg tar*) 12621c2f794Smrg if test -n "$run"; then 12721c2f794Smrg echo 1>&2 "ERROR: \`tar' requires --run" 12821c2f794Smrg exit 1 12921c2f794Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 13021c2f794Smrg exit 1 13121c2f794Smrg fi 13221c2f794Smrg ;; 13321c2f794Smrg 13421c2f794Smrg *) 13521c2f794Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 13621c2f794Smrg # We have it, but it failed. 13721c2f794Smrg exit 1 13821c2f794Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 13921c2f794Smrg # Could not run --version or --help. This is probably someone 14021c2f794Smrg # running `$TOOL --version' or `$TOOL --help' to check whether 14121c2f794Smrg # $TOOL exists and not knowing $TOOL uses missing. 14221c2f794Smrg exit 1 14321c2f794Smrg fi 14421c2f794Smrg ;; 14521c2f794Smrgesac 14621c2f794Smrg 14721c2f794Smrg# If it does not exist, or fails to run (possibly an outdated version), 14821c2f794Smrg# try to emulate it. 14912391620Smrgcase $program in 15021c2f794Smrg aclocal*) 15121c2f794Smrg echo 1>&2 "\ 15221c2f794SmrgWARNING: \`$1' is $msg. You should only need it if 15321c2f794Smrg you modified \`acinclude.m4' or \`${configure_ac}'. You might want 15421c2f794Smrg to install the \`Automake' and \`Perl' packages. Grab them from 15521c2f794Smrg any GNU archive site." 15621c2f794Smrg touch aclocal.m4 15721c2f794Smrg ;; 15821c2f794Smrg 15912391620Smrg autoconf*) 16021c2f794Smrg echo 1>&2 "\ 16121c2f794SmrgWARNING: \`$1' is $msg. You should only need it if 16221c2f794Smrg you modified \`${configure_ac}'. You might want to install the 16321c2f794Smrg \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 16421c2f794Smrg archive site." 16521c2f794Smrg touch configure 16621c2f794Smrg ;; 16721c2f794Smrg 16812391620Smrg autoheader*) 16921c2f794Smrg echo 1>&2 "\ 17021c2f794SmrgWARNING: \`$1' is $msg. You should only need it if 17121c2f794Smrg you modified \`acconfig.h' or \`${configure_ac}'. You might want 17221c2f794Smrg to install the \`Autoconf' and \`GNU m4' packages. Grab them 17321c2f794Smrg from any GNU archive site." 17421c2f794Smrg files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 17521c2f794Smrg test -z "$files" && files="config.h" 17621c2f794Smrg touch_files= 17721c2f794Smrg for f in $files; do 17821c2f794Smrg case $f in 17921c2f794Smrg *:*) touch_files="$touch_files "`echo "$f" | 18021c2f794Smrg sed -e 's/^[^:]*://' -e 's/:.*//'`;; 18121c2f794Smrg *) touch_files="$touch_files $f.in";; 18221c2f794Smrg esac 18321c2f794Smrg done 18421c2f794Smrg touch $touch_files 18521c2f794Smrg ;; 18621c2f794Smrg 18721c2f794Smrg automake*) 18821c2f794Smrg echo 1>&2 "\ 18921c2f794SmrgWARNING: \`$1' is $msg. You should only need it if 19021c2f794Smrg you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 19121c2f794Smrg You might want to install the \`Automake' and \`Perl' packages. 19221c2f794Smrg Grab them from any GNU archive site." 19321c2f794Smrg find . -type f -name Makefile.am -print | 19421c2f794Smrg sed 's/\.am$/.in/' | 19521c2f794Smrg while read f; do touch "$f"; done 19621c2f794Smrg ;; 19721c2f794Smrg 19812391620Smrg autom4te*) 19921c2f794Smrg echo 1>&2 "\ 20021c2f794SmrgWARNING: \`$1' is needed, but is $msg. 20121c2f794Smrg You might have modified some files without having the 20221c2f794Smrg proper tools for further handling them. 20321c2f794Smrg You can get \`$1' as part of \`Autoconf' from any GNU 20421c2f794Smrg archive site." 20521c2f794Smrg 20621c2f794Smrg file=`echo "$*" | sed -n "$sed_output"` 20721c2f794Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 20821c2f794Smrg if test -f "$file"; then 20921c2f794Smrg touch $file 21021c2f794Smrg else 21121c2f794Smrg test -z "$file" || exec >$file 21221c2f794Smrg echo "#! /bin/sh" 21321c2f794Smrg echo "# Created by GNU Automake missing as a replacement of" 21421c2f794Smrg echo "# $ $@" 21521c2f794Smrg echo "exit 0" 21621c2f794Smrg chmod +x $file 21721c2f794Smrg exit 1 21821c2f794Smrg fi 21921c2f794Smrg ;; 22021c2f794Smrg 22112391620Smrg bison*|yacc*) 22221c2f794Smrg echo 1>&2 "\ 22321c2f794SmrgWARNING: \`$1' $msg. You should only need it if 22421c2f794Smrg you modified a \`.y' file. You may need the \`Bison' package 22521c2f794Smrg in order for those modifications to take effect. You can get 22621c2f794Smrg \`Bison' from any GNU archive site." 22721c2f794Smrg rm -f y.tab.c y.tab.h 22821c2f794Smrg if test $# -ne 1; then 22921c2f794Smrg eval LASTARG="\${$#}" 23021c2f794Smrg case $LASTARG in 23121c2f794Smrg *.y) 23221c2f794Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 23321c2f794Smrg if test -f "$SRCFILE"; then 23421c2f794Smrg cp "$SRCFILE" y.tab.c 23521c2f794Smrg fi 23621c2f794Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 23721c2f794Smrg if test -f "$SRCFILE"; then 23821c2f794Smrg cp "$SRCFILE" y.tab.h 23921c2f794Smrg fi 24021c2f794Smrg ;; 24121c2f794Smrg esac 24221c2f794Smrg fi 24321c2f794Smrg if test ! -f y.tab.h; then 24421c2f794Smrg echo >y.tab.h 24521c2f794Smrg fi 24621c2f794Smrg if test ! -f y.tab.c; then 24721c2f794Smrg echo 'main() { return 0; }' >y.tab.c 24821c2f794Smrg fi 24921c2f794Smrg ;; 25021c2f794Smrg 25112391620Smrg lex*|flex*) 25221c2f794Smrg echo 1>&2 "\ 25321c2f794SmrgWARNING: \`$1' is $msg. You should only need it if 25421c2f794Smrg you modified a \`.l' file. You may need the \`Flex' package 25521c2f794Smrg in order for those modifications to take effect. You can get 25621c2f794Smrg \`Flex' from any GNU archive site." 25721c2f794Smrg rm -f lex.yy.c 25821c2f794Smrg if test $# -ne 1; then 25921c2f794Smrg eval LASTARG="\${$#}" 26021c2f794Smrg case $LASTARG in 26121c2f794Smrg *.l) 26221c2f794Smrg SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 26321c2f794Smrg if test -f "$SRCFILE"; then 26421c2f794Smrg cp "$SRCFILE" lex.yy.c 26521c2f794Smrg fi 26621c2f794Smrg ;; 26721c2f794Smrg esac 26821c2f794Smrg fi 26921c2f794Smrg if test ! -f lex.yy.c; then 27021c2f794Smrg echo 'main() { return 0; }' >lex.yy.c 27121c2f794Smrg fi 27221c2f794Smrg ;; 27321c2f794Smrg 27412391620Smrg help2man*) 27521c2f794Smrg echo 1>&2 "\ 27621c2f794SmrgWARNING: \`$1' is $msg. You should only need it if 27721c2f794Smrg you modified a dependency of a manual page. You may need the 27821c2f794Smrg \`Help2man' package in order for those modifications to take 27921c2f794Smrg effect. You can get \`Help2man' from any GNU archive site." 28021c2f794Smrg 28121c2f794Smrg file=`echo "$*" | sed -n "$sed_output"` 28221c2f794Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 28321c2f794Smrg if test -f "$file"; then 28421c2f794Smrg touch $file 28521c2f794Smrg else 28621c2f794Smrg test -z "$file" || exec >$file 28721c2f794Smrg echo ".ab help2man is required to generate this page" 28812391620Smrg exit $? 28921c2f794Smrg fi 29021c2f794Smrg ;; 29121c2f794Smrg 29212391620Smrg makeinfo*) 29321c2f794Smrg echo 1>&2 "\ 29421c2f794SmrgWARNING: \`$1' is $msg. You should only need it if 29521c2f794Smrg you modified a \`.texi' or \`.texinfo' file, or any other file 29621c2f794Smrg indirectly affecting the aspect of the manual. The spurious 29721c2f794Smrg call might also be the consequence of using a buggy \`make' (AIX, 29821c2f794Smrg DU, IRIX). You might want to install the \`Texinfo' package or 29921c2f794Smrg the \`GNU make' package. Grab either from any GNU archive site." 30021c2f794Smrg # The file to touch is that specified with -o ... 30121c2f794Smrg file=`echo "$*" | sed -n "$sed_output"` 30221c2f794Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 30321c2f794Smrg if test -z "$file"; then 30421c2f794Smrg # ... or it is the one specified with @setfilename ... 30521c2f794Smrg infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 30621c2f794Smrg file=`sed -n ' 30721c2f794Smrg /^@setfilename/{ 30821c2f794Smrg s/.* \([^ ]*\) *$/\1/ 30921c2f794Smrg p 31021c2f794Smrg q 31121c2f794Smrg }' $infile` 31221c2f794Smrg # ... or it is derived from the source name (dir/f.texi becomes f.info) 31321c2f794Smrg test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 31421c2f794Smrg fi 31521c2f794Smrg # If the file does not exist, the user really needs makeinfo; 31621c2f794Smrg # let's fail without touching anything. 31721c2f794Smrg test -f $file || exit 1 31821c2f794Smrg touch $file 31921c2f794Smrg ;; 32021c2f794Smrg 32112391620Smrg tar*) 32221c2f794Smrg shift 32321c2f794Smrg 32421c2f794Smrg # We have already tried tar in the generic part. 32521c2f794Smrg # Look for gnutar/gtar before invocation to avoid ugly error 32621c2f794Smrg # messages. 32721c2f794Smrg if (gnutar --version > /dev/null 2>&1); then 32821c2f794Smrg gnutar "$@" && exit 0 32921c2f794Smrg fi 33021c2f794Smrg if (gtar --version > /dev/null 2>&1); then 33121c2f794Smrg gtar "$@" && exit 0 33221c2f794Smrg fi 33321c2f794Smrg firstarg="$1" 33421c2f794Smrg if shift; then 33521c2f794Smrg case $firstarg in 33621c2f794Smrg *o*) 33721c2f794Smrg firstarg=`echo "$firstarg" | sed s/o//` 33821c2f794Smrg tar "$firstarg" "$@" && exit 0 33921c2f794Smrg ;; 34021c2f794Smrg esac 34121c2f794Smrg case $firstarg in 34221c2f794Smrg *h*) 34321c2f794Smrg firstarg=`echo "$firstarg" | sed s/h//` 34421c2f794Smrg tar "$firstarg" "$@" && exit 0 34521c2f794Smrg ;; 34621c2f794Smrg esac 34721c2f794Smrg fi 34821c2f794Smrg 34921c2f794Smrg echo 1>&2 "\ 35021c2f794SmrgWARNING: I can't seem to be able to run \`tar' with the given arguments. 35121c2f794Smrg You may want to install GNU tar or Free paxutils, or check the 35221c2f794Smrg command line arguments." 35321c2f794Smrg exit 1 35421c2f794Smrg ;; 35521c2f794Smrg 35621c2f794Smrg *) 35721c2f794Smrg echo 1>&2 "\ 35821c2f794SmrgWARNING: \`$1' is needed, and is $msg. 35921c2f794Smrg You might have modified some files without having the 36021c2f794Smrg proper tools for further handling them. Check the \`README' file, 36121c2f794Smrg it often tells you about the needed prerequisites for installing 36221c2f794Smrg this package. You may also peek at any GNU archive site, in case 36321c2f794Smrg some other package would contain this missing \`$1' program." 36421c2f794Smrg exit 1 36521c2f794Smrg ;; 36621c2f794Smrgesac 36721c2f794Smrg 36821c2f794Smrgexit 0 36921c2f794Smrg 37021c2f794Smrg# Local variables: 37121c2f794Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 37221c2f794Smrg# time-stamp-start: "scriptversion=" 37321c2f794Smrg# time-stamp-format: "%:y-%02m-%02d.%02H" 37412391620Smrg# time-stamp-time-zone: "UTC" 37512391620Smrg# time-stamp-end: "; # UTC" 37621c2f794Smrg# End: 377