missing revision 8c9fbc29
18c9fbc29Smrg#! /bin/sh 28c9fbc29Smrg# Common stub for a few missing GNU programs while installing. 38c9fbc29Smrg 48c9fbc29Smrgscriptversion=2006-05-10.23 58c9fbc29Smrg 68c9fbc29Smrg# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 78c9fbc29Smrg# Free Software Foundation, Inc. 88c9fbc29Smrg# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. 98c9fbc29Smrg 108c9fbc29Smrg# This program is free software; you can redistribute it and/or modify 118c9fbc29Smrg# it under the terms of the GNU General Public License as published by 128c9fbc29Smrg# the Free Software Foundation; either version 2, or (at your option) 138c9fbc29Smrg# any later version. 148c9fbc29Smrg 158c9fbc29Smrg# This program is distributed in the hope that it will be useful, 168c9fbc29Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of 178c9fbc29Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 188c9fbc29Smrg# GNU General Public License for more details. 198c9fbc29Smrg 208c9fbc29Smrg# You should have received a copy of the GNU General Public License 218c9fbc29Smrg# along with this program; if not, write to the Free Software 228c9fbc29Smrg# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 238c9fbc29Smrg# 02110-1301, USA. 248c9fbc29Smrg 258c9fbc29Smrg# As a special exception to the GNU General Public License, if you 268c9fbc29Smrg# distribute this file as part of a program that contains a 278c9fbc29Smrg# configuration script generated by Autoconf, you may include it under 288c9fbc29Smrg# the same distribution terms that you use for the rest of that program. 298c9fbc29Smrg 308c9fbc29Smrgif test $# -eq 0; then 318c9fbc29Smrg echo 1>&2 "Try \`$0 --help' for more information" 328c9fbc29Smrg exit 1 338c9fbc29Smrgfi 348c9fbc29Smrg 358c9fbc29Smrgrun=: 368c9fbc29Smrgsed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' 378c9fbc29Smrgsed_minuso='s/.* -o \([^ ]*\).*/\1/p' 388c9fbc29Smrg 398c9fbc29Smrg# In the cases where this matters, `missing' is being run in the 408c9fbc29Smrg# srcdir already. 418c9fbc29Smrgif test -f configure.ac; then 428c9fbc29Smrg configure_ac=configure.ac 438c9fbc29Smrgelse 448c9fbc29Smrg configure_ac=configure.in 458c9fbc29Smrgfi 468c9fbc29Smrg 478c9fbc29Smrgmsg="missing on your system" 488c9fbc29Smrg 498c9fbc29Smrgcase $1 in 508c9fbc29Smrg--run) 518c9fbc29Smrg # Try to run requested program, and just exit if it succeeds. 528c9fbc29Smrg run= 538c9fbc29Smrg shift 548c9fbc29Smrg "$@" && exit 0 558c9fbc29Smrg # Exit code 63 means version mismatch. This often happens 568c9fbc29Smrg # when the user try to use an ancient version of a tool on 578c9fbc29Smrg # a file that requires a minimum version. In this case we 588c9fbc29Smrg # we should proceed has if the program had been absent, or 598c9fbc29Smrg # if --run hadn't been passed. 608c9fbc29Smrg if test $? = 63; then 618c9fbc29Smrg run=: 628c9fbc29Smrg msg="probably too old" 638c9fbc29Smrg fi 648c9fbc29Smrg ;; 658c9fbc29Smrg 668c9fbc29Smrg -h|--h|--he|--hel|--help) 678c9fbc29Smrg echo "\ 688c9fbc29Smrg$0 [OPTION]... PROGRAM [ARGUMENT]... 698c9fbc29Smrg 708c9fbc29SmrgHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 718c9fbc29Smrgerror status if there is no known handling for PROGRAM. 728c9fbc29Smrg 738c9fbc29SmrgOptions: 748c9fbc29Smrg -h, --help display this help and exit 758c9fbc29Smrg -v, --version output version information and exit 768c9fbc29Smrg --run try to run the given command, and emulate it if it fails 778c9fbc29Smrg 788c9fbc29SmrgSupported PROGRAM values: 798c9fbc29Smrg aclocal touch file \`aclocal.m4' 808c9fbc29Smrg autoconf touch file \`configure' 818c9fbc29Smrg autoheader touch file \`config.h.in' 828c9fbc29Smrg autom4te touch the output file, or create a stub one 838c9fbc29Smrg automake touch all \`Makefile.in' files 848c9fbc29Smrg bison create \`y.tab.[ch]', if possible, from existing .[ch] 858c9fbc29Smrg flex create \`lex.yy.c', if possible, from existing .c 868c9fbc29Smrg help2man touch the output file 878c9fbc29Smrg lex create \`lex.yy.c', if possible, from existing .c 888c9fbc29Smrg makeinfo touch the output file 898c9fbc29Smrg tar try tar, gnutar, gtar, then tar without non-portable flags 908c9fbc29Smrg yacc create \`y.tab.[ch]', if possible, from existing .[ch] 918c9fbc29Smrg 928c9fbc29SmrgSend bug reports to <bug-automake@gnu.org>." 938c9fbc29Smrg exit $? 948c9fbc29Smrg ;; 958c9fbc29Smrg 968c9fbc29Smrg -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 978c9fbc29Smrg echo "missing $scriptversion (GNU Automake)" 988c9fbc29Smrg exit $? 998c9fbc29Smrg ;; 1008c9fbc29Smrg 1018c9fbc29Smrg -*) 1028c9fbc29Smrg echo 1>&2 "$0: Unknown \`$1' option" 1038c9fbc29Smrg echo 1>&2 "Try \`$0 --help' for more information" 1048c9fbc29Smrg exit 1 1058c9fbc29Smrg ;; 1068c9fbc29Smrg 1078c9fbc29Smrgesac 1088c9fbc29Smrg 1098c9fbc29Smrg# Now exit if we have it, but it failed. Also exit now if we 1108c9fbc29Smrg# don't have it and --version was passed (most likely to detect 1118c9fbc29Smrg# the program). 1128c9fbc29Smrgcase $1 in 1138c9fbc29Smrg lex|yacc) 1148c9fbc29Smrg # Not GNU programs, they don't have --version. 1158c9fbc29Smrg ;; 1168c9fbc29Smrg 1178c9fbc29Smrg tar) 1188c9fbc29Smrg if test -n "$run"; then 1198c9fbc29Smrg echo 1>&2 "ERROR: \`tar' requires --run" 1208c9fbc29Smrg exit 1 1218c9fbc29Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 1228c9fbc29Smrg exit 1 1238c9fbc29Smrg fi 1248c9fbc29Smrg ;; 1258c9fbc29Smrg 1268c9fbc29Smrg *) 1278c9fbc29Smrg if test -z "$run" && ($1 --version) > /dev/null 2>&1; then 1288c9fbc29Smrg # We have it, but it failed. 1298c9fbc29Smrg exit 1 1308c9fbc29Smrg elif test "x$2" = "x--version" || test "x$2" = "x--help"; then 1318c9fbc29Smrg # Could not run --version or --help. This is probably someone 1328c9fbc29Smrg # running `$TOOL --version' or `$TOOL --help' to check whether 1338c9fbc29Smrg # $TOOL exists and not knowing $TOOL uses missing. 1348c9fbc29Smrg exit 1 1358c9fbc29Smrg fi 1368c9fbc29Smrg ;; 1378c9fbc29Smrgesac 1388c9fbc29Smrg 1398c9fbc29Smrg# If it does not exist, or fails to run (possibly an outdated version), 1408c9fbc29Smrg# try to emulate it. 1418c9fbc29Smrgcase $1 in 1428c9fbc29Smrg aclocal*) 1438c9fbc29Smrg echo 1>&2 "\ 1448c9fbc29SmrgWARNING: \`$1' is $msg. You should only need it if 1458c9fbc29Smrg you modified \`acinclude.m4' or \`${configure_ac}'. You might want 1468c9fbc29Smrg to install the \`Automake' and \`Perl' packages. Grab them from 1478c9fbc29Smrg any GNU archive site." 1488c9fbc29Smrg touch aclocal.m4 1498c9fbc29Smrg ;; 1508c9fbc29Smrg 1518c9fbc29Smrg autoconf) 1528c9fbc29Smrg echo 1>&2 "\ 1538c9fbc29SmrgWARNING: \`$1' is $msg. You should only need it if 1548c9fbc29Smrg you modified \`${configure_ac}'. You might want to install the 1558c9fbc29Smrg \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 1568c9fbc29Smrg archive site." 1578c9fbc29Smrg touch configure 1588c9fbc29Smrg ;; 1598c9fbc29Smrg 1608c9fbc29Smrg autoheader) 1618c9fbc29Smrg echo 1>&2 "\ 1628c9fbc29SmrgWARNING: \`$1' is $msg. You should only need it if 1638c9fbc29Smrg you modified \`acconfig.h' or \`${configure_ac}'. You might want 1648c9fbc29Smrg to install the \`Autoconf' and \`GNU m4' packages. Grab them 1658c9fbc29Smrg from any GNU archive site." 1668c9fbc29Smrg files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` 1678c9fbc29Smrg test -z "$files" && files="config.h" 1688c9fbc29Smrg touch_files= 1698c9fbc29Smrg for f in $files; do 1708c9fbc29Smrg case $f in 1718c9fbc29Smrg *:*) touch_files="$touch_files "`echo "$f" | 1728c9fbc29Smrg sed -e 's/^[^:]*://' -e 's/:.*//'`;; 1738c9fbc29Smrg *) touch_files="$touch_files $f.in";; 1748c9fbc29Smrg esac 1758c9fbc29Smrg done 1768c9fbc29Smrg touch $touch_files 1778c9fbc29Smrg ;; 1788c9fbc29Smrg 1798c9fbc29Smrg automake*) 1808c9fbc29Smrg echo 1>&2 "\ 1818c9fbc29SmrgWARNING: \`$1' is $msg. You should only need it if 1828c9fbc29Smrg you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. 1838c9fbc29Smrg You might want to install the \`Automake' and \`Perl' packages. 1848c9fbc29Smrg Grab them from any GNU archive site." 1858c9fbc29Smrg find . -type f -name Makefile.am -print | 1868c9fbc29Smrg sed 's/\.am$/.in/' | 1878c9fbc29Smrg while read f; do touch "$f"; done 1888c9fbc29Smrg ;; 1898c9fbc29Smrg 1908c9fbc29Smrg autom4te) 1918c9fbc29Smrg echo 1>&2 "\ 1928c9fbc29SmrgWARNING: \`$1' is needed, but is $msg. 1938c9fbc29Smrg You might have modified some files without having the 1948c9fbc29Smrg proper tools for further handling them. 1958c9fbc29Smrg You can get \`$1' as part of \`Autoconf' from any GNU 1968c9fbc29Smrg archive site." 1978c9fbc29Smrg 1988c9fbc29Smrg file=`echo "$*" | sed -n "$sed_output"` 1998c9fbc29Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 2008c9fbc29Smrg if test -f "$file"; then 2018c9fbc29Smrg touch $file 2028c9fbc29Smrg else 2038c9fbc29Smrg test -z "$file" || exec >$file 2048c9fbc29Smrg echo "#! /bin/sh" 2058c9fbc29Smrg echo "# Created by GNU Automake missing as a replacement of" 2068c9fbc29Smrg echo "# $ $@" 2078c9fbc29Smrg echo "exit 0" 2088c9fbc29Smrg chmod +x $file 2098c9fbc29Smrg exit 1 2108c9fbc29Smrg fi 2118c9fbc29Smrg ;; 2128c9fbc29Smrg 2138c9fbc29Smrg bison|yacc) 2148c9fbc29Smrg echo 1>&2 "\ 2158c9fbc29SmrgWARNING: \`$1' $msg. You should only need it if 2168c9fbc29Smrg you modified a \`.y' file. You may need the \`Bison' package 2178c9fbc29Smrg in order for those modifications to take effect. You can get 2188c9fbc29Smrg \`Bison' from any GNU archive site." 2198c9fbc29Smrg rm -f y.tab.c y.tab.h 2208c9fbc29Smrg if test $# -ne 1; then 2218c9fbc29Smrg eval LASTARG="\${$#}" 2228c9fbc29Smrg case $LASTARG in 2238c9fbc29Smrg *.y) 2248c9fbc29Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 2258c9fbc29Smrg if test -f "$SRCFILE"; then 2268c9fbc29Smrg cp "$SRCFILE" y.tab.c 2278c9fbc29Smrg fi 2288c9fbc29Smrg SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 2298c9fbc29Smrg if test -f "$SRCFILE"; then 2308c9fbc29Smrg cp "$SRCFILE" y.tab.h 2318c9fbc29Smrg fi 2328c9fbc29Smrg ;; 2338c9fbc29Smrg esac 2348c9fbc29Smrg fi 2358c9fbc29Smrg if test ! -f y.tab.h; then 2368c9fbc29Smrg echo >y.tab.h 2378c9fbc29Smrg fi 2388c9fbc29Smrg if test ! -f y.tab.c; then 2398c9fbc29Smrg echo 'main() { return 0; }' >y.tab.c 2408c9fbc29Smrg fi 2418c9fbc29Smrg ;; 2428c9fbc29Smrg 2438c9fbc29Smrg lex|flex) 2448c9fbc29Smrg echo 1>&2 "\ 2458c9fbc29SmrgWARNING: \`$1' is $msg. You should only need it if 2468c9fbc29Smrg you modified a \`.l' file. You may need the \`Flex' package 2478c9fbc29Smrg in order for those modifications to take effect. You can get 2488c9fbc29Smrg \`Flex' from any GNU archive site." 2498c9fbc29Smrg rm -f lex.yy.c 2508c9fbc29Smrg if test $# -ne 1; then 2518c9fbc29Smrg eval LASTARG="\${$#}" 2528c9fbc29Smrg case $LASTARG in 2538c9fbc29Smrg *.l) 2548c9fbc29Smrg SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 2558c9fbc29Smrg if test -f "$SRCFILE"; then 2568c9fbc29Smrg cp "$SRCFILE" lex.yy.c 2578c9fbc29Smrg fi 2588c9fbc29Smrg ;; 2598c9fbc29Smrg esac 2608c9fbc29Smrg fi 2618c9fbc29Smrg if test ! -f lex.yy.c; then 2628c9fbc29Smrg echo 'main() { return 0; }' >lex.yy.c 2638c9fbc29Smrg fi 2648c9fbc29Smrg ;; 2658c9fbc29Smrg 2668c9fbc29Smrg help2man) 2678c9fbc29Smrg echo 1>&2 "\ 2688c9fbc29SmrgWARNING: \`$1' is $msg. You should only need it if 2698c9fbc29Smrg you modified a dependency of a manual page. You may need the 2708c9fbc29Smrg \`Help2man' package in order for those modifications to take 2718c9fbc29Smrg effect. You can get \`Help2man' from any GNU archive site." 2728c9fbc29Smrg 2738c9fbc29Smrg file=`echo "$*" | sed -n "$sed_output"` 2748c9fbc29Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 2758c9fbc29Smrg if test -f "$file"; then 2768c9fbc29Smrg touch $file 2778c9fbc29Smrg else 2788c9fbc29Smrg test -z "$file" || exec >$file 2798c9fbc29Smrg echo ".ab help2man is required to generate this page" 2808c9fbc29Smrg exit 1 2818c9fbc29Smrg fi 2828c9fbc29Smrg ;; 2838c9fbc29Smrg 2848c9fbc29Smrg makeinfo) 2858c9fbc29Smrg echo 1>&2 "\ 2868c9fbc29SmrgWARNING: \`$1' is $msg. You should only need it if 2878c9fbc29Smrg you modified a \`.texi' or \`.texinfo' file, or any other file 2888c9fbc29Smrg indirectly affecting the aspect of the manual. The spurious 2898c9fbc29Smrg call might also be the consequence of using a buggy \`make' (AIX, 2908c9fbc29Smrg DU, IRIX). You might want to install the \`Texinfo' package or 2918c9fbc29Smrg the \`GNU make' package. Grab either from any GNU archive site." 2928c9fbc29Smrg # The file to touch is that specified with -o ... 2938c9fbc29Smrg file=`echo "$*" | sed -n "$sed_output"` 2948c9fbc29Smrg test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` 2958c9fbc29Smrg if test -z "$file"; then 2968c9fbc29Smrg # ... or it is the one specified with @setfilename ... 2978c9fbc29Smrg infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 2988c9fbc29Smrg file=`sed -n ' 2998c9fbc29Smrg /^@setfilename/{ 3008c9fbc29Smrg s/.* \([^ ]*\) *$/\1/ 3018c9fbc29Smrg p 3028c9fbc29Smrg q 3038c9fbc29Smrg }' $infile` 3048c9fbc29Smrg # ... or it is derived from the source name (dir/f.texi becomes f.info) 3058c9fbc29Smrg test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info 3068c9fbc29Smrg fi 3078c9fbc29Smrg # If the file does not exist, the user really needs makeinfo; 3088c9fbc29Smrg # let's fail without touching anything. 3098c9fbc29Smrg test -f $file || exit 1 3108c9fbc29Smrg touch $file 3118c9fbc29Smrg ;; 3128c9fbc29Smrg 3138c9fbc29Smrg tar) 3148c9fbc29Smrg shift 3158c9fbc29Smrg 3168c9fbc29Smrg # We have already tried tar in the generic part. 3178c9fbc29Smrg # Look for gnutar/gtar before invocation to avoid ugly error 3188c9fbc29Smrg # messages. 3198c9fbc29Smrg if (gnutar --version > /dev/null 2>&1); then 3208c9fbc29Smrg gnutar "$@" && exit 0 3218c9fbc29Smrg fi 3228c9fbc29Smrg if (gtar --version > /dev/null 2>&1); then 3238c9fbc29Smrg gtar "$@" && exit 0 3248c9fbc29Smrg fi 3258c9fbc29Smrg firstarg="$1" 3268c9fbc29Smrg if shift; then 3278c9fbc29Smrg case $firstarg in 3288c9fbc29Smrg *o*) 3298c9fbc29Smrg firstarg=`echo "$firstarg" | sed s/o//` 3308c9fbc29Smrg tar "$firstarg" "$@" && exit 0 3318c9fbc29Smrg ;; 3328c9fbc29Smrg esac 3338c9fbc29Smrg case $firstarg in 3348c9fbc29Smrg *h*) 3358c9fbc29Smrg firstarg=`echo "$firstarg" | sed s/h//` 3368c9fbc29Smrg tar "$firstarg" "$@" && exit 0 3378c9fbc29Smrg ;; 3388c9fbc29Smrg esac 3398c9fbc29Smrg fi 3408c9fbc29Smrg 3418c9fbc29Smrg echo 1>&2 "\ 3428c9fbc29SmrgWARNING: I can't seem to be able to run \`tar' with the given arguments. 3438c9fbc29Smrg You may want to install GNU tar or Free paxutils, or check the 3448c9fbc29Smrg command line arguments." 3458c9fbc29Smrg exit 1 3468c9fbc29Smrg ;; 3478c9fbc29Smrg 3488c9fbc29Smrg *) 3498c9fbc29Smrg echo 1>&2 "\ 3508c9fbc29SmrgWARNING: \`$1' is needed, and is $msg. 3518c9fbc29Smrg You might have modified some files without having the 3528c9fbc29Smrg proper tools for further handling them. Check the \`README' file, 3538c9fbc29Smrg it often tells you about the needed prerequisites for installing 3548c9fbc29Smrg this package. You may also peek at any GNU archive site, in case 3558c9fbc29Smrg some other package would contain this missing \`$1' program." 3568c9fbc29Smrg exit 1 3578c9fbc29Smrg ;; 3588c9fbc29Smrgesac 3598c9fbc29Smrg 3608c9fbc29Smrgexit 0 3618c9fbc29Smrg 3628c9fbc29Smrg# Local variables: 3638c9fbc29Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 3648c9fbc29Smrg# time-stamp-start: "scriptversion=" 3658c9fbc29Smrg# time-stamp-format: "%:y-%02m-%02d.%02H" 3668c9fbc29Smrg# time-stamp-end: "$" 3678c9fbc29Smrg# End: 368