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