joachim99@2: #! /bin/sh joachim99@2: # Common stub for a few missing GNU programs while installing. joachim99@14: # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. joachim99@2: # Originally by Fran,cois Pinard , 1996. joachim99@2: joachim99@2: # This program is free software; you can redistribute it and/or modify joachim99@2: # it under the terms of the GNU General Public License as published by joachim99@2: # the Free Software Foundation; either version 2, or (at your option) joachim99@2: # any later version. joachim99@2: joachim99@2: # This program is distributed in the hope that it will be useful, joachim99@2: # but WITHOUT ANY WARRANTY; without even the implied warranty of joachim99@2: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the joachim99@2: # GNU General Public License for more details. joachim99@2: joachim99@2: # You should have received a copy of the GNU General Public License joachim99@2: # along with this program; if not, write to the Free Software joachim99@2: # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA joachim99@2: # 02111-1307, USA. joachim99@2: joachim99@2: # As a special exception to the GNU General Public License, if you joachim99@2: # distribute this file as part of a program that contains a joachim99@2: # configuration script generated by Autoconf, you may include it under joachim99@2: # the same distribution terms that you use for the rest of that program. joachim99@2: joachim99@2: if test $# -eq 0; then joachim99@2: echo 1>&2 "Try \`$0 --help' for more information" joachim99@2: exit 1 joachim99@2: fi joachim99@2: joachim99@2: run=: joachim99@2: joachim99@2: # In the cases where this matters, `missing' is being run in the joachim99@2: # srcdir already. joachim99@2: if test -f configure.ac; then joachim99@2: configure_ac=configure.ac joachim99@2: else joachim99@2: configure_ac=configure.in joachim99@2: fi joachim99@2: joachim99@2: case "$1" in joachim99@2: --run) joachim99@2: # Try to run requested program, and just exit if it succeeds. joachim99@2: run= joachim99@2: shift joachim99@2: "$@" && exit 0 joachim99@2: ;; joachim99@2: esac joachim99@2: joachim99@2: # If it does not exist, or fails to run (possibly an outdated version), joachim99@2: # try to emulate it. joachim99@2: case "$1" in joachim99@2: joachim99@2: -h|--h|--he|--hel|--help) joachim99@2: echo "\ joachim99@2: $0 [OPTION]... PROGRAM [ARGUMENT]... joachim99@2: joachim99@2: Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an joachim99@2: error status if there is no known handling for PROGRAM. joachim99@2: joachim99@2: Options: joachim99@2: -h, --help display this help and exit joachim99@2: -v, --version output version information and exit joachim99@2: --run try to run the given command, and emulate it if it fails joachim99@2: joachim99@2: Supported PROGRAM values: joachim99@2: aclocal touch file \`aclocal.m4' joachim99@2: autoconf touch file \`configure' joachim99@2: autoheader touch file \`config.h.in' joachim99@2: automake touch all \`Makefile.in' files joachim99@2: bison create \`y.tab.[ch]', if possible, from existing .[ch] joachim99@2: flex create \`lex.yy.c', if possible, from existing .c joachim99@2: help2man touch the output file joachim99@2: lex create \`lex.yy.c', if possible, from existing .c joachim99@2: makeinfo touch the output file joachim99@2: tar try tar, gnutar, gtar, then tar without non-portable flags joachim99@2: yacc create \`y.tab.[ch]', if possible, from existing .[ch]" joachim99@2: ;; joachim99@2: joachim99@2: -v|--v|--ve|--ver|--vers|--versi|--versio|--version) joachim99@14: echo "missing 0.4 - GNU automake" joachim99@2: ;; joachim99@2: joachim99@2: -*) joachim99@2: echo 1>&2 "$0: Unknown \`$1' option" joachim99@2: echo 1>&2 "Try \`$0 --help' for more information" joachim99@2: exit 1 joachim99@2: ;; joachim99@2: joachim99@14: aclocal*) joachim99@14: if test -z "$run" && ($1 --version) > /dev/null 2>&1; then joachim99@14: # We have it, but it failed. joachim99@14: exit 1 joachim99@14: fi joachim99@14: joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is missing on your system. You should only need it if joachim99@2: you modified \`acinclude.m4' or \`${configure_ac}'. You might want joachim99@2: to install the \`Automake' and \`Perl' packages. Grab them from joachim99@2: any GNU archive site." joachim99@2: touch aclocal.m4 joachim99@2: ;; joachim99@2: joachim99@2: autoconf) joachim99@14: if test -z "$run" && ($1 --version) > /dev/null 2>&1; then joachim99@14: # We have it, but it failed. joachim99@14: exit 1 joachim99@14: fi joachim99@14: joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is missing on your system. You should only need it if joachim99@2: you modified \`${configure_ac}'. You might want to install the joachim99@2: \`Autoconf' and \`GNU m4' packages. Grab them from any GNU joachim99@2: archive site." joachim99@2: touch configure joachim99@2: ;; joachim99@2: joachim99@2: autoheader) joachim99@14: if test -z "$run" && ($1 --version) > /dev/null 2>&1; then joachim99@14: # We have it, but it failed. joachim99@14: exit 1 joachim99@14: fi joachim99@14: joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is missing on your system. You should only need it if joachim99@2: you modified \`acconfig.h' or \`${configure_ac}'. You might want joachim99@2: to install the \`Autoconf' and \`GNU m4' packages. Grab them joachim99@2: from any GNU archive site." joachim99@2: files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` joachim99@2: test -z "$files" && files="config.h" joachim99@2: touch_files= joachim99@2: for f in $files; do joachim99@2: case "$f" in joachim99@2: *:*) touch_files="$touch_files "`echo "$f" | joachim99@2: sed -e 's/^[^:]*://' -e 's/:.*//'`;; joachim99@2: *) touch_files="$touch_files $f.in";; joachim99@2: esac joachim99@2: done joachim99@2: touch $touch_files joachim99@2: ;; joachim99@2: joachim99@14: automake*) joachim99@14: if test -z "$run" && ($1 --version) > /dev/null 2>&1; then joachim99@14: # We have it, but it failed. joachim99@14: exit 1 joachim99@14: fi joachim99@14: joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is missing on your system. You should only need it if joachim99@2: you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. joachim99@2: You might want to install the \`Automake' and \`Perl' packages. joachim99@2: Grab them from any GNU archive site." joachim99@2: find . -type f -name Makefile.am -print | joachim99@2: sed 's/\.am$/.in/' | joachim99@2: while read f; do touch "$f"; done joachim99@2: ;; joachim99@2: joachim99@14: autom4te) joachim99@14: if test -z "$run" && ($1 --version) > /dev/null 2>&1; then joachim99@14: # We have it, but it failed. joachim99@14: exit 1 joachim99@14: fi joachim99@14: joachim99@14: echo 1>&2 "\ joachim99@14: WARNING: \`$1' is needed, and you do not seem to have it handy on your joachim99@14: system. You might have modified some files without having the joachim99@14: proper tools for further handling them. joachim99@14: You can get \`$1Help2man' as part of \`Autoconf' from any GNU joachim99@14: archive site." joachim99@14: joachim99@14: file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` joachim99@14: test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` joachim99@14: if test -f "$file"; then joachim99@14: touch $file joachim99@14: else joachim99@14: test -z "$file" || exec >$file joachim99@14: echo "#! /bin/sh" joachim99@14: echo "# Created by GNU Automake missing as a replacement of" joachim99@14: echo "# $ $@" joachim99@14: echo "exit 0" joachim99@14: chmod +x $file joachim99@14: exit 1 joachim99@14: fi joachim99@14: ;; joachim99@14: joachim99@2: bison|yacc) joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is missing on your system. You should only need it if joachim99@2: you modified a \`.y' file. You may need the \`Bison' package joachim99@2: in order for those modifications to take effect. You can get joachim99@2: \`Bison' from any GNU archive site." joachim99@2: rm -f y.tab.c y.tab.h joachim99@2: if [ $# -ne 1 ]; then joachim99@2: eval LASTARG="\${$#}" joachim99@2: case "$LASTARG" in joachim99@2: *.y) joachim99@2: SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` joachim99@2: if [ -f "$SRCFILE" ]; then joachim99@2: cp "$SRCFILE" y.tab.c joachim99@2: fi joachim99@2: SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` joachim99@2: if [ -f "$SRCFILE" ]; then joachim99@2: cp "$SRCFILE" y.tab.h joachim99@2: fi joachim99@2: ;; joachim99@2: esac joachim99@2: fi joachim99@2: if [ ! -f y.tab.h ]; then joachim99@2: echo >y.tab.h joachim99@2: fi joachim99@2: if [ ! -f y.tab.c ]; then joachim99@2: echo 'main() { return 0; }' >y.tab.c joachim99@2: fi joachim99@2: ;; joachim99@2: joachim99@2: lex|flex) joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is missing on your system. You should only need it if joachim99@2: you modified a \`.l' file. You may need the \`Flex' package joachim99@2: in order for those modifications to take effect. You can get joachim99@2: \`Flex' from any GNU archive site." joachim99@2: rm -f lex.yy.c joachim99@2: if [ $# -ne 1 ]; then joachim99@2: eval LASTARG="\${$#}" joachim99@2: case "$LASTARG" in joachim99@2: *.l) joachim99@2: SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` joachim99@2: if [ -f "$SRCFILE" ]; then joachim99@2: cp "$SRCFILE" lex.yy.c joachim99@2: fi joachim99@2: ;; joachim99@2: esac joachim99@2: fi joachim99@2: if [ ! -f lex.yy.c ]; then joachim99@2: echo 'main() { return 0; }' >lex.yy.c joachim99@2: fi joachim99@2: ;; joachim99@2: joachim99@2: help2man) joachim99@14: if test -z "$run" && ($1 --version) > /dev/null 2>&1; then joachim99@14: # We have it, but it failed. joachim99@14: exit 1 joachim99@14: fi joachim99@14: joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is missing on your system. You should only need it if joachim99@2: you modified a dependency of a manual page. You may need the joachim99@2: \`Help2man' package in order for those modifications to take joachim99@2: effect. You can get \`Help2man' from any GNU archive site." joachim99@2: joachim99@2: file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` joachim99@2: if test -z "$file"; then joachim99@2: file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` joachim99@2: fi joachim99@2: if [ -f "$file" ]; then joachim99@2: touch $file joachim99@2: else joachim99@2: test -z "$file" || exec >$file joachim99@2: echo ".ab help2man is required to generate this page" joachim99@2: exit 1 joachim99@2: fi joachim99@2: ;; joachim99@2: joachim99@2: makeinfo) joachim99@2: if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then joachim99@2: # We have makeinfo, but it failed. joachim99@2: exit 1 joachim99@2: fi joachim99@2: joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is missing on your system. You should only need it if joachim99@2: you modified a \`.texi' or \`.texinfo' file, or any other file joachim99@2: indirectly affecting the aspect of the manual. The spurious joachim99@2: call might also be the consequence of using a buggy \`make' (AIX, joachim99@2: DU, IRIX). You might want to install the \`Texinfo' package or joachim99@2: the \`GNU make' package. Grab either from any GNU archive site." joachim99@2: file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` joachim99@2: if test -z "$file"; then joachim99@2: file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` joachim99@2: file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` joachim99@2: fi joachim99@2: touch $file joachim99@2: ;; joachim99@2: joachim99@2: tar) joachim99@2: shift joachim99@2: if test -n "$run"; then joachim99@2: echo 1>&2 "ERROR: \`tar' requires --run" joachim99@2: exit 1 joachim99@2: fi joachim99@2: joachim99@2: # We have already tried tar in the generic part. joachim99@2: # Look for gnutar/gtar before invocation to avoid ugly error joachim99@2: # messages. joachim99@2: if (gnutar --version > /dev/null 2>&1); then joachim99@14: gnutar "$@" && exit 0 joachim99@2: fi joachim99@2: if (gtar --version > /dev/null 2>&1); then joachim99@14: gtar "$@" && exit 0 joachim99@2: fi joachim99@2: firstarg="$1" joachim99@2: if shift; then joachim99@2: case "$firstarg" in joachim99@2: *o*) joachim99@2: firstarg=`echo "$firstarg" | sed s/o//` joachim99@14: tar "$firstarg" "$@" && exit 0 joachim99@2: ;; joachim99@2: esac joachim99@2: case "$firstarg" in joachim99@2: *h*) joachim99@2: firstarg=`echo "$firstarg" | sed s/h//` joachim99@14: tar "$firstarg" "$@" && exit 0 joachim99@2: ;; joachim99@2: esac joachim99@2: fi joachim99@2: joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: I can't seem to be able to run \`tar' with the given arguments. joachim99@2: You may want to install GNU tar or Free paxutils, or check the joachim99@2: command line arguments." joachim99@2: exit 1 joachim99@2: ;; joachim99@2: joachim99@2: *) joachim99@2: echo 1>&2 "\ joachim99@2: WARNING: \`$1' is needed, and you do not seem to have it handy on your joachim99@2: system. You might have modified some files without having the joachim99@2: proper tools for further handling them. Check the \`README' file, joachim99@2: it often tells you about the needed prerequirements for installing joachim99@2: this package. You may also peek at any GNU archive site, in case joachim99@2: some other package would contain this missing \`$1' program." joachim99@2: exit 1 joachim99@2: ;; joachim99@2: esac joachim99@2: joachim99@2: exit 0