Blame missing

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