bc34d0abe81eda9e9b0f8e80e0ff1255fe44fcfa
[platform/upstream/bash.git] / lib / termcap / grot / configure
1 #!/bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated automatically using autoconf.
4 # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
21 #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
22 # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
23 # --with-PACKAGE unless this script has special code to handle it.
24
25
26 for arg
27 do
28   # Handle --exec-prefix with a space before the argument.
29   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
30   # Handle --host with a space before the argument.
31   elif test x$next_host = xyes; then next_host=
32   # Handle --prefix with a space before the argument.
33   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
34   # Handle --srcdir with a space before the argument.
35   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
36   else
37     case $arg in
38      # For backward compatibility, also recognize exact --exec_prefix.
39      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
40         exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
41      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
42         next_exec_prefix=yes ;;
43
44      -gas | --gas | --ga | --g) ;;
45
46      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
47      -host | --host | --hos | --ho | --h)
48         next_host=yes ;;
49
50      -nfp | --nfp | --nf) ;;
51
52      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
53         no_create=1 ;;
54
55      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
56         prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
57      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
58         next_prefix=yes ;;
59
60      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
61         srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
62      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
63         next_srcdir=yes ;;
64
65      -with-* | --with-*)
66        package=`echo $arg|sed 's/-*with-//'`
67        # Delete all the valid chars; see if any are left.
68        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
69          echo "configure: $package: invalid package name" >&2; exit 1
70        fi
71        eval "with_`echo $package|sed s/-/_/g`=1" ;;
72
73      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
74        verbose=yes ;;
75
76      *) ;;
77     esac
78   fi
79 done
80
81 trap 'rm -f conftest* core; exit 1' 1 3 15
82
83 rm -f conftest*
84 compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
85
86 # A filename unique to this package, relative to the directory that
87 # configure is in, which we can look for to find out if srcdir is correct.
88 unique_file=termcap.h
89
90 # Find the source files, if location was not specified.
91 if test -z "$srcdir"; then
92   srcdirdefaulted=yes
93   # Try the directory containing this script, then `..'.
94   prog=$0
95   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
96   test "X$confdir" = "X$prog" && confdir=.
97   srcdir=$confdir
98   if test ! -r $srcdir/$unique_file; then
99     srcdir=..
100   fi
101 fi
102 if test ! -r $srcdir/$unique_file; then
103   if test x$srcdirdefaulted = xyes; then
104     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
105   else
106     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
107   fi
108   exit 1
109 fi
110 # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
111 # But we can't avoid them for `..', to make subdirectories work.
112 case $srcdir in
113   .|/*|~*) ;;
114   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
115 esac
116
117 if test -z "$CC"; then
118   echo checking for gcc
119   saveifs="$IFS"; IFS="${IFS}:"
120   for dir in $PATH; do
121     test -z "$dir" && dir=.
122     if test -f $dir/gcc; then
123       CC="gcc"
124       break
125     fi
126   done
127   IFS="$saveifs"
128 fi
129 test -z "$CC" && CC="cc"
130
131 # Find out if we are using GNU C, under whatever name.
132 cat > conftest.c <<EOF
133 #ifdef __GNUC__
134   yes
135 #endif
136 EOF
137 ${CC-cc} -E conftest.c > conftest.out 2>&1
138 if egrep yes conftest.out >/dev/null 2>&1; then
139   GCC=1 # For later tests.
140 fi
141 rm -f conftest*
142
143 echo checking how to run the C preprocessor
144 if test -z "$CPP"; then
145   CPP='${CC-cc} -E'
146   cat > conftest.c <<EOF
147 #include <stdio.h>
148 EOF
149 err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
150 if test -z "$err"; then
151   :
152 else
153   CPP=/lib/cpp
154 fi
155 rm -f conftest*
156 fi
157
158 # Make sure to not get the incompatible SysV /etc/install and
159 # /usr/sbin/install, which might be in PATH before a BSD-like install,
160 # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
161 # or the AFS install, which mishandles nonexistent args.  (Sigh.)
162 if test -z "$INSTALL"; then
163   echo checking for install
164   saveifs="$IFS"; IFS="${IFS}:"
165   for dir in $PATH; do
166     test -z "$dir" && dir=.
167     case $dir in
168     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
169     *)
170       if test -f $dir/installbsd; then
171         INSTALL="$dir/installbsd -c" # OSF1
172         INSTALL_PROGRAM='$(INSTALL)'
173         INSTALL_DATA='$(INSTALL) -m 644'
174         break
175       fi
176       if test -f $dir/install; then
177         if grep dspmsg $dir/install >/dev/null 2>&1; then
178           : # AIX
179         else
180           INSTALL="$dir/install -c"
181           INSTALL_PROGRAM='$(INSTALL)'
182           INSTALL_DATA='$(INSTALL) -m 644'
183           break
184         fi
185       fi
186       ;;
187     esac
188   done
189   IFS="$saveifs"
190 fi
191 INSTALL=${INSTALL-cp}
192 INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
193 INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
194
195 for hdr in string.h
196 do
197 trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
198 echo checking for ${hdr}
199 cat > conftest.c <<EOF
200 #include <${hdr}>
201 EOF
202 err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
203 if test -z "$err"; then
204   {
205 test -n "$verbose" && \
206 echo '  defining' ${trhdr}
207 DEFS="$DEFS -D${trhdr}=1"
208 }
209
210 fi
211 rm -f conftest*
212 done
213
214 echo checking for unistd.h
215 cat > conftest.c <<EOF
216 #include <unistd.h>
217 EOF
218 err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
219 if test -z "$err"; then
220   {
221 test -n "$verbose" && \
222 echo '  defining' HAVE_UNISTD_H
223 DEFS="$DEFS -DHAVE_UNISTD_H=1"
224 }
225
226 fi
227 rm -f conftest*
228
229 echo checking for ANSI C header files
230 cat > conftest.c <<EOF
231 #include <stdlib.h>
232 #include <stdarg.h>
233 #include <string.h>
234 #include <float.h>
235 EOF
236 err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
237 if test -z "$err"; then
238   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
239 echo '#include <string.h>' > conftest.c
240 eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
241 if egrep "memchr" conftest.out >/dev/null 2>&1; then
242   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
243 cat > conftest.c <<EOF
244 #include <ctype.h>
245 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
246 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
247 #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
248 int main () { int i; for (i = 0; i < 256; i++)
249 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
250 exit (0); }
251
252 EOF
253 eval $compile
254 if test -s conftest && (./conftest; exit) 2>/dev/null; then
255   {
256 test -n "$verbose" && \
257 echo '  defining' STDC_HEADERS
258 DEFS="$DEFS -DSTDC_HEADERS=1"
259 }
260
261 fi
262 rm -f conftest*
263 fi
264 rm -f conftest*
265
266 fi
267 rm -f conftest*
268
269 if test -n "$prefix"; then
270   test -z "$exec_prefix" && exec_prefix='${prefix}'
271   prsub="s%^prefix\\([  ]*\\)=\\([      ]*\\).*$%prefix\\1=\\2$prefix%"
272 fi
273 if test -n "$exec_prefix"; then
274   prsub="$prsub
275 s%^exec_prefix\\([      ]*\\)=\\([      ]*\\).*$%\
276 exec_prefix\\1=\\2$exec_prefix%"
277 fi
278
279 trap 'rm -f config.status; exit 1' 1 3 15
280 echo creating config.status
281 rm -f config.status
282 cat > config.status <<EOF
283 #!/bin/sh
284 # Generated automatically by configure.
285 # Run this file to recreate the current configuration.
286 # This directory was configured as follows,
287 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
288 #
289 # $0 $*
290
291 for arg
292 do
293   case "\$arg" in
294     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
295     exec /bin/sh $0 $* ;;
296     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
297   esac
298 done
299
300 trap 'rm -f Makefile; exit 1' 1 3 15
301 PROGS='$PROGS'
302 CC='$CC'
303 CPP='$CPP'
304 INSTALL='$INSTALL'
305 INSTALL_PROGRAM='$INSTALL_PROGRAM'
306 INSTALL_DATA='$INSTALL_DATA'
307 LIBS='$LIBS'
308 srcdir='$srcdir'
309 DEFS='$DEFS'
310 prefix='$prefix'
311 exec_prefix='$exec_prefix'
312 prsub='$prsub'
313 EOF
314 cat >> config.status <<\EOF
315
316 top_srcdir=$srcdir
317 for file in .. Makefile; do if [ "x$file" != "x.." ]; then
318   srcdir=$top_srcdir
319   # Remove last slash and all that follows it.  Not all systems have dirname.
320   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
321   if test "$dir" != "$file"; then
322     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
323     test ! -d $dir && mkdir $dir
324   fi
325   echo creating $file
326   rm -f $file
327   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
328   sed -e "
329 $prsub
330 s%@PROGS@%$PROGS%g
331 s%@CC@%$CC%g
332 s%@CPP@%$CPP%g
333 s%@INSTALL@%$INSTALL%g
334 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
335 s%@INSTALL_DATA@%$INSTALL_DATA%g
336 s%@LIBS@%$LIBS%g
337 s%@srcdir@%$srcdir%g
338 s%@DEFS@%$DEFS%
339 " $top_srcdir/${file}.in >> $file
340 fi; done
341
342 exit 0
343 EOF
344 chmod +x config.status
345 test -n "$no_create" || ./config.status
346