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