172445Sassar#! /bin/sh
272445Sassar# Common stub for a few missing GNU programs while installing.
372445Sassar# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
472445Sassar# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
572445Sassar
672445Sassar# This program is free software; you can redistribute it and/or modify
772445Sassar# it under the terms of the GNU General Public License as published by
872445Sassar# the Free Software Foundation; either version 2, or (at your option)
972445Sassar# any later version.
1072445Sassar
1172445Sassar# This program is distributed in the hope that it will be useful,
1272445Sassar# but WITHOUT ANY WARRANTY; without even the implied warranty of
1372445Sassar# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1472445Sassar# GNU General Public License for more details.
1572445Sassar
1672445Sassar# You should have received a copy of the GNU General Public License
1772445Sassar# along with this program; if not, write to the Free Software
1872445Sassar# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1972445Sassar# 02111-1307, USA.
2072445Sassar
2172445Sassarif test $# -eq 0; then
2272445Sassar  echo 1>&2 "Try \`$0 --help' for more information"
2372445Sassar  exit 1
2472445Sassarfi
2572445Sassar
2672445Sassarcase "$1" in
2772445Sassar
2872445Sassar  -h|--h|--he|--hel|--help)
2972445Sassar    echo "\
3072445Sassar$0 [OPTION]... PROGRAM [ARGUMENT]...
3172445Sassar
3272445SassarHandle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
3372445Sassarerror status if there is no known handling for PROGRAM.
3472445Sassar
3572445SassarOptions:
3672445Sassar  -h, --help      display this help and exit
3772445Sassar  -v, --version   output version information and exit
3872445Sassar
3972445SassarSupported PROGRAM values:
4072445Sassar  aclocal      touch file \`aclocal.m4'
4172445Sassar  autoconf     touch file \`configure'
4272445Sassar  autoheader   touch file \`config.h.in'
4372445Sassar  automake     touch all \`Makefile.in' files
4472445Sassar  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
4572445Sassar  flex         create \`lex.yy.c', if possible, from existing .c
4672445Sassar  lex          create \`lex.yy.c', if possible, from existing .c
4772445Sassar  makeinfo     touch the output file
4872445Sassar  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
4972445Sassar    ;;
5072445Sassar
5172445Sassar  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
5272445Sassar    echo "missing - GNU libit 0.0"
5372445Sassar    ;;
5472445Sassar
5572445Sassar  -*)
5672445Sassar    echo 1>&2 "$0: Unknown \`$1' option"
5772445Sassar    echo 1>&2 "Try \`$0 --help' for more information"
5872445Sassar    exit 1
5972445Sassar    ;;
6072445Sassar
6172445Sassar  aclocal)
6272445Sassar    echo 1>&2 "\
6372445SassarWARNING: \`$1' is missing on your system.  You should only need it if
6472445Sassar         you modified \`acinclude.m4' or \`configure.in'.  You might want
6572445Sassar         to install the \`Automake' and \`Perl' packages.  Grab them from
6672445Sassar         any GNU archive site."
6772445Sassar    touch aclocal.m4
6872445Sassar    ;;
6972445Sassar
7072445Sassar  autoconf)
7172445Sassar    echo 1>&2 "\
7272445SassarWARNING: \`$1' is missing on your system.  You should only need it if
7372445Sassar         you modified \`configure.in'.  You might want to install the
7472445Sassar         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
7572445Sassar         archive site."
7672445Sassar    touch configure
7772445Sassar    ;;
7872445Sassar
7972445Sassar  autoheader)
8072445Sassar    echo 1>&2 "\
8172445SassarWARNING: \`$1' is missing on your system.  You should only need it if
8272445Sassar         you modified \`acconfig.h' or \`configure.in'.  You might want
8372445Sassar         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
8472445Sassar         from any GNU archive site."
8572445Sassar    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
8672445Sassar    test -z "$files" && files="config.h"
8772445Sassar    touch_files=
8872445Sassar    for f in $files; do
8972445Sassar      case "$f" in
9072445Sassar      *:*) touch_files="$touch_files "`echo "$f" |
9172445Sassar				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
9272445Sassar      *) touch_files="$touch_files $f.in";;
9372445Sassar      esac
9472445Sassar    done
9572445Sassar    touch $touch_files
9672445Sassar    ;;
9772445Sassar
9872445Sassar  automake)
9972445Sassar    echo 1>&2 "\
10072445SassarWARNING: \`$1' is missing on your system.  You should only need it if
10172445Sassar         you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
10272445Sassar         You might want to install the \`Automake' and \`Perl' packages.
10372445Sassar         Grab them from any GNU archive site."
10472445Sassar    find . -type f -name Makefile.am -print |
10572445Sassar	   sed 's/\.am$/.in/' |
10672445Sassar	   while read f; do touch "$f"; done
10772445Sassar    ;;
10872445Sassar
10972445Sassar  bison|yacc)
11072445Sassar    echo 1>&2 "\
11172445SassarWARNING: \`$1' is missing on your system.  You should only need it if
11272445Sassar         you modified a \`.y' file.  You may need the \`Bison' package
11372445Sassar         in order for those modifications to take effect.  You can get
11472445Sassar         \`Bison' from any GNU archive site."
11572445Sassar    rm -f y.tab.c y.tab.h
11672445Sassar    if [ $# -ne 1 ]; then
11772445Sassar        eval LASTARG="\${$#}"
11872445Sassar	case "$LASTARG" in
11972445Sassar	*.y)
12072445Sassar	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
12172445Sassar	    if [ -f "$SRCFILE" ]; then
12272445Sassar	         cp "$SRCFILE" y.tab.c
12372445Sassar	    fi
12472445Sassar	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
12572445Sassar	    if [ -f "$SRCFILE" ]; then
12672445Sassar	         cp "$SRCFILE" y.tab.h
12772445Sassar	    fi
12872445Sassar	  ;;
12972445Sassar	esac
13072445Sassar    fi
13172445Sassar    if [ ! -f y.tab.h ]; then
13272445Sassar	echo >y.tab.h
13372445Sassar    fi
13472445Sassar    if [ ! -f y.tab.c ]; then
13572445Sassar	echo 'main() { return 0; }' >y.tab.c
13672445Sassar    fi
13772445Sassar    ;;
13872445Sassar
13972445Sassar  lex|flex)
14072445Sassar    echo 1>&2 "\
14172445SassarWARNING: \`$1' is missing on your system.  You should only need it if
14272445Sassar         you modified a \`.l' file.  You may need the \`Flex' package
14372445Sassar         in order for those modifications to take effect.  You can get
14472445Sassar         \`Flex' from any GNU archive site."
14572445Sassar    rm -f lex.yy.c
14672445Sassar    if [ $# -ne 1 ]; then
14772445Sassar        eval LASTARG="\${$#}"
14872445Sassar	case "$LASTARG" in
14972445Sassar	*.l)
15072445Sassar	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
15172445Sassar	    if [ -f "$SRCFILE" ]; then
15272445Sassar	         cp "$SRCFILE" lex.yy.c
15372445Sassar	    fi
15472445Sassar	  ;;
15572445Sassar	esac
15672445Sassar    fi
15772445Sassar    if [ ! -f lex.yy.c ]; then
15872445Sassar	echo 'main() { return 0; }' >lex.yy.c
15972445Sassar    fi
16072445Sassar    ;;
16172445Sassar
16272445Sassar  makeinfo)
16372445Sassar    echo 1>&2 "\
16472445SassarWARNING: \`$1' is missing on your system.  You should only need it if
16572445Sassar         you modified a \`.texi' or \`.texinfo' file, or any other file
16672445Sassar         indirectly affecting the aspect of the manual.  The spurious
16772445Sassar         call might also be the consequence of using a buggy \`make' (AIX,
16872445Sassar         DU, IRIX).  You might want to install the \`Texinfo' package or
16972445Sassar         the \`GNU make' package.  Grab either from any GNU archive site."
17072445Sassar    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
17172445Sassar    if test -z "$file"; then
17272445Sassar      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
17372445Sassar      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
17472445Sassar    fi
17572445Sassar    touch $file
17672445Sassar    ;;
17772445Sassar
17872445Sassar  *)
17972445Sassar    echo 1>&2 "\
18072445SassarWARNING: \`$1' is needed, and you do not seem to have it handy on your
18172445Sassar         system.  You might have modified some files without having the
18272445Sassar         proper tools for further handling them.  Check the \`README' file,
18372445Sassar         it often tells you about the needed prerequirements for installing
18472445Sassar         this package.  You may also peek at any GNU archive site, in case
18572445Sassar         some other package would contain this missing \`$1' program."
18672445Sassar    exit 1
18772445Sassar    ;;
18872445Sassaresac
18972445Sassar
19072445Sassarexit 0
191