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