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.
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)
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.
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.
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.
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=
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 ;;
44 -gas | --gas | --ga | --g) ;;
46 -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
47 -host | --host | --hos | --ho | --h)
50 -nfp | --nfp | --nf) ;;
52 -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
55 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
56 prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
57 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
60 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
61 srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
62 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
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
71 eval "with_`echo $package|sed s/-/_/g`=1" ;;
73 -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
81 trap 'rm -f conftest* core; exit 1' 1 3 15
83 # Needed for some versions of `tr' so that character classes in `[]' work.
84 if test "${LANG+set}" = "set" ; then
91 compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
93 # A filename unique to this package, relative to the directory that
94 # configure is in, which we can look for to find out if srcdir is correct.
95 unique_file=Makefile.in
97 # Find the source files, if location was not specified.
98 if test -z "$srcdir"; then
100 # Try the directory containing this script, then `..'.
102 confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
103 test "X$confdir" = "X$prog" && confdir=.
105 if test ! -r $srcdir/$unique_file; then
109 if test ! -r $srcdir/$unique_file; then
110 if test x$srcdirdefaulted = xyes; then
111 echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
113 echo "configure: Can not find sources in \`${srcdir}'." 1>&2
118 # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
119 # But we can't avoid them for `..', to make subdirectories work.
122 *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
125 if test -z "$CC"; then
126 # Extract the first word of `gcc', so it can be a program name with args.
127 set dummy gcc; word=$2
128 echo checking for $word
129 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
131 test -z "$dir" && dir=.
132 if test -f $dir/$word; then
139 test -z "$CC" && CC="cc"
140 test -n "$CC" -a -n "$verbose" && echo " setting CC to $CC"
142 # Find out if we are using GNU C, under whatever name.
143 cat > conftest.c <<EOF
148 ${CC-cc} -E conftest.c > conftest.out 2>&1
149 if egrep yes conftest.out >/dev/null 2>&1; then
150 GCC=1 # For later tests.
151 CFLAGS="${CFLAGS--O}"
155 if test -z "$BISON"; then
156 echo checking for bison
157 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
159 test -z "$dir" && dir=.
160 if test -f $dir/bison; then
168 test -n "$BISON" -a -n "$verbose" && echo " setting BISON to $BISON"
170 if test -z "$FLEX"; then
171 echo checking for flex
172 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
174 test -z "$dir" && dir=.
175 if test -f $dir/flex; then
183 test -n "$FLEX" -a -n "$verbose" && echo " setting FLEX to $FLEX"
185 echo checking how to run the C preprocessor
186 if test -z "$CPP"; then
188 cat > conftest.c <<EOF
191 err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
192 if test -z "$err"; then
200 echo 'checking if pre-processor defined __STDC__'
201 echo '# ifndef __STDC__' > conftest.c
202 echo '# error "No STDC"' >> conftest.c
203 echo 'int main (void) { exit (0); }' >> conftest.c
204 eval "$CPP conftest.c > conftest.out 2>&1"
205 if egrep "No STDC" conftest.out >/dev/null 2>&1; then
206 test -n "$verbose" && echo ' __STDC__ not defined'
207 DEFS="$DEFS -DNEED_STDC"
210 echo 'checking for optimization levels'
211 echo 'int main (void) { exit (0); }' > conftest.c
212 eval "$CC -O -o conftest conftest.c > conftest.out 2>&1"
213 if egrep "O" conftest.out >/dev/null 2>&1; then
214 test -n "$verbose" && echo ' No optimization flags found'
217 eval "$CC -O2 -o conftest conftest.c > conftest.out 2>&1"
218 if egrep "O2" conftest.out >/dev/null 2>&1; then
219 test -n "$verbose" && echo ' Optimization: -O'
222 eval "$CC -O3 -o conftest conftest.c > conftest.out 2>&1"
223 if egrep "O3" conftest.out >/dev/null 2>&1; then
224 test -n "$verbose" && echo ' Optimization: -O2'
227 if egrep "O4" conftest.out >/dev/null 2>&1; then
228 test -n "$verbose" && echo ' Optimization: -O3'
231 test -n "$verbose" && echo ' Optimization: -O4'
233 # bug in gcc makes -O3 and -O4 bad - bug in compiling parser
240 # Make sure to not get the incompatible SysV /etc/install and
241 # /usr/sbin/install, which might be in PATH before a BSD-like install,
242 # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
243 # or the AFS install, which mishandles nonexistent args, or
244 # /usr/ucb/install on SVR4, which tries to use the nonexistent group
245 # `staff'. On most BSDish systems install is in /usr/bin, not /usr/ucb
247 if test "z${INSTALL}" = "z" ; then
248 echo checking for install
249 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
251 test -z "$dir" && dir=.
253 /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
255 if test -f $dir/installbsd; then
256 INSTALL="$dir/installbsd -c" # OSF1
257 INSTALL_PROGRAM='$(INSTALL)'
258 INSTALL_DATA='$(INSTALL) -m 644'
261 if test -f $dir/install; then
262 if grep dspmsg $dir/install >/dev/null 2>&1; then
265 INSTALL="$dir/install -c"
266 INSTALL_PROGRAM='$(INSTALL)'
267 INSTALL_DATA='$(INSTALL) -m 644'
276 INSTALL=${INSTALL-cp}
277 INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
278 INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
280 echo checking for ANSI C header files
281 cat > conftest.c <<EOF
287 err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
288 if test -z "$err"; then
289 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
290 echo '#include <string.h>' > conftest.c
291 eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
292 if egrep "memchr" conftest.out >/dev/null 2>&1; then
293 # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
294 cat > conftest.c <<EOF
296 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
297 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
298 #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
299 int main () { int i; for (i = 0; i < 256; i++)
300 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
305 if test -s conftest && (./conftest; exit) 2>/dev/null; then
307 test -n "$verbose" && \
308 echo ' defining' STDC_HEADERS
309 DEFS="$DEFS -DSTDC_HEADERS=1"
320 echo checking for stdarg.h
321 cat > conftest.c <<EOF
324 err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
325 if test -z "$err"; then
329 test -n "$verbose" && \
330 echo ' defining' USEVARARGS
331 DEFS="$DEFS -DUSEVARARGS=1"
336 echo checking for string.h
337 cat > conftest.c <<EOF
340 err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
341 if test -z "$err"; then
345 test -n "$verbose" && \
346 echo ' defining' NO_STRING_H
347 DEFS="$DEFS -DNO_STRING_H=1"
353 echo checking for stdlib.h
354 cat > conftest.c <<EOF
357 err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
358 if test -z "$err"; then
362 test -n "$verbose" && \
363 echo ' defining' NO_STDLIB_H
364 DEFS="$DEFS -DNO_STDLIB_H=1"
370 echo checking for size_t in sys/types.h
371 echo '#include <sys/types.h>' > conftest.c
372 eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
373 if egrep "size_t" conftest.out >/dev/null 2>&1; then
377 test -n "$verbose" && \
378 echo ' defining' size_t to be 'unsigned'
379 DEFS="$DEFS -Dsize_t=unsigned"
385 echo '#include <sys/types.h>' > conftest.c
386 eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
387 if egrep "off_t" conftest.out >/dev/null 2>&1; then
391 test -n "$verbose" && \
392 echo ' defining' NO_OFF_T
393 DEFS="$DEFS -DNO_OFF_T=1"
397 echo checking for EXIT_SUCCESS
398 cat > conftest.c <<EOF
400 int main (void) { return EXIT_SUCCESS; }
402 err=`eval "($CC -c \$DEFS conftest.c >/dev/null) 2>&1"`
403 if test -z "$err"; then
407 test -n "$verbose" && \
408 echo ' no EXIT_SUCCESS'
409 DEFS="$DEFS -DEXIT_SUCCESS=0"
413 echo checking for EXIT_FAILURE
414 cat > conftest.c <<EOF
416 int main (void) { return EXIT_FAILURE; }
418 err=`eval "($CC -c \$DEFS conftest.c >/dev/null) 2>&1"`
419 if test -z "$err"; then
423 test -n "$verbose" && \
424 echo ' no EXIT_FAILURE'
425 DEFS="$DEFS -DEXIT_FAILURE=-1"
429 echo checking for -ll
430 echo 'int main (void) { exit (0); }' > conftest.c
431 err=`eval "($CC conftest.c -o conftest -ll >/dev/null) 2>&1"`
432 if test -z "$err"; then
435 echo ' No -ll...trying -lfl'
436 err=`eval "($CC conftest.c -o conftest -lfl >/dev/null) 2>&1"`
437 if test -z "$err"; then
441 echo '*** No lex or flex library found. Must have -ll or -lfl to build lclint.'
442 echo '*** If this is installed on your system, try editing the configure
443 script to use the correct flags to locate this file.'
451 echo setting current directory to $cwdir
457 echo " chose installation directory prefix ${prefix}"
458 echo " will install binaries in ${prefix}/bin"
459 echo " will install libraries in ${prefix}/lib"
460 echo " will install imports in ${prefix}/imports"
461 echo " will install emacs files in ${prefix}/emacs"
462 echo " edit Makefile to change installation directories"
465 if test -z "$G" -a -n "$prefix" -a -f $prefix/bin/gznew; then
468 if test -z "$ZCAT"; then
469 if test -n "$prefix" -a -f $prefix/bin/gzcat; then
475 if test -n "$prefix"; then
476 test -z "$exec_prefix" && exec_prefix='${prefix}'
477 prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
479 if test -n "$exec_prefix"; then
481 s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\
482 exec_prefix\\1=\\2$exec_prefix%"
484 cat >conftest.def <<EOF
487 escape_ampersand_and_backslash='s%[&\\]%\\&%g'
488 DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
491 trap 'rm -f config.status; exit 1' 1 3 15
492 echo creating config.status
494 cat > config.status <<EOF
496 # Generated automatically by configure.
497 # Run this file to recreate the current configuration.
498 # This directory was configured as follows,
499 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
506 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
507 exec /bin/sh $0 $* ;;
508 *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
512 trap 'rm -f Makefile; exit 1' 1 3 15
518 INSTALL_PROGRAM='$INSTALL_PROGRAM'
519 INSTALL_DATA='$INSTALL_DATA'
534 exec_prefix='$exec_prefix'
537 cat >> config.status <<\EOF
541 # Allow make-time overrides of the generated file list.
542 test -n "$gen_files" || gen_files="Makefile"
544 for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
546 # Remove last slash and all that follows it. Not all systems have dirname.
547 dir=`echo $file|sed 's%/[^/][^/]*$%%'`
548 if test "$dir" != "$file"; then
549 test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
550 test ! -d $dir && mkdir $dir
554 echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
560 s%@LINKLEX@%$LINKLEX%g
564 s%@installdir@%$installdir%g
565 s%@INSTALL@%$INSTALL%g
566 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
567 s%@INSTALL_DATA@%$INSTALL_DATA%g
576 " $top_srcdir/${file}.in >> $file
581 chmod +x config.status
582 test -n "$no_create" || ./config.status