Blame SOURCES/libsodium-1.0.18/missing

rdobuilder 775784
#! /bin/sh
rdobuilder 775784
# Common wrapper for a few potentially missing GNU programs.
rdobuilder 775784
rdobuilder 775784
scriptversion=2013-10-28.13; # UTC
rdobuilder 775784
rdobuilder 775784
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
rdobuilder 775784
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
rdobuilder 775784
rdobuilder 775784
# This program is free software; you can redistribute it and/or modify
rdobuilder 775784
# it under the terms of the GNU General Public License as published by
rdobuilder 775784
# the Free Software Foundation; either version 2, or (at your option)
rdobuilder 775784
# any later version.
rdobuilder 775784
rdobuilder 775784
# This program is distributed in the hope that it will be useful,
rdobuilder 775784
# but WITHOUT ANY WARRANTY; without even the implied warranty of
rdobuilder 775784
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rdobuilder 775784
# GNU General Public License for more details.
rdobuilder 775784
rdobuilder 775784
# You should have received a copy of the GNU General Public License
rdobuilder 775784
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
rdobuilder 775784
rdobuilder 775784
# As a special exception to the GNU General Public License, if you
rdobuilder 775784
# distribute this file as part of a program that contains a
rdobuilder 775784
# configuration script generated by Autoconf, you may include it under
rdobuilder 775784
# the same distribution terms that you use for the rest of that program.
rdobuilder 775784
rdobuilder 775784
if test $# -eq 0; then
rdobuilder 775784
  echo 1>&2 "Try '$0 --help' for more information"
rdobuilder 775784
  exit 1
rdobuilder 775784
fi
rdobuilder 775784
rdobuilder 775784
case $1 in
rdobuilder 775784
rdobuilder 775784
  --is-lightweight)
rdobuilder 775784
    # Used by our autoconf macros to check whether the available missing
rdobuilder 775784
    # script is modern enough.
rdobuilder 775784
    exit 0
rdobuilder 775784
    ;;
rdobuilder 775784
rdobuilder 775784
  --run)
rdobuilder 775784
    # Back-compat with the calling convention used by older automake.
rdobuilder 775784
    shift
rdobuilder 775784
    ;;
rdobuilder 775784
rdobuilder 775784
  -h|--h|--he|--hel|--help)
rdobuilder 775784
    echo "\
rdobuilder 775784
$0 [OPTION]... PROGRAM [ARGUMENT]...
rdobuilder 775784
rdobuilder 775784
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
rdobuilder 775784
to PROGRAM being missing or too old.
rdobuilder 775784
rdobuilder 775784
Options:
rdobuilder 775784
  -h, --help      display this help and exit
rdobuilder 775784
  -v, --version   output version information and exit
rdobuilder 775784
rdobuilder 775784
Supported PROGRAM values:
rdobuilder 775784
  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
rdobuilder 775784
  bison     yacc      flex         lex       help2man
rdobuilder 775784
rdobuilder 775784
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
rdobuilder 775784
'g' are ignored when checking the name.
rdobuilder 775784
rdobuilder 775784
Send bug reports to <bug-automake@gnu.org>."
rdobuilder 775784
    exit $?
rdobuilder 775784
    ;;
rdobuilder 775784
rdobuilder 775784
  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
rdobuilder 775784
    echo "missing $scriptversion (GNU Automake)"
rdobuilder 775784
    exit $?
rdobuilder 775784
    ;;
rdobuilder 775784
rdobuilder 775784
  -*)
rdobuilder 775784
    echo 1>&2 "$0: unknown '$1' option"
rdobuilder 775784
    echo 1>&2 "Try '$0 --help' for more information"
rdobuilder 775784
    exit 1
rdobuilder 775784
    ;;
rdobuilder 775784
rdobuilder 775784
esac
rdobuilder 775784
rdobuilder 775784
# Run the given program, remember its exit status.
rdobuilder 775784
"$@"; st=$?
rdobuilder 775784
rdobuilder 775784
# If it succeeded, we are done.
rdobuilder 775784
test $st -eq 0 && exit 0
rdobuilder 775784
rdobuilder 775784
# Also exit now if we it failed (or wasn't found), and '--version' was
rdobuilder 775784
# passed; such an option is passed most likely to detect whether the
rdobuilder 775784
# program is present and works.
rdobuilder 775784
case $2 in --version|--help) exit $st;; esac
rdobuilder 775784
rdobuilder 775784
# Exit code 63 means version mismatch.  This often happens when the user
rdobuilder 775784
# tries to use an ancient version of a tool on a file that requires a
rdobuilder 775784
# minimum version.
rdobuilder 775784
if test $st -eq 63; then
rdobuilder 775784
  msg="probably too old"
rdobuilder 775784
elif test $st -eq 127; then
rdobuilder 775784
  # Program was missing.
rdobuilder 775784
  msg="missing on your system"
rdobuilder 775784
else
rdobuilder 775784
  # Program was found and executed, but failed.  Give up.
rdobuilder 775784
  exit $st
rdobuilder 775784
fi
rdobuilder 775784
rdobuilder 775784
perl_URL=http://www.perl.org/
rdobuilder 775784
flex_URL=http://flex.sourceforge.net/
rdobuilder 775784
gnu_software_URL=http://www.gnu.org/software
rdobuilder 775784
rdobuilder 775784
program_details ()
rdobuilder 775784
{
rdobuilder 775784
  case $1 in
rdobuilder 775784
    aclocal|automake)
rdobuilder 775784
      echo "The '$1' program is part of the GNU Automake package:"
rdobuilder 775784
      echo "<$gnu_software_URL/automake>"
rdobuilder 775784
      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
rdobuilder 775784
      echo "<$gnu_software_URL/autoconf>"
rdobuilder 775784
      echo "<$gnu_software_URL/m4/>"
rdobuilder 775784
      echo "<$perl_URL>"
rdobuilder 775784
      ;;
rdobuilder 775784
    autoconf|autom4te|autoheader)
rdobuilder 775784
      echo "The '$1' program is part of the GNU Autoconf package:"
rdobuilder 775784
      echo "<$gnu_software_URL/autoconf/>"
rdobuilder 775784
      echo "It also requires GNU m4 and Perl in order to run:"
rdobuilder 775784
      echo "<$gnu_software_URL/m4/>"
rdobuilder 775784
      echo "<$perl_URL>"
rdobuilder 775784
      ;;
rdobuilder 775784
  esac
rdobuilder 775784
}
rdobuilder 775784
rdobuilder 775784
give_advice ()
rdobuilder 775784
{
rdobuilder 775784
  # Normalize program name to check for.
rdobuilder 775784
  normalized_program=`echo "$1" | sed '
rdobuilder 775784
    s/^gnu-//; t
rdobuilder 775784
    s/^gnu//; t
rdobuilder 775784
    s/^g//; t'`
rdobuilder 775784
rdobuilder 775784
  printf '%s\n' "'$1' is $msg."
rdobuilder 775784
rdobuilder 775784
  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
rdobuilder 775784
  case $normalized_program in
rdobuilder 775784
    autoconf*)
rdobuilder 775784
      echo "You should only need it if you modified 'configure.ac',"
rdobuilder 775784
      echo "or m4 files included by it."
rdobuilder 775784
      program_details 'autoconf'
rdobuilder 775784
      ;;
rdobuilder 775784
    autoheader*)
rdobuilder 775784
      echo "You should only need it if you modified 'acconfig.h' or"
rdobuilder 775784
      echo "$configure_deps."
rdobuilder 775784
      program_details 'autoheader'
rdobuilder 775784
      ;;
rdobuilder 775784
    automake*)
rdobuilder 775784
      echo "You should only need it if you modified 'Makefile.am' or"
rdobuilder 775784
      echo "$configure_deps."
rdobuilder 775784
      program_details 'automake'
rdobuilder 775784
      ;;
rdobuilder 775784
    aclocal*)
rdobuilder 775784
      echo "You should only need it if you modified 'acinclude.m4' or"
rdobuilder 775784
      echo "$configure_deps."
rdobuilder 775784
      program_details 'aclocal'
rdobuilder 775784
      ;;
rdobuilder 775784
   autom4te*)
rdobuilder 775784
      echo "You might have modified some maintainer files that require"
rdobuilder 775784
      echo "the 'autom4te' program to be rebuilt."
rdobuilder 775784
      program_details 'autom4te'
rdobuilder 775784
      ;;
rdobuilder 775784
    bison*|yacc*)
rdobuilder 775784
      echo "You should only need it if you modified a '.y' file."
rdobuilder 775784
      echo "You may want to install the GNU Bison package:"
rdobuilder 775784
      echo "<$gnu_software_URL/bison/>"
rdobuilder 775784
      ;;
rdobuilder 775784
    lex*|flex*)
rdobuilder 775784
      echo "You should only need it if you modified a '.l' file."
rdobuilder 775784
      echo "You may want to install the Fast Lexical Analyzer package:"
rdobuilder 775784
      echo "<$flex_URL>"
rdobuilder 775784
      ;;
rdobuilder 775784
    help2man*)
rdobuilder 775784
      echo "You should only need it if you modified a dependency" \
rdobuilder 775784
           "of a man page."
rdobuilder 775784
      echo "You may want to install the GNU Help2man package:"
rdobuilder 775784
      echo "<$gnu_software_URL/help2man/>"
rdobuilder 775784
    ;;
rdobuilder 775784
    makeinfo*)
rdobuilder 775784
      echo "You should only need it if you modified a '.texi' file, or"
rdobuilder 775784
      echo "any other file indirectly affecting the aspect of the manual."
rdobuilder 775784
      echo "You might want to install the Texinfo package:"
rdobuilder 775784
      echo "<$gnu_software_URL/texinfo/>"
rdobuilder 775784
      echo "The spurious makeinfo call might also be the consequence of"
rdobuilder 775784
      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
rdobuilder 775784
      echo "want to install GNU make:"
rdobuilder 775784
      echo "<$gnu_software_URL/make/>"
rdobuilder 775784
      ;;
rdobuilder 775784
    *)
rdobuilder 775784
      echo "You might have modified some files without having the proper"
rdobuilder 775784
      echo "tools for further handling them.  Check the 'README' file, it"
rdobuilder 775784
      echo "often tells you about the needed prerequisites for installing"
rdobuilder 775784
      echo "this package.  You may also peek at any GNU archive site, in"
rdobuilder 775784
      echo "case some other package contains this missing '$1' program."
rdobuilder 775784
      ;;
rdobuilder 775784
  esac
rdobuilder 775784
}
rdobuilder 775784
rdobuilder 775784
give_advice "$1" | sed -e '1s/^/WARNING: /' \
rdobuilder 775784
                       -e '2,$s/^/         /' >&2
rdobuilder 775784
rdobuilder 775784
# Propagate the correct exit status (expected to be 127 for a program
rdobuilder 775784
# not found, 63 for a program that failed due to version mismatch).
rdobuilder 775784
exit $st
rdobuilder 775784
rdobuilder 775784
# Local variables:
rdobuilder 775784
# eval: (add-hook 'write-file-hooks 'time-stamp)
rdobuilder 775784
# time-stamp-start: "scriptversion="
rdobuilder 775784
# time-stamp-format: "%:y-%02m-%02d.%02H"
rdobuilder 775784
# time-stamp-time-zone: "UTC"
rdobuilder 775784
# time-stamp-end: "; # UTC"
rdobuilder 775784
# End: