Blame seq/sbiload/missing

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