1N/A#! /bin/sh
1N/A# Common stub for a few missing GNU programs while installing.
1N/A
1N/Ascriptversion=2004-09-07.08
1N/A
1N/A# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
1N/A# Free Software Foundation, Inc.
1N/A# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
1N/A
1N/A# This program is free software; you can redistribute it and/or modify
1N/A# it under the terms of the GNU General Public License as published by
1N/A# the Free Software Foundation; either version 2, or (at your option)
1N/A# any later version.
1N/A
1N/A# This program is distributed in the hope that it will be useful,
1N/A# but WITHOUT ANY WARRANTY; without even the implied warranty of
1N/A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1N/A# GNU General Public License for more details.
1N/A
1N/A# You should have received a copy of the GNU General Public License
1N/A# along with this program; if not, write to the Free Software
1N/A# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1N/A# 02111-1307, USA.
1N/A
1N/A# As a special exception to the GNU General Public License, if you
1N/A# distribute this file as part of a program that contains a
1N/A# configuration script generated by Autoconf, you may include it under
1N/A# the same distribution terms that you use for the rest of that program.
1N/A
1N/Aif test $# -eq 0; then
1N/A echo 1>&2 "Try \`$0 --help' for more information"
1N/A exit 1
1N/Afi
1N/A
1N/Arun=:
1N/A
1N/A# In the cases where this matters, `missing' is being run in the
1N/A# srcdir already.
1N/Aif test -f configure.ac; then
1N/A configure_ac=configure.ac
1N/Aelse
1N/A configure_ac=configure.in
1N/Afi
1N/A
1N/Amsg="missing on your system"
1N/A
1N/Acase "$1" in
1N/A--run)
1N/A # Try to run requested program, and just exit if it succeeds.
1N/A run=
1N/A shift
1N/A "$@" && exit 0
1N/A # Exit code 63 means version mismatch. This often happens
1N/A # when the user try to use an ancient version of a tool on
1N/A # a file that requires a minimum version. In this case we
1N/A # we should proceed has if the program had been absent, or
1N/A # if --run hadn't been passed.
1N/A if test $? = 63; then
1N/A run=:
1N/A msg="probably too old"
1N/A fi
1N/A ;;
1N/A
1N/A -h|--h|--he|--hel|--help)
1N/A echo "\
1N/A$0 [OPTION]... PROGRAM [ARGUMENT]...
1N/A
1N/AHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
1N/Aerror status if there is no known handling for PROGRAM.
1N/A
1N/AOptions:
1N/A -h, --help display this help and exit
1N/A -v, --version output version information and exit
1N/A --run try to run the given command, and emulate it if it fails
1N/A
1N/ASupported PROGRAM values:
1N/A aclocal touch file \`aclocal.m4'
1N/A autoconf touch file \`configure'
1N/A autoheader touch file \`config.h.in'
1N/A automake touch all \`Makefile.in' files
1N/A bison create \`y.tab.[ch]', if possible, from existing .[ch]
1N/A flex create \`lex.yy.c', if possible, from existing .c
1N/A help2man touch the output file
1N/A lex create \`lex.yy.c', if possible, from existing .c
1N/A makeinfo touch the output file
1N/A tar try tar, gnutar, gtar, then tar without non-portable flags
1N/A yacc create \`y.tab.[ch]', if possible, from existing .[ch]
1N/A
1N/ASend bug reports to <bug-automake@gnu.org>."
1N/A exit 0
1N/A ;;
1N/A
1N/A -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
1N/A echo "missing $scriptversion (GNU Automake)"
1N/A exit 0
1N/A ;;
1N/A
1N/A -*)
1N/A echo 1>&2 "$0: Unknown \`$1' option"
1N/A echo 1>&2 "Try \`$0 --help' for more information"
1N/A exit 1
1N/A ;;
1N/A
1N/Aesac
1N/A
1N/A# Now exit if we have it, but it failed. Also exit now if we
1N/A# don't have it and --version was passed (most likely to detect
1N/A# the program).
1N/Acase "$1" in
1N/A lex|yacc)
1N/A # Not GNU programs, they don't have --version.
1N/A ;;
1N/A
1N/A tar)
1N/A if test -n "$run"; then
1N/A echo 1>&2 "ERROR: \`tar' requires --run"
1N/A exit 1
1N/A elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
1N/A exit 1
1N/A fi
1N/A ;;
1N/A
1N/A *)
1N/A if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
1N/A # We have it, but it failed.
1N/A exit 1
1N/A elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
1N/A # Could not run --version or --help. This is probably someone
1N/A # running `$TOOL --version' or `$TOOL --help' to check whether
1N/A # $TOOL exists and not knowing $TOOL uses missing.
1N/A exit 1
1N/A fi
1N/A ;;
1N/Aesac
1N/A
1N/A# If it does not exist, or fails to run (possibly an outdated version),
1N/A# try to emulate it.
1N/Acase "$1" in
1N/A aclocal*)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is $msg. You should only need it if
1N/A you modified \`acinclude.m4' or \`${configure_ac}'. You might want
1N/A to install the \`Automake' and \`Perl' packages. Grab them from
1N/A any GNU archive site."
1N/A touch aclocal.m4
1N/A ;;
1N/A
1N/A autoconf)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is $msg. You should only need it if
1N/A you modified \`${configure_ac}'. You might want to install the
1N/A \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
1N/A archive site."
1N/A touch configure
1N/A ;;
1N/A
1N/A autoheader)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is $msg. You should only need it if
1N/A you modified \`acconfig.h' or \`${configure_ac}'. You might want
1N/A to install the \`Autoconf' and \`GNU m4' packages. Grab them
1N/A from any GNU archive site."
1N/A files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
1N/A test -z "$files" && files="config.h"
1N/A touch_files=
1N/A for f in $files; do
1N/A case "$f" in
1N/A *:*) touch_files="$touch_files "`echo "$f" |
1N/A sed -e 's/^[^:]*://' -e 's/:.*//'`;;
1N/A *) touch_files="$touch_files $f.in";;
1N/A esac
1N/A done
1N/A touch $touch_files
1N/A ;;
1N/A
1N/A automake*)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is $msg. You should only need it if
1N/A you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
1N/A You might want to install the \`Automake' and \`Perl' packages.
1N/A Grab them from any GNU archive site."
1N/A find . -type f -name Makefile.am -print |
1N/A sed 's/\.am$/.in/' |
1N/A while read f; do touch "$f"; done
1N/A ;;
1N/A
1N/A autom4te)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is needed, but is $msg.
1N/A You might have modified some files without having the
1N/A proper tools for further handling them.
1N/A You can get \`$1' as part of \`Autoconf' from any GNU
1N/A archive site."
1N/A
1N/A file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
1N/A test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
1N/A if test -f "$file"; then
1N/A touch $file
1N/A else
1N/A test -z "$file" || exec >$file
1N/A echo "#! /bin/sh"
1N/A echo "# Created by GNU Automake missing as a replacement of"
1N/A echo "# $ $@"
1N/A echo "exit 0"
1N/A chmod +x $file
1N/A exit 1
1N/A fi
1N/A ;;
1N/A
1N/A bison|yacc)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' $msg. You should only need it if
1N/A you modified a \`.y' file. You may need the \`Bison' package
1N/A in order for those modifications to take effect. You can get
1N/A \`Bison' from any GNU archive site."
1N/A rm -f y.tab.c y.tab.h
1N/A if [ $# -ne 1 ]; then
1N/A eval LASTARG="\${$#}"
1N/A case "$LASTARG" in
1N/A *.y)
1N/A SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
1N/A if [ -f "$SRCFILE" ]; then
1N/A cp "$SRCFILE" y.tab.c
1N/A fi
1N/A SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
1N/A if [ -f "$SRCFILE" ]; then
1N/A cp "$SRCFILE" y.tab.h
1N/A fi
1N/A ;;
1N/A esac
1N/A fi
1N/A if [ ! -f y.tab.h ]; then
1N/A echo >y.tab.h
1N/A fi
1N/A if [ ! -f y.tab.c ]; then
1N/A echo 'main() { return 0; }' >y.tab.c
1N/A fi
1N/A ;;
1N/A
1N/A lex|flex)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is $msg. You should only need it if
1N/A you modified a \`.l' file. You may need the \`Flex' package
1N/A in order for those modifications to take effect. You can get
1N/A \`Flex' from any GNU archive site."
1N/A rm -f lex.yy.c
1N/A if [ $# -ne 1 ]; then
1N/A eval LASTARG="\${$#}"
1N/A case "$LASTARG" in
1N/A *.l)
1N/A SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
1N/A if [ -f "$SRCFILE" ]; then
1N/A cp "$SRCFILE" lex.yy.c
1N/A fi
1N/A ;;
1N/A esac
1N/A fi
1N/A if [ ! -f lex.yy.c ]; then
1N/A echo 'main() { return 0; }' >lex.yy.c
1N/A fi
1N/A ;;
1N/A
1N/A help2man)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is $msg. You should only need it if
1N/A you modified a dependency of a manual page. You may need the
1N/A \`Help2man' package in order for those modifications to take
1N/A effect. You can get \`Help2man' from any GNU archive site."
1N/A
1N/A file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
1N/A if test -z "$file"; then
1N/A file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
1N/A fi
1N/A if [ -f "$file" ]; then
1N/A touch $file
1N/A else
1N/A test -z "$file" || exec >$file
1N/A echo ".ab help2man is required to generate this page"
1N/A exit 1
1N/A fi
1N/A ;;
1N/A
1N/A makeinfo)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is $msg. You should only need it if
1N/A you modified a \`.texi' or \`.texinfo' file, or any other file
1N/A indirectly affecting the aspect of the manual. The spurious
1N/A call might also be the consequence of using a buggy \`make' (AIX,
1N/A DU, IRIX). You might want to install the \`Texinfo' package or
1N/A the \`GNU make' package. Grab either from any GNU archive site."
1N/A file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
1N/A if test -z "$file"; then
1N/A file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
1N/A file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
1N/A fi
1N/A touch $file
1N/A ;;
1N/A
1N/A tar)
1N/A shift
1N/A
1N/A # We have already tried tar in the generic part.
1N/A # Look for gnutar/gtar before invocation to avoid ugly error
1N/A # messages.
1N/A if (gnutar --version > /dev/null 2>&1); then
1N/A gnutar "$@" && exit 0
1N/A fi
1N/A if (gtar --version > /dev/null 2>&1); then
1N/A gtar "$@" && exit 0
1N/A fi
1N/A firstarg="$1"
1N/A if shift; then
1N/A case "$firstarg" in
1N/A *o*)
1N/A firstarg=`echo "$firstarg" | sed s/o//`
1N/A tar "$firstarg" "$@" && exit 0
1N/A ;;
1N/A esac
1N/A case "$firstarg" in
1N/A *h*)
1N/A firstarg=`echo "$firstarg" | sed s/h//`
1N/A tar "$firstarg" "$@" && exit 0
1N/A ;;
1N/A esac
1N/A fi
1N/A
1N/A echo 1>&2 "\
1N/AWARNING: I can't seem to be able to run \`tar' with the given arguments.
1N/A You may want to install GNU tar or Free paxutils, or check the
1N/A command line arguments."
1N/A exit 1
1N/A ;;
1N/A
1N/A *)
1N/A echo 1>&2 "\
1N/AWARNING: \`$1' is needed, and is $msg.
1N/A You might have modified some files without having the
1N/A proper tools for further handling them. Check the \`README' file,
1N/A it often tells you about the needed prerequisites for installing
1N/A this package. You may also peek at any GNU archive site, in case
1N/A some other package would contain this missing \`$1' program."
1N/A exit 1
1N/A ;;
1N/Aesac
1N/A
1N/Aexit 0
1N/A
1N/A# Local variables:
1N/A# eval: (add-hook 'write-file-hooks 'time-stamp)
1N/A# time-stamp-start: "scriptversion="
1N/A# time-stamp-format: "%:y-%02m-%02d.%02H"
1N/A# time-stamp-end: "$"
1N/A# End: