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