Statistics
| Revision:

root / missing @ 28

History | View | Annotate | Download (6.3 kB)

1 1 hiro
#! /bin/sh
2 1 hiro
# Common stub for a few missing GNU programs while installing.
3 1 hiro
# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
4 1 hiro
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
5 1 hiro
6 1 hiro
# This program is free software; you can redistribute it and/or modify
7 1 hiro
# it under the terms of the GNU General Public License as published by
8 1 hiro
# the Free Software Foundation; either version 2, or (at your option)
9 1 hiro
# any later version.
10 1 hiro
11 1 hiro
# This program is distributed in the hope that it will be useful,
12 1 hiro
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13 1 hiro
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 1 hiro
# GNU General Public License for more details.
15 1 hiro
16 1 hiro
# You should have received a copy of the GNU General Public License
17 1 hiro
# along with this program; if not, write to the Free Software
18 1 hiro
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 1 hiro
# 02111-1307, USA.
20 1 hiro
21 1 hiro
if test $# -eq 0; then
22 1 hiro
  echo 1>&2 "Try \`$0 --help' for more information"
23 1 hiro
  exit 1
24 1 hiro
fi
25 1 hiro
26 1 hiro
# In the cases where this matters, `missing' is being run in the
27 1 hiro
# srcdir already.
28 1 hiro
if test -f configure.in; then
29 1 hiro
  configure_ac=configure.ac
30 1 hiro
else
31 1 hiro
  configure_ac=configure.in
32 1 hiro
fi
33 1 hiro
34 1 hiro
case "$1" in
35 1 hiro
36 1 hiro
  -h|--h|--he|--hel|--help)
37 1 hiro
    echo "\
38 1 hiro
$0 [OPTION]... PROGRAM [ARGUMENT]...
39 1 hiro
40 1 hiro
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
41 1 hiro
error status if there is no known handling for PROGRAM.
42 1 hiro
43 1 hiro
Options:
44 1 hiro
  -h, --help      display this help and exit
45 1 hiro
  -v, --version   output version information and exit
46 1 hiro
47 1 hiro
Supported PROGRAM values:
48 1 hiro
  aclocal      touch file \`aclocal.m4'
49 1 hiro
  autoconf     touch file \`configure'
50 1 hiro
  autoheader   touch file \`config.h.in'
51 1 hiro
  automake     touch all \`Makefile.in' files
52 1 hiro
  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
53 1 hiro
  flex         create \`lex.yy.c', if possible, from existing .c
54 1 hiro
  lex          create \`lex.yy.c', if possible, from existing .c
55 1 hiro
  makeinfo     touch the output file
56 1 hiro
  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
57 1 hiro
    ;;
58 1 hiro
59 1 hiro
  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
60 1 hiro
    echo "missing - GNU libit 0.0"
61 1 hiro
    ;;
62 1 hiro
63 1 hiro
  -*)
64 1 hiro
    echo 1>&2 "$0: Unknown \`$1' option"
65 1 hiro
    echo 1>&2 "Try \`$0 --help' for more information"
66 1 hiro
    exit 1
67 1 hiro
    ;;
68 1 hiro
69 1 hiro
  aclocal*)
70 1 hiro
    echo 1>&2 "\
71 1 hiro
WARNING: \`$1' is missing on your system.  You should only need it if
72 1 hiro
         you modified \`acinclude.m4' or \`$configure_ac'.  You might want
73 1 hiro
         to install the \`Automake' and \`Perl' packages.  Grab them from
74 1 hiro
         any GNU archive site."
75 1 hiro
    touch aclocal.m4
76 1 hiro
    ;;
77 1 hiro
78 1 hiro
  autoconf)
79 1 hiro
    echo 1>&2 "\
80 1 hiro
WARNING: \`$1' is missing on your system.  You should only need it if
81 1 hiro
         you modified \`$configure_ac'.  You might want to install the
82 1 hiro
         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
83 1 hiro
         archive site."
84 1 hiro
    touch configure
85 1 hiro
    ;;
86 1 hiro
87 1 hiro
  autoheader)
88 1 hiro
    echo 1>&2 "\
89 1 hiro
WARNING: \`$1' is missing on your system.  You should only need it if
90 1 hiro
         you modified \`acconfig.h' or \`$configure_ac'.  You might want
91 1 hiro
         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
92 1 hiro
         from any GNU archive site."
93 1 hiro
    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac`
94 1 hiro
    test -z "$files" && files="config.h"
95 1 hiro
    touch_files=
96 1 hiro
    for f in $files; do
97 1 hiro
      case "$f" in
98 1 hiro
      *:*) touch_files="$touch_files "`echo "$f" |
99 1 hiro
				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
100 1 hiro
      *) touch_files="$touch_files $f.in";;
101 1 hiro
      esac
102 1 hiro
    done
103 1 hiro
    touch $touch_files
104 1 hiro
    ;;
105 1 hiro
106 1 hiro
  automake*)
107 1 hiro
    echo 1>&2 "\
108 1 hiro
WARNING: \`$1' is missing on your system.  You should only need it if
109 1 hiro
         you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'.
110 1 hiro
         You might want to install the \`Automake' and \`Perl' packages.
111 1 hiro
         Grab them from any GNU archive site."
112 1 hiro
    find . -type f -name Makefile.am -print |
113 1 hiro
	   sed 's/\.am$/.in/' |
114 1 hiro
	   while read f; do touch "$f"; done
115 1 hiro
    ;;
116 1 hiro
117 1 hiro
  bison|yacc)
118 1 hiro
    echo 1>&2 "\
119 1 hiro
WARNING: \`$1' is missing on your system.  You should only need it if
120 1 hiro
         you modified a \`.y' file.  You may need the \`Bison' package
121 1 hiro
         in order for those modifications to take effect.  You can get
122 1 hiro
         \`Bison' from any GNU archive site."
123 1 hiro
    rm -f y.tab.c y.tab.h
124 1 hiro
    if [ $# -ne 1 ]; then
125 1 hiro
        eval LASTARG="\${$#}"
126 1 hiro
	case "$LASTARG" in
127 1 hiro
	*.y)
128 1 hiro
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
129 1 hiro
	    if [ -f "$SRCFILE" ]; then
130 1 hiro
	         cp "$SRCFILE" y.tab.c
131 1 hiro
	    fi
132 1 hiro
	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
133 1 hiro
	    if [ -f "$SRCFILE" ]; then
134 1 hiro
	         cp "$SRCFILE" y.tab.h
135 1 hiro
	    fi
136 1 hiro
	  ;;
137 1 hiro
	esac
138 1 hiro
    fi
139 1 hiro
    if [ ! -f y.tab.h ]; then
140 1 hiro
	echo >y.tab.h
141 1 hiro
    fi
142 1 hiro
    if [ ! -f y.tab.c ]; then
143 1 hiro
	echo 'main() { return 0; }' >y.tab.c
144 1 hiro
    fi
145 1 hiro
    ;;
146 1 hiro
147 1 hiro
  lex|flex)
148 1 hiro
    echo 1>&2 "\
149 1 hiro
WARNING: \`$1' is missing on your system.  You should only need it if
150 1 hiro
         you modified a \`.l' file.  You may need the \`Flex' package
151 1 hiro
         in order for those modifications to take effect.  You can get
152 1 hiro
         \`Flex' from any GNU archive site."
153 1 hiro
    rm -f lex.yy.c
154 1 hiro
    if [ $# -ne 1 ]; then
155 1 hiro
        eval LASTARG="\${$#}"
156 1 hiro
	case "$LASTARG" in
157 1 hiro
	*.l)
158 1 hiro
	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
159 1 hiro
	    if [ -f "$SRCFILE" ]; then
160 1 hiro
	         cp "$SRCFILE" lex.yy.c
161 1 hiro
	    fi
162 1 hiro
	  ;;
163 1 hiro
	esac
164 1 hiro
    fi
165 1 hiro
    if [ ! -f lex.yy.c ]; then
166 1 hiro
	echo 'main() { return 0; }' >lex.yy.c
167 1 hiro
    fi
168 1 hiro
    ;;
169 1 hiro
170 1 hiro
  makeinfo)
171 1 hiro
    echo 1>&2 "\
172 1 hiro
WARNING: \`$1' is missing on your system.  You should only need it if
173 1 hiro
         you modified a \`.texi' or \`.texinfo' file, or any other file
174 1 hiro
         indirectly affecting the aspect of the manual.  The spurious
175 1 hiro
         call might also be the consequence of using a buggy \`make' (AIX,
176 1 hiro
         DU, IRIX).  You might want to install the \`Texinfo' package or
177 1 hiro
         the \`GNU make' package.  Grab either from any GNU archive site."
178 1 hiro
    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
179 1 hiro
    if test -z "$file"; then
180 1 hiro
      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
181 1 hiro
      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
182 1 hiro
    fi
183 1 hiro
    touch $file
184 1 hiro
    ;;
185 1 hiro
186 1 hiro
  *)
187 1 hiro
    echo 1>&2 "\
188 1 hiro
WARNING: \`$1' is needed, and you do not seem to have it handy on your
189 1 hiro
         system.  You might have modified some files without having the
190 1 hiro
         proper tools for further handling them.  Check the \`README' file,
191 1 hiro
         it often tells you about the needed prerequirements for installing
192 1 hiro
         this package.  You may also peek at any GNU archive site, in case
193 1 hiro
         some other package would contain this missing \`$1' program."
194 1 hiro
    exit 1
195 1 hiro
    ;;
196 1 hiro
esac
197 1 hiro
198 1 hiro
exit 0