]> andersk Git - splint.git/blame - configure
Created repository.
[splint.git] / configure
CommitLineData
885824d3 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
26for arg
27do
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
79done
80
81trap 'rm -f conftest* core; exit 1' 1 3 15
82
83# Needed for some versions of `tr' so that character classes in `[]' work.
84if test "${LANG+set}" = "set" ; then
85 LANG=C
86 LC_ALL=C
87 export LANG LC_ALL
88fi
89
90rm -f conftest*
91compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
92
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.
95unique_file=Makefile.in
96
97# Find the source files, if location was not specified.
98if test -z "$srcdir"; then
99 srcdirdefaulted=yes
100 # Try the directory containing this script, then `..'.
101 prog=$0
102 confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
103 test "X$confdir" = "X$prog" && confdir=.
104 srcdir=$confdir
105 if test ! -r $srcdir/$unique_file; then
106 srcdir=..
107 fi
108fi
109if 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
112 else
113 echo "configure: Can not find sources in \`${srcdir}'." 1>&2
114 fi
115 exit 1
116fi
117
118# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
119# But we can't avoid them for `..', to make subdirectories work.
120case $srcdir in
121 .|/*|~*) ;;
122 *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
123esac
124
125if 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}:"
130 for dir in $PATH; do
131 test -z "$dir" && dir=.
132 if test -f $dir/$word; then
133 CC="gcc"
134 break
135 fi
136 done
137 IFS="$saveifs"
138fi
139test -z "$CC" && CC="cc"
140test -n "$CC" -a -n "$verbose" && echo " setting CC to $CC"
141
142# Find out if we are using GNU C, under whatever name.
143cat > conftest.c <<EOF
144#ifdef __GNUC__
145 yes
146#endif
147EOF
148${CC-cc} -E conftest.c > conftest.out 2>&1
149if egrep yes conftest.out >/dev/null 2>&1; then
150 GCC=1 # For later tests.
151 CFLAGS="${CFLAGS--O}"
152fi
153rm -f conftest*
154
155if test -z "$BISON"; then
156 echo checking for bison
157 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
158 for dir in $PATH; do
159 test -z "$dir" && dir=.
160 if test -f $dir/bison; then
161 BISON=$dir/bison
162 break
163 fi
164 done
165 IFS="$saveifs"
166fi
167
168test -n "$BISON" -a -n "$verbose" && echo " setting BISON to $BISON"
169
170if test -z "$FLEX"; then
171 echo checking for flex
172 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
173 for dir in $PATH; do
174 test -z "$dir" && dir=.
175 if test -f $dir/flex; then
176 FLEX=$dir/flex
177 break
178 fi
179 done
180 IFS="$saveifs"
181fi
182
183test -n "$FLEX" -a -n "$verbose" && echo " setting FLEX to $FLEX"
184
185echo checking how to run the C preprocessor
186if test -z "$CPP"; then
187 CPP='gcc -E'
188 cat > conftest.c <<EOF
189#include <stdio.h>
190EOF
191err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
192if test -z "$err"; then
193 :
194else
195 CPP=/lib/cpp
196fi
197rm -f conftest*
198fi
199
200echo 'checking if pre-processor defined __STDC__'
201echo '# ifndef __STDC__' > conftest.c
202echo '# error "No STDC"' >> conftest.c
203echo 'int main (void) { exit (0); }' >> conftest.c
204eval "$CPP conftest.c > conftest.out 2>&1"
205if egrep "No STDC" conftest.out >/dev/null 2>&1; then
206 test -n "$verbose" && echo ' __STDC__ not defined'
207 DEFS="$DEFS -DNEED_STDC"
208fi
209
210echo 'checking for optimization levels'
211echo 'int main (void) { exit (0); }' > conftest.c
212eval "$CC -O -o conftest conftest.c > conftest.out 2>&1"
213if egrep "O" conftest.out >/dev/null 2>&1; then
214 test -n "$verbose" && echo ' No optimization flags found'
215 OPT=''
216else
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'
220 OPT='-O'
221 else
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'
225 OPT='-O2'
226 else
227 if egrep "O4" conftest.out >/dev/null 2>&1; then
228 test -n "$verbose" && echo ' Optimization: -O3'
229 OPT='-O2'
230 else
231 test -n "$verbose" && echo ' Optimization: -O4'
232 OPT='-O2'
233# bug in gcc makes -O3 and -O4 bad - bug in compiling parser
234 fi
235 fi
236 fi
237fi
238rm -f conftest*
239
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
246# anyway. Sigh.
247if test "z${INSTALL}" = "z" ; then
248 echo checking for install
249 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
250 for dir in $PATH; do
251 test -z "$dir" && dir=.
252 case $dir in
253 /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
254 *)
255 if test -f $dir/installbsd; then
256 INSTALL="$dir/installbsd -c" # OSF1
257 INSTALL_PROGRAM='$(INSTALL)'
258 INSTALL_DATA='$(INSTALL) -m 644'
259 break
260 fi
261 if test -f $dir/install; then
262 if grep dspmsg $dir/install >/dev/null 2>&1; then
263 : # AIX
264 else
265 INSTALL="$dir/install -c"
266 INSTALL_PROGRAM='$(INSTALL)'
267 INSTALL_DATA='$(INSTALL) -m 644'
268 break
269 fi
270 fi
271 ;;
272 esac
273 done
274 IFS="$saveifs"
275fi
276INSTALL=${INSTALL-cp}
277INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
278INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
279
280echo checking for ANSI C header files
281cat > conftest.c <<EOF
282#include <stdlib.h>
283#include <stdarg.h>
284#include <string.h>
285#include <float.h>
286EOF
287err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
288if test -z "$err"; then
289 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
290echo '#include <string.h>' > conftest.c
291eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
292if 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.
294cat > conftest.c <<EOF
295#include <ctype.h>
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)))
299int main () { int i; for (i = 0; i < 256; i++)
300if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
301exit (0); }
302
303EOF
304eval $compile
305if test -s conftest && (./conftest; exit) 2>/dev/null; then
306 {
307test -n "$verbose" && \
308echo ' defining' STDC_HEADERS
309DEFS="$DEFS -DSTDC_HEADERS=1"
310}
311
312fi
313rm -f conftest*
314fi
315rm -f conftest*
316
317fi
318rm -f conftest*
319
320echo checking for stdarg.h
321cat > conftest.c <<EOF
322#include <stdarg.h>
323EOF
324err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
325if test -z "$err"; then
326 USEVARARGS=0 :
327else
328 {
329test -n "$verbose" && \
330echo ' defining' USEVARARGS
331DEFS="$DEFS -DUSEVARARGS=1"
332USEVARARGS=1
333}
334fi
335
336echo checking for string.h
337cat > conftest.c <<EOF
338#include <string.h>
339EOF
340err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
341if test -z "$err"; then
342 :
343else
344 {
345test -n "$verbose" && \
346echo ' defining' NO_STRING_H
347DEFS="$DEFS -DNO_STRING_H=1"
348}
349
350fi
351rm -f conftest*
352
353echo checking for stdlib.h
354cat > conftest.c <<EOF
355#include <stdlib.h>
356EOF
357err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
358if test -z "$err"; then
359 :
360else
361 {
362test -n "$verbose" && \
363echo ' defining' NO_STDLIB_H
364DEFS="$DEFS -DNO_STDLIB_H=1"
365}
366
367fi
368rm -f conftest*
369
370echo checking for size_t in sys/types.h
371echo '#include <sys/types.h>' > conftest.c
372eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
373if egrep "size_t" conftest.out >/dev/null 2>&1; then
374 :
375else
376 {
377test -n "$verbose" && \
378echo ' defining' size_t to be 'unsigned'
379DEFS="$DEFS -Dsize_t=unsigned"
380}
381
382fi
383rm -f conftest*
384
385echo '#include <sys/types.h>' > conftest.c
386eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
387if egrep "off_t" conftest.out >/dev/null 2>&1; then
388 :
389else
390 {
391test -n "$verbose" && \
392echo ' defining' NO_OFF_T
393DEFS="$DEFS -DNO_OFF_T=1"
394}
395fi
396
397echo checking for EXIT_SUCCESS
398cat > conftest.c <<EOF
399# include <stdlib.h>
400int main (void) { return EXIT_SUCCESS; }
401EOF
402err=`eval "($CC -c \$DEFS conftest.c >/dev/null) 2>&1"`
403if test -z "$err"; then
404 :
405else
406 {
407test -n "$verbose" && \
408echo ' no EXIT_SUCCESS'
409DEFS="$DEFS -DEXIT_SUCCESS=0"
410}
411fi
412
413echo checking for EXIT_FAILURE
414cat > conftest.c <<EOF
415# include <stdlib.h>
416int main (void) { return EXIT_FAILURE; }
417EOF
418err=`eval "($CC -c \$DEFS conftest.c >/dev/null) 2>&1"`
419if test -z "$err"; then
420 :
421else
422 {
423test -n "$verbose" && \
424echo ' no EXIT_FAILURE'
425DEFS="$DEFS -DEXIT_FAILURE=-1"
426}
427fi
428
429echo checking for -ll
430echo 'int main (void) { exit (0); }' > conftest.c
431err=`eval "($CC conftest.c -o conftest -ll >/dev/null) 2>&1"`
432if test -z "$err"; then
433LINKLEX="-ll"
434else
435echo ' No -ll...trying -lfl'
436err=`eval "($CC conftest.c -o conftest -lfl >/dev/null) 2>&1"`
437if test -z "$err"; then
438echo 'Okay!'
439LINKLEX="-lfl"
440else
441echo '*** No lex or flex library found. Must have -ll or -lfl to build lclint.'
442echo '*** If this is installed on your system, try editing the configure
443script to use the correct flags to locate this file.'
444fi
445fi
446rm -f conftest*
447
448if test -z "$cwdir"
449 then
450 cwdir=`pwd`
451 echo setting current directory to $cwdir
452 fi
453
454if test -z "$prefix"
455then
456 prefix=$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"
463fi
464
465if test -z "$G" -a -n "$prefix" -a -f $prefix/bin/gznew; then
466 G=g
467fi
468if test -z "$ZCAT"; then
469 if test -n "$prefix" -a -f $prefix/bin/gzcat; then
470 ZCAT=gzcat
471 else
472 ZCAT=${G}zcat
473 fi
474fi
475if test -n "$prefix"; then
476 test -z "$exec_prefix" && exec_prefix='${prefix}'
477 prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
478fi
479if test -n "$exec_prefix"; then
480 prsub="$prsub
481s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\
482exec_prefix\\1=\\2$exec_prefix%"
483fi
484cat >conftest.def <<EOF
485$DEFS
486EOF
487escape_ampersand_and_backslash='s%[&\\]%\\&%g'
488DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
489rm -f conftest.def
490
491trap 'rm -f config.status; exit 1' 1 3 15
492echo creating config.status
493rm -f config.status
494cat > config.status <<EOF
495#!/bin/sh
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`:
500#
501# $0 $*
502
503for arg
504do
505 case "\$arg" in
506 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
507 exec /bin/sh $0 $* ;;
508 *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
509 esac
510done
511
512trap 'rm -f Makefile; exit 1' 1 3 15
513CC='$CC'
514CPP='$CPP'
515OPT='$OPT'
516cwdir='$cwdir'
517INSTALL='$INSTALL'
518INSTALL_PROGRAM='$INSTALL_PROGRAM'
519INSTALL_DATA='$INSTALL_DATA'
520BISON='$BISON'
521FLEX='$FLEX'
522ZCAT='$ZCAT'
523LINKLEX='$LINKLEX'
524G='$G'
525CFLAGS='$CFLAGS'
526ASCPP='$ASCPP'
527OBJA='$OBJA'
528SEDCMD='$SEDCMD'
529LIBS='$LIBS'
530srcdir='$srcdir'
531DEFS='$DEFS'
532prefix='$prefix'
533installdir='$prefix'
534exec_prefix='$exec_prefix'
535prsub='$prsub'
536EOF
537cat >> config.status <<\EOF
538
539top_srcdir=$srcdir
540
541# Allow make-time overrides of the generated file list.
542test -n "$gen_files" || gen_files="Makefile"
543
544for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
545 srcdir=$top_srcdir
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
551 fi
552 echo creating $file
553 rm -f $file
554 echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
555 sed -e "
556$prsub
557s%@CC@%$CC%g
558s%@CPP@%$CPP%g
559s%@OPT@%$OPT%g
560s%@LINKLEX@%$LINKLEX%g
561s%@BISON@%$BISON%g
562s%@FLEX@%$FLEX%g
563s%@cwdir@%$cwdir%g
564s%@installdir@%$installdir%g
565s%@INSTALL@%$INSTALL%g
566s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
567s%@INSTALL_DATA@%$INSTALL_DATA%g
568s%@ZCAT@%$ZCAT%g
569s%@G@%$G%g
570s%@CFLAGS@%$CFLAGS%g
571s%@OBJA@%$OBJA%g
572s%@SEDCMD@%$SEDCMD%g
573s%@LIBS@%$LIBS%g
574s%@srcdir@%$srcdir%g
575s%@DEFS@%$DEFS%
576" $top_srcdir/${file}.in >> $file
577fi; done
578
579exit 0
580EOF
581chmod +x config.status
582test -n "$no_create" || ./config.status
583
This page took 0.148236 seconds and 5 git commands to generate.