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