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