Blame autotools/missing

Packit 64f477
#! /bin/sh
Packit 64f477
# Common stub for a few missing GNU programs while installing.
Packit 64f477
# Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
Packit 64f477
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
Packit 64f477
Packit 64f477
# This program is free software; you can redistribute it and/or modify
Packit 64f477
# it under the terms of the GNU General Public License as published by
Packit 64f477
# the Free Software Foundation; either version 2, or (at your option)
Packit 64f477
# any later version.
Packit 64f477
Packit 64f477
# This program is distributed in the hope that it will be useful,
Packit 64f477
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 64f477
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 64f477
# GNU General Public License for more details.
Packit 64f477
Packit 64f477
# You should have received a copy of the GNU General Public License
Packit 64f477
# along with this program; if not, write to the Free Software
Packit 64f477
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
Packit 64f477
# 02111-1307, USA.
Packit 64f477
Packit 64f477
if test $# -eq 0; then
Packit 64f477
  echo 1>&2 "Try \`$0 --help' for more information"
Packit 64f477
  exit 1
Packit 64f477
fi
Packit 64f477
Packit 64f477
# In the cases where this matters, `missing' is being run in the
Packit 64f477
# srcdir already.
Packit 64f477
if test -f configure.in; then
Packit 64f477
  configure_ac=configure.ac
Packit 64f477
else
Packit 64f477
  configure_ac=configure.in
Packit 64f477
fi
Packit 64f477
Packit 64f477
case "$1" in
Packit 64f477
Packit 64f477
  -h|--h|--he|--hel|--help)
Packit 64f477
    echo "\
Packit 64f477
$0 [OPTION]... PROGRAM [ARGUMENT]...
Packit 64f477
Packit 64f477
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
Packit 64f477
error status if there is no known handling for PROGRAM.
Packit 64f477
Packit 64f477
Options:
Packit 64f477
  -h, --help      display this help and exit
Packit 64f477
  -v, --version   output version information and exit
Packit 64f477
Packit 64f477
Supported PROGRAM values:
Packit 64f477
  aclocal      touch file \`aclocal.m4'
Packit 64f477
  autoconf     touch file \`configure'
Packit 64f477
  autoheader   touch file \`config.h.in'
Packit 64f477
  automake     touch all \`Makefile.in' files
Packit 64f477
  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
Packit 64f477
  flex         create \`lex.yy.c', if possible, from existing .c
Packit 64f477
  lex          create \`lex.yy.c', if possible, from existing .c
Packit 64f477
  makeinfo     touch the output file
Packit 64f477
  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
Packit 64f477
    echo "missing - GNU libit 0.0"
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  -*)
Packit 64f477
    echo 1>&2 "$0: Unknown \`$1' option"
Packit 64f477
    echo 1>&2 "Try \`$0 --help' for more information"
Packit 64f477
    exit 1
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  aclocal)
Packit 64f477
    echo 1>&2 "\
Packit 64f477
WARNING: \`$1' is missing on your system.  You should only need it if
Packit 64f477
         you modified \`acinclude.m4' or \`$configure_ac'.  You might want
Packit 64f477
         to install the \`Automake' and \`Perl' packages.  Grab them from
Packit 64f477
         any GNU archive site."
Packit 64f477
    touch aclocal.m4
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  autoconf)
Packit 64f477
    echo 1>&2 "\
Packit 64f477
WARNING: \`$1' is missing on your system.  You should only need it if
Packit 64f477
         you modified \`$configure_ac'.  You might want to install the
Packit 64f477
         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
Packit 64f477
         archive site."
Packit 64f477
    touch configure
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  autoheader)
Packit 64f477
    echo 1>&2 "\
Packit 64f477
WARNING: \`$1' is missing on your system.  You should only need it if
Packit 64f477
         you modified \`acconfig.h' or \`$configure_ac'.  You might want
Packit 64f477
         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
Packit 64f477
         from any GNU archive site."
Packit 64f477
    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac`
Packit 64f477
    test -z "$files" && files="config.h"
Packit 64f477
    touch_files=
Packit 64f477
    for f in $files; do
Packit 64f477
      case "$f" in
Packit 64f477
      *:*) touch_files="$touch_files "`echo "$f" |
Packit 64f477
				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
Packit 64f477
      *) touch_files="$touch_files $f.in";;
Packit 64f477
      esac
Packit 64f477
    done
Packit 64f477
    touch $touch_files
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  automake)
Packit 64f477
    echo 1>&2 "\
Packit 64f477
WARNING: \`$1' is missing on your system.  You should only need it if
Packit 64f477
         you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'.
Packit 64f477
         You might want to install the \`Automake' and \`Perl' packages.
Packit 64f477
         Grab them from any GNU archive site."
Packit 64f477
    find . -type f -name Makefile.am -print |
Packit 64f477
	   sed 's/\.am$/.in/' |
Packit 64f477
	   while read f; do touch "$f"; done
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  bison|yacc)
Packit 64f477
    echo 1>&2 "\
Packit 64f477
WARNING: \`$1' is missing on your system.  You should only need it if
Packit 64f477
         you modified a \`.y' file.  You may need the \`Bison' package
Packit 64f477
         in order for those modifications to take effect.  You can get
Packit 64f477
         \`Bison' from any GNU archive site."
Packit 64f477
    rm -f y.tab.c y.tab.h
Packit 64f477
    if [ $# -ne 1 ]; then
Packit 64f477
        eval LASTARG="\${$#}"
Packit 64f477
	case "$LASTARG" in
Packit 64f477
	*.y)
Packit 64f477
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
Packit 64f477
	    if [ -f "$SRCFILE" ]; then
Packit 64f477
	         cp "$SRCFILE" y.tab.c
Packit 64f477
	    fi
Packit 64f477
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
Packit 64f477
	    if [ -f "$SRCFILE" ]; then
Packit 64f477
	         cp "$SRCFILE" y.tab.h
Packit 64f477
	    fi
Packit 64f477
	  ;;
Packit 64f477
	esac
Packit 64f477
    fi
Packit 64f477
    if [ ! -f y.tab.h ]; then
Packit 64f477
	echo >y.tab.h
Packit 64f477
    fi
Packit 64f477
    if [ ! -f y.tab.c ]; then
Packit 64f477
	echo 'main() { return 0; }' >y.tab.c
Packit 64f477
    fi
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  lex|flex)
Packit 64f477
    echo 1>&2 "\
Packit 64f477
WARNING: \`$1' is missing on your system.  You should only need it if
Packit 64f477
         you modified a \`.l' file.  You may need the \`Flex' package
Packit 64f477
         in order for those modifications to take effect.  You can get
Packit 64f477
         \`Flex' from any GNU archive site."
Packit 64f477
    rm -f lex.yy.c
Packit 64f477
    if [ $# -ne 1 ]; then
Packit 64f477
        eval LASTARG="\${$#}"
Packit 64f477
	case "$LASTARG" in
Packit 64f477
	*.l)
Packit 64f477
	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
Packit 64f477
	    if [ -f "$SRCFILE" ]; then
Packit 64f477
	         cp "$SRCFILE" lex.yy.c
Packit 64f477
	    fi
Packit 64f477
	  ;;
Packit 64f477
	esac
Packit 64f477
    fi
Packit 64f477
    if [ ! -f lex.yy.c ]; then
Packit 64f477
	echo 'main() { return 0; }' >lex.yy.c
Packit 64f477
    fi
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  makeinfo)
Packit 64f477
    echo 1>&2 "\
Packit 64f477
WARNING: \`$1' is missing on your system.  You should only need it if
Packit 64f477
         you modified a \`.texi' or \`.texinfo' file, or any other file
Packit 64f477
         indirectly affecting the aspect of the manual.  The spurious
Packit 64f477
         call might also be the consequence of using a buggy \`make' (AIX,
Packit 64f477
         DU, IRIX).  You might want to install the \`Texinfo' package or
Packit 64f477
         the \`GNU make' package.  Grab either from any GNU archive site."
Packit 64f477
    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
Packit 64f477
    if test -z "$file"; then
Packit 64f477
      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
Packit 64f477
      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
Packit 64f477
    fi
Packit 64f477
    touch $file
Packit 64f477
    ;;
Packit 64f477
Packit 64f477
  *)
Packit 64f477
    echo 1>&2 "\
Packit 64f477
WARNING: \`$1' is needed, and you do not seem to have it handy on your
Packit 64f477
         system.  You might have modified some files without having the
Packit 64f477
         proper tools for further handling them.  Check the \`README' file,
Packit 64f477
         it often tells you about the needed prerequirements for installing
Packit 64f477
         this package.  You may also peek at any GNU archive site, in case
Packit 64f477
         some other package would contain this missing \`$1' program."
Packit 64f477
    exit 1
Packit 64f477
    ;;
Packit 64f477
esac
Packit 64f477
Packit 64f477
exit 0