blob: eb7fb97be45f533d2bae330c6c65915ff7e7b1ed [file] [log] [blame]
Guido van Rossum627b2d71993-12-24 10:39:16 +00001
2#!/bin/sh
3# Guess values for system-dependent variables and create Makefiles.
4# Generated automatically using autoconf.
5# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
6
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2, or (at your option)
10# any later version.
11
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
22# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
23# Ignores all args except --srcdir, --prefix, --exec-prefix, and
24# --with-PACKAGE[=VALUE] unless this script has special code to handle it.
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, recognize -exec-prefix and --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 -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
53 prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
54 -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
55 next_prefix=yes ;;
56
57 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
58 srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
59 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
60 next_srcdir=yes ;;
61
62 -with-* | --with-*)
63 package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
64 # Reject names that aren't valid shell variable names.
65 if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
66 echo "configure: $package: invalid package name" >&2; exit 1
67 fi
68 package=`echo $package| sed 's/-/_/g'`
69 case "$arg" in
70 *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
71 *) val=1 ;;
72 esac
73 eval "with_$package='$val'" ;;
74
75 -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
76 verbose=yes ;;
77
78 *) ;;
79 esac
80 fi
81done
82
83trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
84trap 'rm -f confdefs*' 0
85
86# NLS nuisances.
87# These must not be set unconditionally because not all systems understand
88# e.g. LANG=C (notably SCO).
89if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
90if test "${LANG+set}" = 'set' ; then LANG=C; export LANG; fi
91
92rm -f conftest* confdefs.h
93# AIX cpp loses on an empty file, so make sure it contains at least a newline.
94echo > confdefs.h
95compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
96
97# A filename unique to this package, relative to the directory that
98# configure is in, which we can look for to find out if srcdir is correct.
99unique_file=Py/object.h
100
101# Find the source files, if location was not specified.
102if test -z "$srcdir"; then
103 srcdirdefaulted=yes
104 # Try the directory containing this script, then `..'.
105 prog=$0
106 confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
107 test "X$confdir" = "X$prog" && confdir=.
108 srcdir=$confdir
109 if test ! -r $srcdir/$unique_file; then
110 srcdir=..
111 fi
112fi
113if test ! -r $srcdir/$unique_file; then
114 if test x$srcdirdefaulted = xyes; then
115 echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
116 else
117 echo "configure: Can not find sources in \`${srcdir}'." 1>&2
118 fi
119 exit 1
120fi
121# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
122# But we can't avoid them for `..', to make subdirectories work.
123case $srcdir in
124 .|/*|~*) ;;
125 *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
126esac
127
128
129# Save the original args to write them into config.status later.
130configure_args="$*"
131
132
133# checks for alternative programs
134if test -z "$CC"; then
135 # Extract the first word of `gcc', so it can be a program name with args.
136 set dummy gcc; word=$2
137 echo checking for $word
138 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
139 for dir in $PATH; do
140 test -z "$dir" && dir=.
141 if test -f $dir/$word; then
142 CC="gcc"
143 break
144 fi
145 done
146 IFS="$saveifs"
147fi
148test -z "$CC" && CC="cc"
149test -n "$CC" && test -n "$verbose" && echo " setting CC to $CC"
150
151# Find out if we are using GNU C, under whatever name.
152cat > conftest.c <<EOF
153#ifdef __GNUC__
154 yes
155#endif
156EOF
157${CC-cc} -E conftest.c > conftest.out 2>&1
158if egrep yes conftest.out >/dev/null 2>&1; then
159 GCC=1 # For later tests.
160fi
161rm -f conftest*
162
163if test -z "$RANLIB"; then
164 # Extract the first word of `ranlib', so it can be a program name with args.
165 set dummy ranlib; word=$2
166 echo checking for $word
167 IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
168 for dir in $PATH; do
169 test -z "$dir" && dir=.
170 if test -f $dir/$word; then
171 RANLIB="ranlib"
172 break
173 fi
174 done
175 IFS="$saveifs"
176fi
177test -z "$RANLIB" && RANLIB=":"
178test -n "$RANLIB" && test -n "$verbose" && echo " setting RANLIB to $RANLIB"
179
180
181# checks for UNIX variants that set C preprocessor variables
182echo checking for AIX
183echo checking how to run the C preprocessor
184if test -z "$CPP"; then
185 # This must be in double quotes, not single quotes, because CPP may get
186 # substituted into the Makefile and ``${CC-cc}'' will simply confuse
187 # make. It must be expanded now.
188 CPP="${CC-cc} -E"
189 cat > conftest.c <<EOF
190#include "confdefs.h"
191#include <stdio.h>
192Syntax Error
193EOF
194err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
195if test -z "$err"; then
196 :
197else
198 rm -rf conftest*
199 CPP=/lib/cpp
200fi
201rm -f conftest*
202fi
203test ".${verbose}" != "." && echo " setting CPP to $CPP"
204
205cat > conftest.c <<EOF
206#include "confdefs.h"
207#ifdef _AIX
208 yes
209#endif
210
211EOF
212eval "$CPP conftest.c > conftest.out 2>&1"
213if egrep "yes" conftest.out >/dev/null 2>&1; then
214 rm -rf conftest*
215
216{
217test -n "$verbose" && \
218echo " defining _ALL_SOURCE"
219echo "#define" _ALL_SOURCE 1 >> confdefs.h
220DEFS="$DEFS -D_ALL_SOURCE=1"
221}
222
223
224fi
225rm -f conftest*
226
227
228echo checking for POSIXized ISC
229if test -d /etc/conf/kconfig.d &&
230 grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
231then
232 ISC=1 # If later tests want to check for ISC.
233
234{
235test -n "$verbose" && \
236echo " defining _POSIX_SOURCE"
237echo "#define" _POSIX_SOURCE 1 >> confdefs.h
238DEFS="$DEFS -D_POSIX_SOURCE=1"
239}
240
241 if test -n "$GCC"; then
242 CC="$CC -posix"
243 else
244 CC="$CC -Xp"
245 fi
246fi
247
248echo checking for minix/config.h
249cat > conftest.c <<EOF
250#include "confdefs.h"
251#include <minix/config.h>
252EOF
253err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
254if test -z "$err"; then
255 rm -rf conftest*
256 MINIX=1
257
258fi
259rm -f conftest*
260
261# The Minix shell can't assign to the same variable on the same line!
262if test -n "$MINIX"; then
263
264{
265test -n "$verbose" && \
266echo " defining _POSIX_SOURCE"
267echo "#define" _POSIX_SOURCE 1 >> confdefs.h
268DEFS="$DEFS -D_POSIX_SOURCE=1"
269}
270
271
272{
273test -n "$verbose" && \
274echo " defining" _POSIX_1_SOURCE to be 2
275echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
276DEFS="$DEFS -D_POSIX_1_SOURCE=2"
277}
278
279
280{
281test -n "$verbose" && \
282echo " defining _MINIX"
283echo "#define" _MINIX 1 >> confdefs.h
284DEFS="$DEFS -D_MINIX=1"
285}
286
287fi
288
289LIBS_save="${LIBS}"
290LIBS="${LIBS} -lseq"
291have_lib=""
292echo checking for -lseq
293cat > conftest.c <<EOF
294#include "confdefs.h"
295
296int main() { exit(0); }
297int t() { main(); }
298EOF
299if eval $compile; then
300 rm -rf conftest*
301 have_lib="1"
302
303fi
304rm -f conftest*
305LIBS="${LIBS_save}"
306if test -n "${have_lib}"; then
307 :; LIBS="$LIBS -lseq"
308else
309 :;
310fi
311
312
313
314# checks for header files
315echo checking for ANSI C header files
316cat > conftest.c <<EOF
317#include "confdefs.h"
318#include <stdlib.h>
319#include <stdarg.h>
320#include <string.h>
321#include <float.h>
322EOF
323err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
324if test -z "$err"; then
325 rm -rf conftest*
326 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
327echo '#include "confdefs.h"
328#include <string.h>' > conftest.c
329eval "$CPP conftest.c > conftest.out 2>&1"
330if egrep "memchr" conftest.out >/dev/null 2>&1; then
331 rm -rf conftest*
332 # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
333cat > conftest.c <<EOF
334#include "confdefs.h"
335#include <ctype.h>
336#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
337#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
338#define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
339int main () { int i; for (i = 0; i < 256; i++)
340if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
341exit (0); }
342
343EOF
344eval $compile
345if test -s conftest && (./conftest; exit) 2>/dev/null; then
346
347{
348test -n "$verbose" && \
349echo " defining STDC_HEADERS"
350echo "#define" STDC_HEADERS 1 >> confdefs.h
351DEFS="$DEFS -DSTDC_HEADERS=1"
352}
353
354
355fi
356rm -fr conftest*
357
358fi
359rm -f conftest*
360
361
362fi
363rm -f conftest*
364
365for hdr in dlfcn.h signal.h stdarg.h unistd.h utime.h sys/param.h sys/select.h sys/times.h sys/utsname.h
366do
367trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
368echo checking for ${hdr}
369cat > conftest.c <<EOF
370#include "confdefs.h"
371#include <${hdr}>
372EOF
373err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
374if test -z "$err"; then
375 rm -rf conftest*
376
377{
378test -n "$verbose" && \
379echo " defining ${trhdr}"
380echo "#define" ${trhdr} 1 >> confdefs.h
381DEFS="$DEFS -D${trhdr}=1"
382}
383
384
385fi
386rm -f conftest*
387done
388
389echo checking for directory library header
390dirheader=
391if test -z "$dirheader"; then
392 echo checking for dirent.h
393cat > conftest.c <<EOF
394#include "confdefs.h"
395#include <sys/types.h>
396#include <dirent.h>
397int main() { exit(0); }
398int t() { DIR *dirp = 0; }
399EOF
400if eval $compile; then
401 rm -rf conftest*
402
403{
404test -n "$verbose" && \
405echo " defining DIRENT"
406echo "#define" DIRENT 1 >> confdefs.h
407DEFS="$DEFS -DDIRENT=1"
408}
409 dirheader=dirent.h
410
411fi
412rm -f conftest*
413fi
414if test -z "$dirheader"; then
415 echo checking for sys/ndir.h
416cat > conftest.c <<EOF
417#include "confdefs.h"
418#include <sys/types.h>
419#include <sys/ndir.h>
420int main() { exit(0); }
421int t() { DIR *dirp = 0; }
422EOF
423if eval $compile; then
424 rm -rf conftest*
425
426{
427test -n "$verbose" && \
428echo " defining SYSNDIR"
429echo "#define" SYSNDIR 1 >> confdefs.h
430DEFS="$DEFS -DSYSNDIR=1"
431}
432 dirheader=sys/ndir.h
433
434fi
435rm -f conftest*
436fi
437if test -z "$dirheader"; then
438 echo checking for sys/dir.h
439cat > conftest.c <<EOF
440#include "confdefs.h"
441#include <sys/types.h>
442#include <sys/dir.h>
443int main() { exit(0); }
444int t() { DIR *dirp = 0; }
445EOF
446if eval $compile; then
447 rm -rf conftest*
448
449{
450test -n "$verbose" && \
451echo " defining SYSDIR"
452echo "#define" SYSDIR 1 >> confdefs.h
453DEFS="$DEFS -DSYSDIR=1"
454}
455 dirheader=sys/dir.h
456
457fi
458rm -f conftest*
459fi
460if test -z "$dirheader"; then
461 echo checking for ndir.h
462cat > conftest.c <<EOF
463#include "confdefs.h"
464#include <sys/types.h>
465#include <ndir.h>
466int main() { exit(0); }
467int t() { DIR *dirp = 0; }
468EOF
469if eval $compile; then
470 rm -rf conftest*
471
472{
473test -n "$verbose" && \
474echo " defining NDIR"
475echo "#define" NDIR 1 >> confdefs.h
476DEFS="$DEFS -DNDIR=1"
477}
478 dirheader=ndir.h
479
480fi
481rm -f conftest*
482fi
483
484echo checking for closedir return value
485cat > conftest.c <<EOF
486#include "confdefs.h"
487#include <sys/types.h>
488#include <$dirheader>
489int closedir(); main() { exit(closedir(opendir(".")) != 0); }
490EOF
491eval $compile
492if test -s conftest && (./conftest; exit) 2>/dev/null; then
493 :
494else
495
496{
497test -n "$verbose" && \
498echo " defining VOID_CLOSEDIR"
499echo "#define" VOID_CLOSEDIR 1 >> confdefs.h
500DEFS="$DEFS -DVOID_CLOSEDIR=1"
501}
502
503fi
504rm -fr conftest*
505
506
507# checks for typedefs
508echo checking for uid_t in sys/types.h
509echo '#include "confdefs.h"
510#include <sys/types.h>' > conftest.c
511eval "$CPP conftest.c > conftest.out 2>&1"
512if egrep "uid_t" conftest.out >/dev/null 2>&1; then
513 :
514else
515 rm -rf conftest*
516
517{
518test -n "$verbose" && \
519echo " defining" uid_t to be int
520echo "#define" uid_t int >> confdefs.h
521DEFS="$DEFS -Duid_t=int"
522}
523
524{
525test -n "$verbose" && \
526echo " defining" gid_t to be int
527echo "#define" gid_t int >> confdefs.h
528DEFS="$DEFS -Dgid_t=int"
529}
530
531fi
532rm -f conftest*
533
534echo checking for type of array argument to getgroups
535prog='/* Thanks to Mike Rendell for this test. */
536#include <sys/types.h>
537#define NGID 256
538#undef MAX
539#define MAX(x,y) ((x) > (y) ? (x) : (y))
540main()
541{
542 gid_t gidset[NGID];
543 int i, n;
544 union { gid_t gval; long lval; } val;
545
546 val.lval = -1;
547 for (i = 0; i < NGID; i++)
548 gidset[i] = val.gval;
549 n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
550 gidset);
551 /* Exit non-zero if getgroups seems to require an array of ints. This
552 happens when gid_t is short but getgroups modifies an array of ints. */
553 exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
554}'
555cat > conftest.c <<EOF
556#include "confdefs.h"
557$prog
558EOF
559eval $compile
560if test -s conftest && (./conftest; exit) 2>/dev/null; then
561
562{
563test -n "$verbose" && \
564echo " defining" GETGROUPS_T to be gid_t
565echo "#define" GETGROUPS_T gid_t >> confdefs.h
566DEFS="$DEFS -DGETGROUPS_T=gid_t"
567}
568
569
570else
571
572{
573test -n "$verbose" && \
574echo " defining" GETGROUPS_T to be int
575echo "#define" GETGROUPS_T int >> confdefs.h
576DEFS="$DEFS -DGETGROUPS_T=int"
577}
578
579fi
580rm -fr conftest*
581
582echo checking for mode_t in sys/types.h
583echo '#include "confdefs.h"
584#include <sys/types.h>' > conftest.c
585eval "$CPP conftest.c > conftest.out 2>&1"
586if egrep "mode_t" conftest.out >/dev/null 2>&1; then
587 :
588else
589 rm -rf conftest*
590
591{
592test -n "$verbose" && \
593echo " defining" mode_t to be int
594echo "#define" mode_t int >> confdefs.h
595DEFS="$DEFS -Dmode_t=int"
596}
597
598fi
599rm -f conftest*
600
601echo checking for off_t in sys/types.h
602echo '#include "confdefs.h"
603#include <sys/types.h>' > conftest.c
604eval "$CPP conftest.c > conftest.out 2>&1"
605if egrep "off_t" conftest.out >/dev/null 2>&1; then
606 :
607else
608 rm -rf conftest*
609
610{
611test -n "$verbose" && \
612echo " defining" off_t to be long
613echo "#define" off_t long >> confdefs.h
614DEFS="$DEFS -Doff_t=long"
615}
616
617fi
618rm -f conftest*
619
620echo checking for pid_t in sys/types.h
621echo '#include "confdefs.h"
622#include <sys/types.h>' > conftest.c
623eval "$CPP conftest.c > conftest.out 2>&1"
624if egrep "pid_t" conftest.out >/dev/null 2>&1; then
625 :
626else
627 rm -rf conftest*
628
629{
630test -n "$verbose" && \
631echo " defining" pid_t to be int
632echo "#define" pid_t int >> confdefs.h
633DEFS="$DEFS -Dpid_t=int"
634}
635
636fi
637rm -f conftest*
638
639echo checking for return type of signal handlers
640cat > conftest.c <<EOF
641#include "confdefs.h"
642#include <sys/types.h>
643#include <signal.h>
644#ifdef signal
645#undef signal
646#endif
647extern void (*signal ()) ();
648int main() { exit(0); }
649int t() { int i; }
650EOF
651if eval $compile; then
652 rm -rf conftest*
653
654{
655test -n "$verbose" && \
656echo " defining" RETSIGTYPE to be void
657echo "#define" RETSIGTYPE void >> confdefs.h
658DEFS="$DEFS -DRETSIGTYPE=void"
659}
660
661
662else
663 rm -rf conftest*
664
665{
666test -n "$verbose" && \
667echo " defining" RETSIGTYPE to be int
668echo "#define" RETSIGTYPE int >> confdefs.h
669DEFS="$DEFS -DRETSIGTYPE=int"
670}
671
672fi
673rm -f conftest*
674
675
676echo checking for size_t in sys/types.h
677echo '#include "confdefs.h"
678#include <sys/types.h>' > conftest.c
679eval "$CPP conftest.c > conftest.out 2>&1"
680if egrep "size_t" conftest.out >/dev/null 2>&1; then
681 :
682else
683 rm -rf conftest*
684
685{
686test -n "$verbose" && \
687echo " defining" size_t to be unsigned
688echo "#define" size_t unsigned >> confdefs.h
689DEFS="$DEFS -Dsize_t=unsigned"
690}
691
692fi
693rm -f conftest*
694
695echo checking for uid_t in sys/types.h
696echo '#include "confdefs.h"
697#include <sys/types.h>' > conftest.c
698eval "$CPP conftest.c > conftest.out 2>&1"
699if egrep "uid_t" conftest.out >/dev/null 2>&1; then
700 :
701else
702 rm -rf conftest*
703
704{
705test -n "$verbose" && \
706echo " defining" uid_t to be int
707echo "#define" uid_t int >> confdefs.h
708DEFS="$DEFS -Duid_t=int"
709}
710
711{
712test -n "$verbose" && \
713echo " defining" gid_t to be int
714echo "#define" gid_t int >> confdefs.h
715DEFS="$DEFS -Dgid_t=int"
716}
717
718fi
719rm -f conftest*
720
721
722# checks for libraries
723LIBS_save="${LIBS}"
724LIBS="${LIBS} -ldl"
725have_lib=""
726echo checking for -ldl
727cat > conftest.c <<EOF
728#include "confdefs.h"
729
730int main() { exit(0); }
731int t() { main(); }
732EOF
733if eval $compile; then
734 rm -rf conftest*
735 have_lib="1"
736
737fi
738rm -f conftest*
739LIBS="${LIBS_save}"
740if test -n "${have_lib}"; then
741
742{
743test -n "$verbose" && \
744echo " defining HAVE_LIBDL"
745echo "#define" HAVE_LIBDL 1 >> confdefs.h
746DEFS="$DEFS -DHAVE_LIBDL=1"
747}
748
749 LIBS="${LIBS} -ldl"
750fi
751
752LIBS="${LIBS} -L${READLINESRC-${PWD-${CWD-`pwd`}}/readline}"
753LIBS_save="${LIBS}"
754LIBS="${LIBS} -lreadline"
755have_lib=""
756echo checking for -lreadline
757cat > conftest.c <<EOF
758#include "confdefs.h"
759
760int main() { exit(0); }
761int t() { main(); }
762EOF
763if eval $compile; then
764 rm -rf conftest*
765 have_lib="1"
766
767fi
768rm -f conftest*
769LIBS="${LIBS_save}"
770if test -n "${have_lib}"; then
771
772{
773test -n "$verbose" && \
774echo " defining HAVE_LIBREADLINE"
775echo "#define" HAVE_LIBREADLINE 1 >> confdefs.h
776DEFS="$DEFS -DHAVE_LIBREADLINE=1"
777}
778
779 LIBS="${LIBS} -lreadline"
780fi
781
782if test -n "${have_lib}"; then
783LIBS_save="${LIBS}"
784LIBS="${LIBS} -ltermcap"
785have_lib=""
786echo checking for -ltermcap
787cat > conftest.c <<EOF
788#include "confdefs.h"
789
790int main() { exit(0); }
791int t() { main(); }
792EOF
793if eval $compile; then
794 rm -rf conftest*
795 have_lib="1"
796
797fi
798rm -f conftest*
799LIBS="${LIBS_save}"
800if test -n "${have_lib}"; then
801
802{
803test -n "$verbose" && \
804echo " defining HAVE_LIBTERMCAP"
805echo "#define" HAVE_LIBTERMCAP 1 >> confdefs.h
806DEFS="$DEFS -DHAVE_LIBTERMCAP=1"
807}
808
809 LIBS="${LIBS} -ltermcap"
810fi
811
812fi
813
814# Check for IRIX or SOLARIS thread interface
815LIBS_save="${LIBS}"
816LIBS="${LIBS} -lmpc"
817have_lib=""
818echo checking for -lmpc
819cat > conftest.c <<EOF
820#include "confdefs.h"
821
822int main() { exit(0); }
823int t() { main(); }
824EOF
825if eval $compile; then
826 rm -rf conftest*
827 have_lib="1"
828
829fi
830rm -f conftest*
831LIBS="${LIBS_save}"
832if test -n "${have_lib}"; then
833
834{
835test -n "$verbose" && \
836echo " defining HAVE_LIBMPC"
837echo "#define" HAVE_LIBMPC 1 >> confdefs.h
838DEFS="$DEFS -DHAVE_LIBMPC=1"
839}
840
841 LIBS="${LIBS} -lmpc"
842fi
843
844if test -n "${have_lib}"; then
845DEFS="${DEFS} -DUSE_THREAD"
846LIBOBJS="${LIBOBJS} thread.o"
847fi
848
849LIBS_save="${LIBS}"
850LIBS="${LIBS} -lthread"
851have_lib=""
852echo checking for -lthread
853cat > conftest.c <<EOF
854#include "confdefs.h"
855
856int main() { exit(0); }
857int t() { main(); }
858EOF
859if eval $compile; then
860 rm -rf conftest*
861 have_lib="1"
862
863fi
864rm -f conftest*
865LIBS="${LIBS_save}"
866if test -n "${have_lib}"; then
867
868{
869test -n "$verbose" && \
870echo " defining HAVE_LIBTHREAD"
871echo "#define" HAVE_LIBTHREAD 1 >> confdefs.h
872DEFS="$DEFS -DHAVE_LIBTHREAD=1"
873}
874
875 LIBS="${LIBS} -lthread"
876fi
877
878if test -n "${have_lib}"; then
879DEFS="${DEFS} -DUSE_THREAD"
880LIBOBJS="${LIBOBJS} thread.o"
881fi
882
883# checks for library functions
884for func in clock ftime gettimeofday getpgrp getwd lstat readlink readline select setsid setpgid setpgrp siginterrupt symlink tcgetpgrp tcsetpgrp times uname waitpid
885do
886trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
887echo checking for ${func}
888cat > conftest.c <<EOF
889#include "confdefs.h"
890#include <ctype.h>
891int main() { exit(0); }
892int t() {
893/* The GNU C library defines this for functions which it implements
894 to always fail with ENOSYS. Some functions are actually named
895 something starting with __ and the normal name is an alias. */
896#if defined (__stub_${func}) || defined (__stub___${func})
897choke me
898#else
899/* Override any gcc2 internal prototype to avoid an error. */
900extern char ${func}(); ${func}();
901#endif
902 }
903EOF
904if eval $compile; then
905 rm -rf conftest*
906 {
907test -n "$verbose" && \
908echo " defining ${trfunc}"
909echo "#define" ${trfunc} 1 >> confdefs.h
910DEFS="$DEFS -D${trfunc}=1"
911}
912
913
914fi
915rm -f conftest*
916done
917
918for func in dup2 getcwd strerror strtoul strtod memmove
919do
920echo checking for ${func}
921cat > conftest.c <<EOF
922#include "confdefs.h"
923#include <ctype.h>
924int main() { exit(0); }
925int t() {
926/* The GNU C library defines this for functions which it implements
927 to always fail with ENOSYS. Some functions are actually named
928 something starting with __ and the normal name is an alias. */
929#if defined (__stub_${func}) || defined (__stub___${func})
930choke me
931#else
932/* Override any gcc2 internal prototype to avoid an error. */
933extern char ${func}(); ${func}();
934#endif
935 }
936EOF
937if eval $compile; then
938 :
939else
940 rm -rf conftest*
941 LIBOBJS="$LIBOBJS ${func}.o"
942test -n "$verbose" && echo " using ${func}.o instead"
943fi
944rm -f conftest*
945
946done
947
948echo checking for getpgrp
949cat > conftest.c <<EOF
950#include "confdefs.h"
951#include <ctype.h>
952int main() { exit(0); }
953int t() {
954/* The GNU C library defines this for functions which it implements
955 to always fail with ENOSYS. Some functions are actually named
956 something starting with __ and the normal name is an alias. */
957#if defined (__stub_getpgrp) || defined (__stub___getpgrp)
958choke me
959#else
960/* Override any gcc2 internal prototype to avoid an error. */
961extern char getpgrp(); getpgrp();
962#endif
963 }
964EOF
965if eval $compile; then
966 rm -rf conftest*
967 echo checking for argument to getpgrp
968cat > conftest.c <<EOF
969#include "confdefs.h"
970#include <unistd.h>
971int main() { exit(0); }
972int t() { getpgrp(0); }
973EOF
974if eval $compile; then
975 rm -rf conftest*
976
977{
978test -n "$verbose" && \
979echo " defining GETPGRP_HAVE_ARG"
980echo "#define" GETPGRP_HAVE_ARG 1 >> confdefs.h
981DEFS="$DEFS -DGETPGRP_HAVE_ARG=1"
982}
983
984
985fi
986rm -f conftest*
987
988
989fi
990rm -f conftest*
991
992
993# checks for structures
994echo checking for whether time.h and sys/time.h may both be included
995cat > conftest.c <<EOF
996#include "confdefs.h"
997#include <sys/types.h>
998#include <sys/time.h>
999#include <time.h>
1000int main() { exit(0); }
1001int t() { struct tm *tp; }
1002EOF
1003if eval $compile; then
1004 rm -rf conftest*
1005
1006{
1007test -n "$verbose" && \
1008echo " defining TIME_WITH_SYS_TIME"
1009echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h
1010DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
1011}
1012
1013
1014fi
1015rm -f conftest*
1016
1017echo checking for struct tm in time.h
1018cat > conftest.c <<EOF
1019#include "confdefs.h"
1020#include <sys/types.h>
1021#include <time.h>
1022int main() { exit(0); }
1023int t() { struct tm *tp; tp->tm_sec; }
1024EOF
1025if eval $compile; then
1026 :
1027else
1028 rm -rf conftest*
1029
1030{
1031test -n "$verbose" && \
1032echo " defining TM_IN_SYS_TIME"
1033echo "#define" TM_IN_SYS_TIME 1 >> confdefs.h
1034DEFS="$DEFS -DTM_IN_SYS_TIME=1"
1035}
1036
1037fi
1038rm -f conftest*
1039
1040decl='#include <sys/types.h>
1041'
1042case "$DEFS" in
1043 *TM_IN_SYS_TIME*) decl="$decl
1044#include <sys/time.h>
1045" ;;
1046 *) decl="$decl
1047#include <time.h>
1048" ;;
1049esac
1050echo checking for tm_zone in struct tm
1051cat > conftest.c <<EOF
1052#include "confdefs.h"
1053$decl
1054int main() { exit(0); }
1055int t() { struct tm tm; tm.tm_zone; }
1056EOF
1057if eval $compile; then
1058 rm -rf conftest*
1059
1060{
1061test -n "$verbose" && \
1062echo " defining HAVE_TM_ZONE"
1063echo "#define" HAVE_TM_ZONE 1 >> confdefs.h
1064DEFS="$DEFS -DHAVE_TM_ZONE=1"
1065}
1066
1067
1068else
1069 rm -rf conftest*
1070 no_tm_zone=1
1071fi
1072rm -f conftest*
1073
1074if test -n "$no_tm_zone"; then
1075echo checking for tzname
1076cat > conftest.c <<EOF
1077#include "confdefs.h"
1078#include <time.h>
1079#ifndef tzname /* For SGI. */
1080extern char *tzname[]; /* RS6000 and others want it this way. */
1081#endif
1082int main() { exit(0); }
1083int t() { atoi(*tzname); }
1084EOF
1085if eval $compile; then
1086 rm -rf conftest*
1087
1088{
1089test -n "$verbose" && \
1090echo " defining HAVE_TZNAME"
1091echo "#define" HAVE_TZNAME 1 >> confdefs.h
1092DEFS="$DEFS -DHAVE_TZNAME=1"
1093}
1094
1095
1096fi
1097rm -f conftest*
1098
1099fi
1100
1101
1102# checks for compiler characteristics
1103prog='/* Ultrix mips cc rejects this. */
1104typedef int charset[2]; const charset x;
1105/* SunOS 4.1.1 cc rejects this. */
1106char const *const *ccp;
1107char **p;
1108/* AIX XL C 1.02.0.0 rejects this.
1109 It does not let you subtract one const X* pointer from another in an arm
1110 of an if-expression whose if-part is not a constant expression */
1111const char *g = "string";
1112ccp = &g + (g ? g-g : 0);
1113/* HPUX 7.0 cc rejects these. */
1114++ccp;
1115p = (char**) ccp;
1116ccp = (char const *const *) p;
1117{ /* SCO 3.2v4 cc rejects this. */
1118 char *t;
1119 char const *s = 0 ? (char *) 0 : (char const *) 0;
1120
1121 *t++ = 0;
1122}
1123{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
1124 int x[] = {25,17};
1125 const int *foo = &x[0];
1126 ++foo;
1127}
1128{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1129 typedef const int *iptr;
1130 iptr p = 0;
1131 ++p;
1132}
1133{ /* AIX XL C 1.02.0.0 rejects this saying
1134 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
1135 struct s { int j; const int *ap[3]; };
1136 struct s *b; b->j = 5;
1137}
1138{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1139 const int foo = 10;
1140}'
1141echo checking for lack of working const
1142cat > conftest.c <<EOF
1143#include "confdefs.h"
1144
1145int main() { exit(0); }
1146int t() { $prog }
1147EOF
1148if eval $compile; then
1149 :
1150else
1151 rm -rf conftest*
1152
1153{
1154test -n "$verbose" && \
1155echo " defining" const to be empty
1156echo "#define" const >> confdefs.h
1157DEFS="$DEFS -Dconst="
1158}
1159
1160fi
1161rm -f conftest*
1162
1163echo checking for prototypes
1164cat > conftest.c <<EOF
1165#include "confdefs.h"
1166int foo(int x){return 0;} int main(){return foo(10);}
1167EOF
1168eval $compile
1169if test -s conftest && (./conftest; exit) 2>/dev/null; then
1170
1171{
1172test -n "$verbose" && \
1173echo " defining HAVE_PROTOTYPES"
1174echo "#define" HAVE_PROTOTYPES 1 >> confdefs.h
1175DEFS="$DEFS -DHAVE_PROTOTYPES=1"
1176}
1177 have_prototypes=1
1178
1179fi
1180rm -fr conftest*
1181if test "$have_prototypes"; then
1182echo checking for "bad exec* prototypes"
1183cat > conftest.c <<EOF
1184#include "confdefs.h"
1185#include <unistd.h>
1186int main() { exit(0); }
1187int t() { char *const*t;execve("@",t,t); }
1188EOF
1189if eval $compile; then
1190 :
1191else
1192 rm -rf conftest*
1193
1194{
1195test -n "$verbose" && \
1196echo " defining BAD_EXEC_PROTOTYPES"
1197echo "#define" BAD_EXEC_PROTOTYPES 1 >> confdefs.h
1198DEFS="$DEFS -DBAD_EXEC_PROTOTYPES=1"
1199}
1200
1201fi
1202rm -f conftest*
1203
1204fi
1205
1206# checks for system services
1207# (none yet)
1208
1209# other checks for UNIX variants
1210LIBS_save="${LIBS}"
1211LIBS="${LIBS} -lsun"
1212have_lib=""
1213echo checking for -lsun
1214cat > conftest.c <<EOF
1215#include "confdefs.h"
1216
1217int main() { exit(0); }
1218int t() { main(); }
1219EOF
1220if eval $compile; then
1221 rm -rf conftest*
1222 have_lib="1"
1223
1224fi
1225rm -f conftest*
1226LIBS="${LIBS_save}"
1227if test -n "${have_lib}"; then
1228 :; LIBS="$LIBS -lsun"
1229else
1230 :;
1231fi
1232
1233
1234echo checking for Xenix
1235cat > conftest.c <<EOF
1236#include "confdefs.h"
1237#if defined(M_XENIX) && !defined(M_UNIX)
1238 yes
1239#endif
1240
1241EOF
1242eval "$CPP conftest.c > conftest.out 2>&1"
1243if egrep "yes" conftest.out >/dev/null 2>&1; then
1244 rm -rf conftest*
1245 XENIX=1
1246
1247fi
1248rm -f conftest*
1249
1250if test -n "$XENIX"; then
1251 LIBS="$LIBS -lx"
1252 case "$DEFS" in
1253 *SYSNDIR*) ;;
1254 *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
1255 esac
1256fi
1257
1258
1259# generate output files
1260# Set default prefixes.
1261if test -n "$prefix"; then
1262 test -z "$exec_prefix" && exec_prefix='${prefix}'
1263 prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
1264fi
1265if test -n "$exec_prefix"; then
1266 prsub="$prsub
1267s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
1268fi
1269# Quote sed substitution magic chars in DEFS.
1270cat >conftest.def <<EOF
1271$DEFS
1272EOF
1273escape_ampersand_and_backslash='s%[&\\]%\\&%g'
1274DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
1275rm -f conftest.def
1276# Substitute for predefined variables.
1277
1278trap 'rm -f config.status; exit 1' 1 3 15
1279echo creating config.status
1280rm -f config.status
1281cat > config.status <<EOF
1282#!/bin/sh
1283# Generated automatically by configure.
1284# Run this file to recreate the current configuration.
1285# This directory was configured as follows,
1286# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
1287#
1288# $0 $configure_args
1289
1290for arg
1291do
1292 case "\$arg" in
1293 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
1294 echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
1295 exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
1296 *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
1297 esac
1298done
1299
1300trap 'rm -f Objects/Makefile Parser/Makefile Python/Makefile; exit 1' 1 3 15
1301CC='$CC'
1302RANLIB='$RANLIB'
1303CPP='$CPP'
1304LIBOBJS='$LIBOBJS'
1305LIBS='$LIBS'
1306srcdir='$srcdir'
1307DEFS='$DEFS'
1308prefix='$prefix'
1309exec_prefix='$exec_prefix'
1310prsub='$prsub'
1311extrasub='$extrasub'
1312EOF
1313cat >> config.status <<\EOF
1314
1315top_srcdir=$srcdir
1316
1317CONFIG_FILES=${CONFIG_FILES-"Objects/Makefile Parser/Makefile Python/Makefile"}
1318for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
1319 srcdir=$top_srcdir
1320 # Remove last slash and all that follows it. Not all systems have dirname.
1321 dir=`echo $file|sed 's%/[^/][^/]*$%%'`
1322 if test "$dir" != "$file"; then
1323 test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
1324 test ! -d $dir && mkdir $dir
1325 fi
1326 echo creating $file
1327 rm -f $file
1328 echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
1329 sed -e "
1330$prsub
1331$extrasub
1332s%@CC@%$CC%g
1333s%@RANLIB@%$RANLIB%g
1334s%@CPP@%$CPP%g
1335s%@LIBOBJS@%$LIBOBJS%g
1336s%@LIBS@%$LIBS%g
1337s%@srcdir@%$srcdir%g
1338s%@DEFS@%$DEFS%
1339" $top_srcdir/${file}.in >> $file
1340fi; done
1341
1342
1343exit 0
1344EOF
1345chmod +x config.status
1346${CONFIG_SHELL-/bin/sh} config.status
1347