missing revision 3da084b3
13da084b3Smrg#! /bin/sh 23da084b3Smrg# Common stub for a few missing GNU programs while installing. 33da084b3Smrg 43da084b3Smrgscriptversion=2005-06-08.21 53da084b3Smrg 63da084b3Smrg# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 73da084b3Smrg# Free Software Foundation, Inc. 83da084b3Smrg# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. 93da084b3Smrg 103da084b3Smrg# This program is free software; you can redistribute it and/or modify 113da084b3Smrg# it under the terms of the GNU General Public License as published by 123da084b3Smrg# the Free Software Foundation; either version 2, or (at your option) 133da084b3Smrg# any later version. 143da084b3Smrg 153da084b3Smrg# This program is distributed in the hope that it will be useful, 163da084b3Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 173da084b3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 183da084b3Smrg# GNU General Public License for more details. 193da084b3Smrg 203da084b3Smrg# You should have received a copy of the GNU General Public License 213da084b3Smrg# along with this program; if not, write to the Free Software 223da084b3Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 233da084b3Smrg# 02110-1301, USA. 243da084b3Smrg 253da084b3Smrg# As a special exception to the GNU General Public License, if you 263da084b3Smrg# distribute this file as part of a program that contains a 273da084b3Smrg# configuration script generated by Autoconf, you may include it under 283da084b3Smrg# the same distribution terms that you use for the rest of that program. 293da084b3Smrg 303da084b3Smrgif test $# -eq 0; then 313da084b3Smrg echo 1>&2 "Try \`$0 --help' for more information" 323da084b3Smrg exit 1 333da084b3Smrgfi 343da084b3Smrg 353da084b3Smrgrun=: 363da084b3Smrg 373da084b3Smrg# In the cases where this matters, `missing' is being run in the 383da084b3Smrg# srcdir already. 393da084b3Smrgif test -f configure.ac; then 403da084b3Smrg configure_ac=configure.ac 413da084b3Smrgelse 423da084b3Smrg configure_ac=configure.in 433da084b3Smrgfi 443da084b3Smrg 453da084b3Smrgmsg="missing on your system" 463da084b3Smrg 473da084b3Smrgcase "$1" in 483da084b3Smrg--run) 493da084b3Smrg # Try to run requested program, and just exit if it succeeds. 503da084b3Smrg run= 513da084b3Smrg shift 523da084b3Smrg "$@" && exit 0 533da084b3Smrg # Exit code 63 means version mismatch. This often happens 543da084b3Smrg # when the user try to use an ancient version of a tool on 553da084b3Smrg # a file that requires a minimum version. In this case we 563da084b3Smrg # we should proceed has if the program had been absent, or 573da084b3Smrg # if --run hadn't been passed. 583da084b3Smrg if test $? = 63; then 593da084b3Smrg run=: 603da084b3Smrg msg="probably too old" 613da084b3Smrg fi 623da084b3Smrg ;; 633da084b3Smrg 643da084b3Smrg -h|--h|--he|--hel|--help) 653da084b3Smrg echo "\ 663da084b3Smrg$0 [OPTION]... PROGRAM [ARGUMENT]... 673da084b3Smrg 683da084b3SmrgHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 693da084b3Smrgerror status if there is no known handling for PROGRAM. 703da084b3Smrg 713da084b3SmrgOptions: 723da084b3Smrg -h, --help display this help and exit 733da084b3Smrg -v, --version output version information and exit 743da084b3Smrg --run try to run the given command, and emulate it if it fails 753da084b3Smrg 763da084b3SmrgSupported PROGRAM values: 773da084b3Smrg aclocal touch file \`aclocal.m4' 783da084b3Smrg autoconf touch file \`configure' 793da084b3Smrg autoheader touch file \`config.h.in' 803da084b3Smrg automake touch all \`Makefile.in' files 813da084b3Smrg bison create \`y.tab.[ch]', if possible, from existing .[ch] 823da084b3Smrg flex create \`lex.yy.c', if possible, from existing .c 833da084b3Smrg help2man touch the output file 843da084b3Smrg lex create \`lex.yy.c', if possible, from existing .c 853da084b3Smrg makeinfo touch the output file 863da084b3Smrg tar try tar, gnutar, gtar, then tar without non-portable flags 873da084b3Smrg yacc create \`y.tab.[ch]', if possible, from existing .[ch] 883da084b3Smrg 893da084b3SmrgSend bug reports to <bug-automake@gnu.org>." 903da084b3Smrg exit $? 913da084b3Smrg ;; 923da084b3Smrg 933da084b3Smrg -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 943da084b3Smrg echo "missing $scriptversion (GNU Automake)" 953da084b3Smrg exit $? 963da084b3Smrg ;; 973da084b3Smrg 983da084b3Smrg -*) 993da084b3Smrg echo 1>&2 "$0: Unknown \`$1' option" 1003da084b3Smrg echo 1>&2 "Try \`$0 --help' for more information" 1013da084b3Smrg exit 1 1023da084b3Smrg ;; 1033da084b3Smrg 1043da084b3Smrgesac 1053da084b3Smrg 1063da084b3Smrg# Now exit if we have it, but it failed. Also exit now if we 1073da084b3Smrg# don't have it and --version was passed (most likely to detect 1083da084b3Smrg# the program). 1093da084b3Smrgcase "$1" in 1103da084b3Smrg lex|yacc) 1113da084b3Smrg # Not GNU programs, they don't have --version. 1123da084b3Smrg ;; 1133da084b3Smrg 1143da084b3Smrg tar) 1153da084b3Smrg if test -n "$run"; then 1163da084b3Smrg echo 1>&2 "ERROR: \`tar' requires --run" 1173da084b3Smrg exit 1 1183da084b3Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 1193da084b3Smrg exit 1 1203da084b3Smrg fi 1213da084b3Smrg ;; 1223da084b3Smrg 1233da084b3Smrg *) 1243da084b3Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 1253da084b3Smrg # We have it, but it failed. 1263da084b3Smrg exit 1 1273da084b3Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 1283da084b3Smrg # Could not run --version or --help. This is probably someone 1293da084b3Smrg # running `$TOOL --version' or `$TOOL --help' to check whether 1303da084b3Smrg # $TOOL exists and not knowing $TOOL uses missing. 1313da084b3Smrg exit 1 1323da084b3Smrg fi 1333da084b3Smrg ;; 1343da084b3Smrgesac 1353da084b3Smrg 1363da084b3Smrg# If it does not exist, or fails to run (possibly an outdated version), 1373da084b3Smrg# try to emulate it. 1383da084b3Smrgcase "$1" in 1393da084b3Smrg aclocal*) 1403da084b3Smrg echo 1>&2 "\ 1413da084b3SmrgWARNING: \`$1' is $msg. You should only need it if 1423da084b3Smrg you modified \`acinclude.m4' or \`${configure_ac}'. You might want 1433da084b3Smrg to install the \`Automake' and \`Perl' packages. Grab them from 1443da084b3Smrg any GNU archive site." 1453da084b3Smrg touch aclocal.m4 1463da084b3Smrg ;; 1473da084b3Smrg 1483da084b3Smrg autoconf) 1493da084b3Smrg echo 1>&2 "\ 1503da084b3SmrgWARNING: \`$1' is $msg. You should only need it if 1513da084b3Smrg you modified \`${configure_ac}'. You might want to install the 1523da084b3Smrg \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 1533da084b3Smrg archive site." 1543da084b3Smrg touch configure 1553da084b3Smrg ;; 1563da084b3Smrg 1573da084b3Smrg autoheader) 1583da084b3Smrg echo 1>&2 "\ 1593da084b3SmrgWARNING: \`$1' is $msg. You should only need it if 1603da084b3Smrg you modified \`acconfig.h' or \`${configure_ac}'. You might want 1613da084b3Smrg to install the \`Autoconf' and \`GNU m4' packages. Grab them 1623da084b3Smrg from any GNU archive site." 1633da084b3Smrg files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 1643da084b3Smrg test -z "$files" && files="config.h" 1653da084b3Smrg touch_files= 1663da084b3Smrg for f in $files; do 1673da084b3Smrg case "$f" in 1683da084b3Smrg *:*) touch_files="$touch_files "`echo "$f" | 1693da084b3Smrg sed -e 's/^[^:]*://' -e 's/:.*//'`;; 1703da084b3Smrg *) touch_files="$touch_files $f.in";; 1713da084b3Smrg esac 1723da084b3Smrg done 1733da084b3Smrg touch $touch_files 1743da084b3Smrg ;; 1753da084b3Smrg 1763da084b3Smrg automake*) 1773da084b3Smrg echo 1>&2 "\ 1783da084b3SmrgWARNING: \`$1' is $msg. You should only need it if 1793da084b3Smrg you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 1803da084b3Smrg You might want to install the \`Automake' and \`Perl' packages. 1813da084b3Smrg Grab them from any GNU archive site." 1823da084b3Smrg find . -type f -name Makefile.am -print | 1833da084b3Smrg sed 's/\.am$/.in/' | 1843da084b3Smrg while read f; do touch "$f"; done 1853da084b3Smrg ;; 1863da084b3Smrg 1873da084b3Smrg autom4te) 1883da084b3Smrg echo 1>&2 "\ 1893da084b3SmrgWARNING: \`$1' is needed, but is $msg. 1903da084b3Smrg You might have modified some files without having the 1913da084b3Smrg proper tools for further handling them. 1923da084b3Smrg You can get \`$1' as part of \`Autoconf' from any GNU 1933da084b3Smrg archive site." 1943da084b3Smrg 1953da084b3Smrg file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` 1963da084b3Smrg test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 1973da084b3Smrg if test -f "$file"; then 1983da084b3Smrg touch $file 1993da084b3Smrg else 2003da084b3Smrg test -z "$file" || exec >$file 2013da084b3Smrg echo "#! /bin/sh" 2023da084b3Smrg echo "# Created by GNU Automake missing as a replacement of" 2033da084b3Smrg echo "# $ $@" 2043da084b3Smrg echo "exit 0" 2053da084b3Smrg chmod +x $file 2063da084b3Smrg exit 1 2073da084b3Smrg fi 2083da084b3Smrg ;; 2093da084b3Smrg 2103da084b3Smrg bison|yacc) 2113da084b3Smrg echo 1>&2 "\ 2123da084b3SmrgWARNING: \`$1' $msg. You should only need it if 2133da084b3Smrg you modified a \`.y' file. You may need the \`Bison' package 2143da084b3Smrg in order for those modifications to take effect. You can get 2153da084b3Smrg \`Bison' from any GNU archive site." 2163da084b3Smrg rm -f y.tab.c y.tab.h 2173da084b3Smrg if [ $# -ne 1 ]; then 2183da084b3Smrg eval LASTARG="\${$#}" 2193da084b3Smrg case "$LASTARG" in 2203da084b3Smrg *.y) 2213da084b3Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 2223da084b3Smrg if [ -f "$SRCFILE" ]; then 2233da084b3Smrg cp "$SRCFILE" y.tab.c 2243da084b3Smrg fi 2253da084b3Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 2263da084b3Smrg if [ -f "$SRCFILE" ]; then 2273da084b3Smrg cp "$SRCFILE" y.tab.h 2283da084b3Smrg fi 2293da084b3Smrg ;; 2303da084b3Smrg esac 2313da084b3Smrg fi 2323da084b3Smrg if [ ! -f y.tab.h ]; then 2333da084b3Smrg echo >y.tab.h 2343da084b3Smrg fi 2353da084b3Smrg if [ ! -f y.tab.c ]; then 2363da084b3Smrg echo 'main() { return 0; }' >y.tab.c 2373da084b3Smrg fi 2383da084b3Smrg ;; 2393da084b3Smrg 2403da084b3Smrg lex|flex) 2413da084b3Smrg echo 1>&2 "\ 2423da084b3SmrgWARNING: \`$1' is $msg. You should only need it if 2433da084b3Smrg you modified a \`.l' file. You may need the \`Flex' package 2443da084b3Smrg in order for those modifications to take effect. You can get 2453da084b3Smrg \`Flex' from any GNU archive site." 2463da084b3Smrg rm -f lex.yy.c 2473da084b3Smrg if [ $# -ne 1 ]; then 2483da084b3Smrg eval LASTARG="\${$#}" 2493da084b3Smrg case "$LASTARG" in 2503da084b3Smrg *.l) 2513da084b3Smrg SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 2523da084b3Smrg if [ -f "$SRCFILE" ]; then 2533da084b3Smrg cp "$SRCFILE" lex.yy.c 2543da084b3Smrg fi 2553da084b3Smrg ;; 2563da084b3Smrg esac 2573da084b3Smrg fi 2583da084b3Smrg if [ ! -f lex.yy.c ]; then 2593da084b3Smrg echo 'main() { return 0; }' >lex.yy.c 2603da084b3Smrg fi 2613da084b3Smrg ;; 2623da084b3Smrg 2633da084b3Smrg help2man) 2643da084b3Smrg echo 1>&2 "\ 2653da084b3SmrgWARNING: \`$1' is $msg. You should only need it if 2663da084b3Smrg you modified a dependency of a manual page. You may need the 2673da084b3Smrg \`Help2man' package in order for those modifications to take 2683da084b3Smrg effect. You can get \`Help2man' from any GNU archive site." 2693da084b3Smrg 2703da084b3Smrg file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 2713da084b3Smrg if test -z "$file"; then 2723da084b3Smrg file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` 2733da084b3Smrg fi 2743da084b3Smrg if [ -f "$file" ]; then 2753da084b3Smrg touch $file 2763da084b3Smrg else 2773da084b3Smrg test -z "$file" || exec >$file 2783da084b3Smrg echo ".ab help2man is required to generate this page" 2793da084b3Smrg exit 1 2803da084b3Smrg fi 2813da084b3Smrg ;; 2823da084b3Smrg 2833da084b3Smrg makeinfo) 2843da084b3Smrg echo 1>&2 "\ 2853da084b3SmrgWARNING: \`$1' is $msg. You should only need it if 2863da084b3Smrg you modified a \`.texi' or \`.texinfo' file, or any other file 2873da084b3Smrg indirectly affecting the aspect of the manual. The spurious 2883da084b3Smrg call might also be the consequence of using a buggy \`make' (AIX, 2893da084b3Smrg DU, IRIX). You might want to install the \`Texinfo' package or 2903da084b3Smrg the \`GNU make' package. Grab either from any GNU archive site." 2913da084b3Smrg # The file to touch is that specified with -o ... 2923da084b3Smrg file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 2933da084b3Smrg if test -z "$file"; then 2943da084b3Smrg # ... or it is the one specified with @setfilename ... 2953da084b3Smrg infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 2963da084b3Smrg file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` 2973da084b3Smrg # ... or it is derived from the source name (dir/f.texi becomes f.info) 2983da084b3Smrg test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 2993da084b3Smrg fi 3003da084b3Smrg # If the file does not exist, the user really needs makeinfo; 3013da084b3Smrg # let's fail without touching anything. 3023da084b3Smrg test -f $file || exit 1 3033da084b3Smrg touch $file 3043da084b3Smrg ;; 3053da084b3Smrg 3063da084b3Smrg tar) 3073da084b3Smrg shift 3083da084b3Smrg 3093da084b3Smrg # We have already tried tar in the generic part. 3103da084b3Smrg # Look for gnutar/gtar before invocation to avoid ugly error 3113da084b3Smrg # messages. 3123da084b3Smrg if (gnutar --version > /dev/null 2>&1); then 3133da084b3Smrg gnutar "$@" && exit 0 3143da084b3Smrg fi 3153da084b3Smrg if (gtar --version > /dev/null 2>&1); then 3163da084b3Smrg gtar "$@" && exit 0 3173da084b3Smrg fi 3183da084b3Smrg firstarg="$1" 3193da084b3Smrg if shift; then 3203da084b3Smrg case "$firstarg" in 3213da084b3Smrg *o*) 3223da084b3Smrg firstarg=`echo "$firstarg" | sed s/o//` 3233da084b3Smrg tar "$firstarg" "$@" && exit 0 3243da084b3Smrg ;; 3253da084b3Smrg esac 3263da084b3Smrg case "$firstarg" in 3273da084b3Smrg *h*) 3283da084b3Smrg firstarg=`echo "$firstarg" | sed s/h//` 3293da084b3Smrg tar "$firstarg" "$@" && exit 0 3303da084b3Smrg ;; 3313da084b3Smrg esac 3323da084b3Smrg fi 3333da084b3Smrg 3343da084b3Smrg echo 1>&2 "\ 3353da084b3SmrgWARNING: I can't seem to be able to run \`tar' with the given arguments. 3363da084b3Smrg You may want to install GNU tar or Free paxutils, or check the 3373da084b3Smrg command line arguments." 3383da084b3Smrg exit 1 3393da084b3Smrg ;; 3403da084b3Smrg 3413da084b3Smrg *) 3423da084b3Smrg echo 1>&2 "\ 3433da084b3SmrgWARNING: \`$1' is needed, and is $msg. 3443da084b3Smrg You might have modified some files without having the 3453da084b3Smrg proper tools for further handling them. Check the \`README' file, 3463da084b3Smrg it often tells you about the needed prerequisites for installing 3473da084b3Smrg this package. You may also peek at any GNU archive site, in case 3483da084b3Smrg some other package would contain this missing \`$1' program." 3493da084b3Smrg exit 1 3503da084b3Smrg ;; 3513da084b3Smrgesac 3523da084b3Smrg 3533da084b3Smrgexit 0 3543da084b3Smrg 3553da084b3Smrg# Local variables: 3563da084b3Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 3573da084b3Smrg# time-stamp-start: "scriptversion=" 3583da084b3Smrg# time-stamp-format: "%:y-%02m-%02d.%02H" 3593da084b3Smrg# time-stamp-end: "$" 3603da084b3Smrg# End: 361