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