missing revision 5bcb6992
1bd1da9d7Smrg#! /bin/sh 2bd1da9d7Smrg# Common stub for a few missing GNU programs while installing. 3bd1da9d7Smrg 45bcb6992Smrgscriptversion=2009-04-28.21; # UTC 5bd1da9d7Smrg 65bcb6992Smrg# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 75bcb6992Smrg# 2008, 2009 Free Software Foundation, Inc. 8bd1da9d7Smrg# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. 9bd1da9d7Smrg 10bd1da9d7Smrg# This program is free software; you can redistribute it and/or modify 11bd1da9d7Smrg# it under the terms of the GNU General Public License as published by 12bd1da9d7Smrg# the Free Software Foundation; either version 2, or (at your option) 13bd1da9d7Smrg# any later version. 14bd1da9d7Smrg 15bd1da9d7Smrg# This program is distributed in the hope that it will be useful, 16bd1da9d7Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 17bd1da9d7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18bd1da9d7Smrg# GNU General Public License for more details. 19bd1da9d7Smrg 20bd1da9d7Smrg# You should have received a copy of the GNU General Public License 215bcb6992Smrg# along with this program. If not, see <http://www.gnu.org/licenses/>. 22bd1da9d7Smrg 23bd1da9d7Smrg# As a special exception to the GNU General Public License, if you 24bd1da9d7Smrg# distribute this file as part of a program that contains a 25bd1da9d7Smrg# configuration script generated by Autoconf, you may include it under 26bd1da9d7Smrg# the same distribution terms that you use for the rest of that program. 27bd1da9d7Smrg 28bd1da9d7Smrgif test $# -eq 0; then 29bd1da9d7Smrg echo 1>&2 "Try \`$0 --help' for more information" 30bd1da9d7Smrg exit 1 31bd1da9d7Smrgfi 32bd1da9d7Smrg 33bd1da9d7Smrgrun=: 345bcb6992Smrgsed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 355bcb6992Smrgsed_minuso='s/.* -o \([^ ]*\).*/\1/p' 36bd1da9d7Smrg 37bd1da9d7Smrg# In the cases where this matters, `missing' is being run in the 38bd1da9d7Smrg# srcdir already. 39bd1da9d7Smrgif test -f configure.ac; then 40bd1da9d7Smrg configure_ac=configure.ac 41bd1da9d7Smrgelse 42bd1da9d7Smrg configure_ac=configure.in 43bd1da9d7Smrgfi 44bd1da9d7Smrg 45bd1da9d7Smrgmsg="missing on your system" 46bd1da9d7Smrg 475bcb6992Smrgcase $1 in 48bd1da9d7Smrg--run) 49bd1da9d7Smrg # Try to run requested program, and just exit if it succeeds. 50bd1da9d7Smrg run= 51bd1da9d7Smrg shift 52bd1da9d7Smrg "$@" && exit 0 53bd1da9d7Smrg # Exit code 63 means version mismatch. This often happens 54bd1da9d7Smrg # when the user try to use an ancient version of a tool on 55bd1da9d7Smrg # a file that requires a minimum version. In this case we 56bd1da9d7Smrg # we should proceed has if the program had been absent, or 57bd1da9d7Smrg # if --run hadn't been passed. 58bd1da9d7Smrg if test $? = 63; then 59bd1da9d7Smrg run=: 60bd1da9d7Smrg msg="probably too old" 61bd1da9d7Smrg fi 62bd1da9d7Smrg ;; 63bd1da9d7Smrg 64bd1da9d7Smrg -h|--h|--he|--hel|--help) 65bd1da9d7Smrg echo "\ 66bd1da9d7Smrg$0 [OPTION]... PROGRAM [ARGUMENT]... 67bd1da9d7Smrg 68bd1da9d7SmrgHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 69bd1da9d7Smrgerror status if there is no known handling for PROGRAM. 70bd1da9d7Smrg 71bd1da9d7SmrgOptions: 72bd1da9d7Smrg -h, --help display this help and exit 73bd1da9d7Smrg -v, --version output version information and exit 74bd1da9d7Smrg --run try to run the given command, and emulate it if it fails 75bd1da9d7Smrg 76bd1da9d7SmrgSupported PROGRAM values: 77bd1da9d7Smrg aclocal touch file \`aclocal.m4' 78bd1da9d7Smrg autoconf touch file \`configure' 79bd1da9d7Smrg autoheader touch file \`config.h.in' 805bcb6992Smrg autom4te touch the output file, or create a stub one 81bd1da9d7Smrg automake touch all \`Makefile.in' files 82bd1da9d7Smrg bison create \`y.tab.[ch]', if possible, from existing .[ch] 83bd1da9d7Smrg flex create \`lex.yy.c', if possible, from existing .c 84bd1da9d7Smrg help2man touch the output file 85bd1da9d7Smrg lex create \`lex.yy.c', if possible, from existing .c 86bd1da9d7Smrg makeinfo touch the output file 87bd1da9d7Smrg tar try tar, gnutar, gtar, then tar without non-portable flags 88bd1da9d7Smrg yacc create \`y.tab.[ch]', if possible, from existing .[ch] 89bd1da9d7Smrg 905bcb6992SmrgVersion suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and 915bcb6992Smrg\`g' are ignored when checking the name. 925bcb6992Smrg 93bd1da9d7SmrgSend bug reports to <bug-automake@gnu.org>." 94bd1da9d7Smrg exit $? 95bd1da9d7Smrg ;; 96bd1da9d7Smrg 97bd1da9d7Smrg -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 98bd1da9d7Smrg echo "missing $scriptversion (GNU Automake)" 99bd1da9d7Smrg exit $? 100bd1da9d7Smrg ;; 101bd1da9d7Smrg 102bd1da9d7Smrg -*) 103bd1da9d7Smrg echo 1>&2 "$0: Unknown \`$1' option" 104bd1da9d7Smrg echo 1>&2 "Try \`$0 --help' for more information" 105bd1da9d7Smrg exit 1 106bd1da9d7Smrg ;; 107bd1da9d7Smrg 108bd1da9d7Smrgesac 109bd1da9d7Smrg 1105bcb6992Smrg# normalize program name to check for. 1115bcb6992Smrgprogram=`echo "$1" | sed ' 1125bcb6992Smrg s/^gnu-//; t 1135bcb6992Smrg s/^gnu//; t 1145bcb6992Smrg s/^g//; t'` 1155bcb6992Smrg 116bd1da9d7Smrg# Now exit if we have it, but it failed. Also exit now if we 117bd1da9d7Smrg# don't have it and --version was passed (most likely to detect 1185bcb6992Smrg# the program). This is about non-GNU programs, so use $1 not 1195bcb6992Smrg# $program. 1205bcb6992Smrgcase $1 in 1215bcb6992Smrg lex*|yacc*) 122bd1da9d7Smrg # Not GNU programs, they don't have --version. 123bd1da9d7Smrg ;; 124bd1da9d7Smrg 1255bcb6992Smrg tar*) 126bd1da9d7Smrg if test -n "$run"; then 127bd1da9d7Smrg echo 1>&2 "ERROR: \`tar' requires --run" 128bd1da9d7Smrg exit 1 129bd1da9d7Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 130bd1da9d7Smrg exit 1 131bd1da9d7Smrg fi 132bd1da9d7Smrg ;; 133bd1da9d7Smrg 134bd1da9d7Smrg *) 135bd1da9d7Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 136bd1da9d7Smrg # We have it, but it failed. 137bd1da9d7Smrg exit 1 138bd1da9d7Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 139bd1da9d7Smrg # Could not run --version or --help. This is probably someone 140bd1da9d7Smrg # running `$TOOL --version' or `$TOOL --help' to check whether 141bd1da9d7Smrg # $TOOL exists and not knowing $TOOL uses missing. 142bd1da9d7Smrg exit 1 143bd1da9d7Smrg fi 144bd1da9d7Smrg ;; 145bd1da9d7Smrgesac 146bd1da9d7Smrg 147bd1da9d7Smrg# If it does not exist, or fails to run (possibly an outdated version), 148bd1da9d7Smrg# try to emulate it. 1495bcb6992Smrgcase $program in 150bd1da9d7Smrg aclocal*) 151bd1da9d7Smrg echo 1>&2 "\ 152bd1da9d7SmrgWARNING: \`$1' is $msg. You should only need it if 153bd1da9d7Smrg you modified \`acinclude.m4' or \`${configure_ac}'. You might want 154bd1da9d7Smrg to install the \`Automake' and \`Perl' packages. Grab them from 155bd1da9d7Smrg any GNU archive site." 156bd1da9d7Smrg touch aclocal.m4 157bd1da9d7Smrg ;; 158bd1da9d7Smrg 1595bcb6992Smrg autoconf*) 160bd1da9d7Smrg echo 1>&2 "\ 161bd1da9d7SmrgWARNING: \`$1' is $msg. You should only need it if 162bd1da9d7Smrg you modified \`${configure_ac}'. You might want to install the 163bd1da9d7Smrg \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 164bd1da9d7Smrg archive site." 165bd1da9d7Smrg touch configure 166bd1da9d7Smrg ;; 167bd1da9d7Smrg 1685bcb6992Smrg autoheader*) 169bd1da9d7Smrg echo 1>&2 "\ 170bd1da9d7SmrgWARNING: \`$1' is $msg. You should only need it if 171bd1da9d7Smrg you modified \`acconfig.h' or \`${configure_ac}'. You might want 172bd1da9d7Smrg to install the \`Autoconf' and \`GNU m4' packages. Grab them 173bd1da9d7Smrg from any GNU archive site." 174bd1da9d7Smrg files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 175bd1da9d7Smrg test -z "$files" && files="config.h" 176bd1da9d7Smrg touch_files= 177bd1da9d7Smrg for f in $files; do 1785bcb6992Smrg case $f in 179bd1da9d7Smrg *:*) touch_files="$touch_files "`echo "$f" | 180bd1da9d7Smrg sed -e 's/^[^:]*://' -e 's/:.*//'`;; 181bd1da9d7Smrg *) touch_files="$touch_files $f.in";; 182bd1da9d7Smrg esac 183bd1da9d7Smrg done 184bd1da9d7Smrg touch $touch_files 185bd1da9d7Smrg ;; 186bd1da9d7Smrg 187bd1da9d7Smrg automake*) 188bd1da9d7Smrg echo 1>&2 "\ 189bd1da9d7SmrgWARNING: \`$1' is $msg. You should only need it if 190bd1da9d7Smrg you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 191bd1da9d7Smrg You might want to install the \`Automake' and \`Perl' packages. 192bd1da9d7Smrg Grab them from any GNU archive site." 193bd1da9d7Smrg find . -type f -name Makefile.am -print | 194bd1da9d7Smrg sed 's/\.am$/.in/' | 195bd1da9d7Smrg while read f; do touch "$f"; done 196bd1da9d7Smrg ;; 197bd1da9d7Smrg 1985bcb6992Smrg autom4te*) 199bd1da9d7Smrg echo 1>&2 "\ 200bd1da9d7SmrgWARNING: \`$1' is needed, but is $msg. 201bd1da9d7Smrg You might have modified some files without having the 202bd1da9d7Smrg proper tools for further handling them. 203bd1da9d7Smrg You can get \`$1' as part of \`Autoconf' from any GNU 204bd1da9d7Smrg archive site." 205bd1da9d7Smrg 2065bcb6992Smrg file=`echo "$*" | sed -n "$sed_output"` 2075bcb6992Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 208bd1da9d7Smrg if test -f "$file"; then 209bd1da9d7Smrg touch $file 210bd1da9d7Smrg else 211bd1da9d7Smrg test -z "$file" || exec >$file 212bd1da9d7Smrg echo "#! /bin/sh" 213bd1da9d7Smrg echo "# Created by GNU Automake missing as a replacement of" 214bd1da9d7Smrg echo "# $ $@" 215bd1da9d7Smrg echo "exit 0" 216bd1da9d7Smrg chmod +x $file 217bd1da9d7Smrg exit 1 218bd1da9d7Smrg fi 219bd1da9d7Smrg ;; 220bd1da9d7Smrg 2215bcb6992Smrg bison*|yacc*) 222bd1da9d7Smrg echo 1>&2 "\ 223bd1da9d7SmrgWARNING: \`$1' $msg. You should only need it if 224bd1da9d7Smrg you modified a \`.y' file. You may need the \`Bison' package 225bd1da9d7Smrg in order for those modifications to take effect. You can get 226bd1da9d7Smrg \`Bison' from any GNU archive site." 227bd1da9d7Smrg rm -f y.tab.c y.tab.h 2285bcb6992Smrg if test $# -ne 1; then 229bd1da9d7Smrg eval LASTARG="\${$#}" 2305bcb6992Smrg case $LASTARG in 231bd1da9d7Smrg *.y) 232bd1da9d7Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 2335bcb6992Smrg if test -f "$SRCFILE"; then 234bd1da9d7Smrg cp "$SRCFILE" y.tab.c 235bd1da9d7Smrg fi 236bd1da9d7Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 2375bcb6992Smrg if test -f "$SRCFILE"; then 238bd1da9d7Smrg cp "$SRCFILE" y.tab.h 239bd1da9d7Smrg fi 240bd1da9d7Smrg ;; 241bd1da9d7Smrg esac 242bd1da9d7Smrg fi 2435bcb6992Smrg if test ! -f y.tab.h; then 244bd1da9d7Smrg echo >y.tab.h 245bd1da9d7Smrg fi 2465bcb6992Smrg if test ! -f y.tab.c; then 247bd1da9d7Smrg echo 'main() { return 0; }' >y.tab.c 248bd1da9d7Smrg fi 249bd1da9d7Smrg ;; 250bd1da9d7Smrg 2515bcb6992Smrg lex*|flex*) 252bd1da9d7Smrg echo 1>&2 "\ 253bd1da9d7SmrgWARNING: \`$1' is $msg. You should only need it if 254bd1da9d7Smrg you modified a \`.l' file. You may need the \`Flex' package 255bd1da9d7Smrg in order for those modifications to take effect. You can get 256bd1da9d7Smrg \`Flex' from any GNU archive site." 257bd1da9d7Smrg rm -f lex.yy.c 2585bcb6992Smrg if test $# -ne 1; then 259bd1da9d7Smrg eval LASTARG="\${$#}" 2605bcb6992Smrg case $LASTARG in 261bd1da9d7Smrg *.l) 262bd1da9d7Smrg SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 2635bcb6992Smrg if test -f "$SRCFILE"; then 264bd1da9d7Smrg cp "$SRCFILE" lex.yy.c 265bd1da9d7Smrg fi 266bd1da9d7Smrg ;; 267bd1da9d7Smrg esac 268bd1da9d7Smrg fi 2695bcb6992Smrg if test ! -f lex.yy.c; then 270bd1da9d7Smrg echo 'main() { return 0; }' >lex.yy.c 271bd1da9d7Smrg fi 272bd1da9d7Smrg ;; 273bd1da9d7Smrg 2745bcb6992Smrg help2man*) 275bd1da9d7Smrg echo 1>&2 "\ 276bd1da9d7SmrgWARNING: \`$1' is $msg. You should only need it if 277bd1da9d7Smrg you modified a dependency of a manual page. You may need the 278bd1da9d7Smrg \`Help2man' package in order for those modifications to take 279bd1da9d7Smrg effect. You can get \`Help2man' from any GNU archive site." 280bd1da9d7Smrg 2815bcb6992Smrg file=`echo "$*" | sed -n "$sed_output"` 2825bcb6992Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 2835bcb6992Smrg if test -f "$file"; then 284bd1da9d7Smrg touch $file 285bd1da9d7Smrg else 286bd1da9d7Smrg test -z "$file" || exec >$file 287bd1da9d7Smrg echo ".ab help2man is required to generate this page" 2885bcb6992Smrg exit $? 289bd1da9d7Smrg fi 290bd1da9d7Smrg ;; 291bd1da9d7Smrg 2925bcb6992Smrg makeinfo*) 293bd1da9d7Smrg echo 1>&2 "\ 294bd1da9d7SmrgWARNING: \`$1' is $msg. You should only need it if 295bd1da9d7Smrg you modified a \`.texi' or \`.texinfo' file, or any other file 296bd1da9d7Smrg indirectly affecting the aspect of the manual. The spurious 297bd1da9d7Smrg call might also be the consequence of using a buggy \`make' (AIX, 298bd1da9d7Smrg DU, IRIX). You might want to install the \`Texinfo' package or 299bd1da9d7Smrg the \`GNU make' package. Grab either from any GNU archive site." 300bd1da9d7Smrg # The file to touch is that specified with -o ... 3015bcb6992Smrg file=`echo "$*" | sed -n "$sed_output"` 3025bcb6992Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 303bd1da9d7Smrg if test -z "$file"; then 304bd1da9d7Smrg # ... or it is the one specified with @setfilename ... 305bd1da9d7Smrg infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 3065bcb6992Smrg file=`sed -n ' 3075bcb6992Smrg /^@setfilename/{ 3085bcb6992Smrg s/.* \([^ ]*\) *$/\1/ 3095bcb6992Smrg p 3105bcb6992Smrg q 3115bcb6992Smrg }' $infile` 312bd1da9d7Smrg # ... or it is derived from the source name (dir/f.texi becomes f.info) 313bd1da9d7Smrg test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 314bd1da9d7Smrg fi 315bd1da9d7Smrg # If the file does not exist, the user really needs makeinfo; 316bd1da9d7Smrg # let's fail without touching anything. 317bd1da9d7Smrg test -f $file || exit 1 318bd1da9d7Smrg touch $file 319bd1da9d7Smrg ;; 320bd1da9d7Smrg 3215bcb6992Smrg tar*) 322bd1da9d7Smrg shift 323bd1da9d7Smrg 324bd1da9d7Smrg # We have already tried tar in the generic part. 325bd1da9d7Smrg # Look for gnutar/gtar before invocation to avoid ugly error 326bd1da9d7Smrg # messages. 327bd1da9d7Smrg if (gnutar --version > /dev/null 2>&1); then 328bd1da9d7Smrg gnutar "$@" && exit 0 329bd1da9d7Smrg fi 330bd1da9d7Smrg if (gtar --version > /dev/null 2>&1); then 331bd1da9d7Smrg gtar "$@" && exit 0 332bd1da9d7Smrg fi 333bd1da9d7Smrg firstarg="$1" 334bd1da9d7Smrg if shift; then 3355bcb6992Smrg case $firstarg in 336bd1da9d7Smrg *o*) 337bd1da9d7Smrg firstarg=`echo "$firstarg" | sed s/o//` 338bd1da9d7Smrg tar "$firstarg" "$@" && exit 0 339bd1da9d7Smrg ;; 340bd1da9d7Smrg esac 3415bcb6992Smrg case $firstarg in 342bd1da9d7Smrg *h*) 343bd1da9d7Smrg firstarg=`echo "$firstarg" | sed s/h//` 344bd1da9d7Smrg tar "$firstarg" "$@" && exit 0 345bd1da9d7Smrg ;; 346bd1da9d7Smrg esac 347bd1da9d7Smrg fi 348bd1da9d7Smrg 349bd1da9d7Smrg echo 1>&2 "\ 350bd1da9d7SmrgWARNING: I can't seem to be able to run \`tar' with the given arguments. 351bd1da9d7Smrg You may want to install GNU tar or Free paxutils, or check the 352bd1da9d7Smrg command line arguments." 353bd1da9d7Smrg exit 1 354bd1da9d7Smrg ;; 355bd1da9d7Smrg 356bd1da9d7Smrg *) 357bd1da9d7Smrg echo 1>&2 "\ 358bd1da9d7SmrgWARNING: \`$1' is needed, and is $msg. 359bd1da9d7Smrg You might have modified some files without having the 360bd1da9d7Smrg proper tools for further handling them. Check the \`README' file, 361bd1da9d7Smrg it often tells you about the needed prerequisites for installing 362bd1da9d7Smrg this package. You may also peek at any GNU archive site, in case 363bd1da9d7Smrg some other package would contain this missing \`$1' program." 364bd1da9d7Smrg exit 1 365bd1da9d7Smrg ;; 366bd1da9d7Smrgesac 367bd1da9d7Smrg 368bd1da9d7Smrgexit 0 369bd1da9d7Smrg 370bd1da9d7Smrg# Local variables: 371bd1da9d7Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 372bd1da9d7Smrg# time-stamp-start: "scriptversion=" 373bd1da9d7Smrg# time-stamp-format: "%:y-%02m-%02d.%02H" 3745bcb6992Smrg# time-stamp-time-zone: "UTC" 3755bcb6992Smrg# time-stamp-end: "; # UTC" 376bd1da9d7Smrg# End: 377