At the release of 1.0.1.
[python/dscho.git] / configure
blob43bc6865e91a5d83c2f529b2777056adcbe1e7db
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.
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.
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.
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.
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.
26 for arg
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 ;;
44      -gas | --gas | --ga | --g) ;;
46      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
47      -host | --host | --hos | --ho | --h)
48         next_host=yes ;;
50      -nfp | --nfp | --nf) ;;
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 ;;
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 ;;
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'" ;;
75      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
76        verbose=yes ;;
78      *) ;;
79     esac
80   fi
81 done
83 trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
84 trap 'rm -f confdefs*' 0
86 # NLS nuisances.
87 # These must not be set unconditionally because not all systems understand
88 # e.g. LANG=C (notably SCO).
89 if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
90 if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
92 rm -f conftest* confdefs.h
93 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
94 echo > confdefs.h
95 compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
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.
99 unique_file=Include/object.h
101 # Find the source files, if location was not specified.
102 if 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
113 if 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
121 # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
122 # But we can't avoid them for `..', to make subdirectories work.
123 case $srcdir in
124   .|/*|~*) ;;
125   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
126 esac
129 # Save the original args to write them into config.status later.
130 configure_args="$*"
133 # checks for alternative programs
134 if 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"
148 test -z "$CC" && CC="cc"
149 test -n "$CC" && test -n "$verbose" && echo "   setting CC to $CC"
151 # Find out if we are using GNU C, under whatever name.
152 cat > conftest.c <<EOF
153 #ifdef __GNUC__
154   yes
155 #endif
157 ${CC-cc} -E conftest.c > conftest.out 2>&1
158 if egrep yes conftest.out >/dev/null 2>&1; then
159   GCC=1 # For later tests.
161 rm -f conftest*
163 if 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"
177 test -z "$RANLIB" && RANLIB=":"
178 test -n "$RANLIB" && test -n "$verbose" && echo "       setting RANLIB to $RANLIB"
181 # checks for UNIX variants that set C preprocessor variables
182 echo checking for AIX
183 echo checking how to run the C preprocessor
184 if 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>
192 Syntax Error
194 err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
195 if test -z "$err"; then
196   :
197 else
198   rm -rf conftest*
199   CPP=/lib/cpp
201 rm -f conftest*
203 test ".${verbose}" != "." && echo "     setting CPP to $CPP"
205 cat > conftest.c <<EOF
206 #include "confdefs.h"
207 #ifdef _AIX
208   yes
209 #endif
212 eval "$CPP conftest.c > conftest.out 2>&1"
213 if egrep "yes" conftest.out >/dev/null 2>&1; then
214   rm -rf conftest*
215   
217 test -n "$verbose" && \
218 echo "  defining _ALL_SOURCE"
219 echo "#define" _ALL_SOURCE 1 >> confdefs.h
220 DEFS="$DEFS -D_ALL_SOURCE=1"
225 rm -f conftest*
228 echo checking for POSIXized ISC
229 if test -d /etc/conf/kconfig.d &&
230   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
231 then
232   ISC=1 # If later tests want to check for ISC.
233   
235 test -n "$verbose" && \
236 echo "  defining _POSIX_SOURCE"
237 echo "#define" _POSIX_SOURCE 1 >> confdefs.h
238 DEFS="$DEFS -D_POSIX_SOURCE=1"
241   if test -n "$GCC"; then
242     CC="$CC -posix"
243   else
244     CC="$CC -Xp"
245   fi
248 echo checking for minix/config.h
249 cat > conftest.c <<EOF
250 #include "confdefs.h"
251 #include <minix/config.h>
253 err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
254 if test -z "$err"; then
255   rm -rf conftest*
256   MINIX=1
259 rm -f conftest*
261 # The Minix shell can't assign to the same variable on the same line!
262 if test -n "$MINIX"; then
263   
265 test -n "$verbose" && \
266 echo "  defining _POSIX_SOURCE"
267 echo "#define" _POSIX_SOURCE 1 >> confdefs.h
268 DEFS="$DEFS -D_POSIX_SOURCE=1"
271   
273 test -n "$verbose" && \
274 echo "  defining" _POSIX_1_SOURCE to be 2
275 echo "#define" _POSIX_1_SOURCE 2 >> confdefs.h
276 DEFS="$DEFS -D_POSIX_1_SOURCE=2"
279   
281 test -n "$verbose" && \
282 echo "  defining _MINIX"
283 echo "#define" _MINIX 1 >> confdefs.h
284 DEFS="$DEFS -D_MINIX=1"
289 LIBS_save="${LIBS}"
290 LIBS="${LIBS} -lseq"
291 have_lib=""
292 echo checking for -lseq
293 cat > conftest.c <<EOF
294 #include "confdefs.h"
296 int main() { exit(0); }
297 int t() { main(); }
299 if eval $compile; then
300   rm -rf conftest*
301   have_lib="1"
304 rm -f conftest*
305 LIBS="${LIBS_save}"
306 if test -n "${have_lib}"; then
307    :; LIBS="$LIBS -lseq"
308 else
309    :; 
314 # checks for header files
315 echo checking for ANSI C header files
316 cat > conftest.c <<EOF
317 #include "confdefs.h"
318 #include <stdlib.h>
319 #include <stdarg.h>
320 #include <string.h>
321 #include <float.h>
323 err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
324 if test -z "$err"; then
325   rm -rf conftest*
326   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
327 echo '#include "confdefs.h"
328 #include <string.h>' > conftest.c
329 eval "$CPP conftest.c > conftest.out 2>&1"
330 if 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.
333 cat > 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)))
339 int main () { int i; for (i = 0; i < 256; i++)
340 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
341 exit (0); }
344 eval $compile
345 if test -s conftest && (./conftest; exit) 2>/dev/null; then
346   
348 test -n "$verbose" && \
349 echo "  defining STDC_HEADERS"
350 echo "#define" STDC_HEADERS 1 >> confdefs.h
351 DEFS="$DEFS -DSTDC_HEADERS=1"
356 rm -fr conftest*
359 rm -f conftest*
363 rm -f conftest*
365 for hdr in dlfcn.h signal.h stdarg.h unistd.h utime.h sys/param.h sys/select.h sys/times.h sys/utsname.h
367 trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
368 echo checking for ${hdr}
369 cat > conftest.c <<EOF
370 #include "confdefs.h"
371 #include <${hdr}>
373 err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
374 if test -z "$err"; then
375   rm -rf conftest*
376   
378 test -n "$verbose" && \
379 echo "  defining ${trhdr}"
380 echo "#define" ${trhdr} 1 >> confdefs.h
381 DEFS="$DEFS -D${trhdr}=1"
386 rm -f conftest*
387 done
389 echo checking for directory library header
390 dirheader=
391 if test -z "$dirheader"; then
392   echo checking for dirent.h
393 cat > conftest.c <<EOF
394 #include "confdefs.h"
395 #include <sys/types.h>
396 #include <dirent.h>
397 int main() { exit(0); }
398 int t() { DIR *dirp = 0; }
400 if eval $compile; then
401   rm -rf conftest*
402   
404 test -n "$verbose" && \
405 echo "  defining DIRENT"
406 echo "#define" DIRENT 1 >> confdefs.h
407 DEFS="$DEFS -DDIRENT=1"
409  dirheader=dirent.h
412 rm -f conftest*
414 if test -z "$dirheader"; then
415   echo checking for sys/ndir.h
416 cat > conftest.c <<EOF
417 #include "confdefs.h"
418 #include <sys/types.h>
419 #include <sys/ndir.h>
420 int main() { exit(0); }
421 int t() { DIR *dirp = 0; }
423 if eval $compile; then
424   rm -rf conftest*
425   
427 test -n "$verbose" && \
428 echo "  defining SYSNDIR"
429 echo "#define" SYSNDIR 1 >> confdefs.h
430 DEFS="$DEFS -DSYSNDIR=1"
432  dirheader=sys/ndir.h
435 rm -f conftest*
437 if test -z "$dirheader"; then
438   echo checking for sys/dir.h
439 cat > conftest.c <<EOF
440 #include "confdefs.h"
441 #include <sys/types.h>
442 #include <sys/dir.h>
443 int main() { exit(0); }
444 int t() { DIR *dirp = 0; }
446 if eval $compile; then
447   rm -rf conftest*
448   
450 test -n "$verbose" && \
451 echo "  defining SYSDIR"
452 echo "#define" SYSDIR 1 >> confdefs.h
453 DEFS="$DEFS -DSYSDIR=1"
455  dirheader=sys/dir.h
458 rm -f conftest*
460 if test -z "$dirheader"; then
461   echo checking for ndir.h
462 cat > conftest.c <<EOF
463 #include "confdefs.h"
464 #include <sys/types.h>
465 #include <ndir.h>
466 int main() { exit(0); }
467 int t() { DIR *dirp = 0; }
469 if eval $compile; then
470   rm -rf conftest*
471   
473 test -n "$verbose" && \
474 echo "  defining NDIR"
475 echo "#define" NDIR 1 >> confdefs.h
476 DEFS="$DEFS -DNDIR=1"
478  dirheader=ndir.h
481 rm -f conftest*
484 echo checking for closedir return value
485 cat > conftest.c <<EOF
486 #include "confdefs.h"
487 #include <sys/types.h>
488 #include <$dirheader>
489 int closedir(); main() { exit(closedir(opendir(".")) != 0); }
491 eval $compile
492 if test -s conftest && (./conftest; exit) 2>/dev/null; then
493   :
494 else
495   
497 test -n "$verbose" && \
498 echo "  defining VOID_CLOSEDIR"
499 echo "#define" VOID_CLOSEDIR 1 >> confdefs.h
500 DEFS="$DEFS -DVOID_CLOSEDIR=1"
504 rm -fr conftest*
507 # checks for typedefs
508 echo checking for uid_t in sys/types.h
509 echo '#include "confdefs.h"
510 #include <sys/types.h>' > conftest.c
511 eval "$CPP conftest.c > conftest.out 2>&1"
512 if egrep "uid_t" conftest.out >/dev/null 2>&1; then
513   :
514 else
515   rm -rf conftest*
516   
518 test -n "$verbose" && \
519 echo "  defining" uid_t to be int
520 echo "#define" uid_t int >> confdefs.h
521 DEFS="$DEFS -Duid_t=int"
525 test -n "$verbose" && \
526 echo "  defining" gid_t to be int
527 echo "#define" gid_t int >> confdefs.h
528 DEFS="$DEFS -Dgid_t=int"
532 rm -f conftest*
534 echo checking for type of array argument to getgroups
535 prog='/* 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))
540 main()
542   gid_t gidset[NGID];
543   int i, n;
544   union { gid_t gval; long lval; }  val;
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);
555 cat > conftest.c <<EOF
556 #include "confdefs.h"
557 $prog
559 eval $compile
560 if test -s conftest && (./conftest; exit) 2>/dev/null; then
561   
563 test -n "$verbose" && \
564 echo "  defining" GETGROUPS_T to be gid_t
565 echo "#define" GETGROUPS_T gid_t >> confdefs.h
566 DEFS="$DEFS -DGETGROUPS_T=gid_t"
570 else
571   
573 test -n "$verbose" && \
574 echo "  defining" GETGROUPS_T to be int
575 echo "#define" GETGROUPS_T int >> confdefs.h
576 DEFS="$DEFS -DGETGROUPS_T=int"
580 rm -fr conftest*
582 echo checking for mode_t in sys/types.h
583 echo '#include "confdefs.h"
584 #include <sys/types.h>' > conftest.c
585 eval "$CPP conftest.c > conftest.out 2>&1"
586 if egrep "mode_t" conftest.out >/dev/null 2>&1; then
587   :
588 else
589   rm -rf conftest*
590   
592 test -n "$verbose" && \
593 echo "  defining" mode_t to be int
594 echo "#define" mode_t int >> confdefs.h
595 DEFS="$DEFS -Dmode_t=int"
599 rm -f conftest*
601 echo checking for off_t in sys/types.h
602 echo '#include "confdefs.h"
603 #include <sys/types.h>' > conftest.c
604 eval "$CPP conftest.c > conftest.out 2>&1"
605 if egrep "off_t" conftest.out >/dev/null 2>&1; then
606   :
607 else
608   rm -rf conftest*
609   
611 test -n "$verbose" && \
612 echo "  defining" off_t to be long
613 echo "#define" off_t long >> confdefs.h
614 DEFS="$DEFS -Doff_t=long"
618 rm -f conftest*
620 echo checking for pid_t in sys/types.h
621 echo '#include "confdefs.h"
622 #include <sys/types.h>' > conftest.c
623 eval "$CPP conftest.c > conftest.out 2>&1"
624 if egrep "pid_t" conftest.out >/dev/null 2>&1; then
625   :
626 else
627   rm -rf conftest*
628   
630 test -n "$verbose" && \
631 echo "  defining" pid_t to be int
632 echo "#define" pid_t int >> confdefs.h
633 DEFS="$DEFS -Dpid_t=int"
637 rm -f conftest*
639 echo checking for return type of signal handlers
640 cat > conftest.c <<EOF
641 #include "confdefs.h"
642 #include <sys/types.h>
643 #include <signal.h>
644 #ifdef signal
645 #undef signal
646 #endif
647 extern void (*signal ()) ();
648 int main() { exit(0); }
649 int t() { int i; }
651 if eval $compile; then
652   rm -rf conftest*
653   
655 test -n "$verbose" && \
656 echo "  defining" RETSIGTYPE to be void
657 echo "#define" RETSIGTYPE void >> confdefs.h
658 DEFS="$DEFS -DRETSIGTYPE=void"
662 else
663   rm -rf conftest*
664   
666 test -n "$verbose" && \
667 echo "  defining" RETSIGTYPE to be int
668 echo "#define" RETSIGTYPE int >> confdefs.h
669 DEFS="$DEFS -DRETSIGTYPE=int"
673 rm -f conftest*
676 echo checking for size_t in sys/types.h
677 echo '#include "confdefs.h"
678 #include <sys/types.h>' > conftest.c
679 eval "$CPP conftest.c > conftest.out 2>&1"
680 if egrep "size_t" conftest.out >/dev/null 2>&1; then
681   :
682 else
683   rm -rf conftest*
684   
686 test -n "$verbose" && \
687 echo "  defining" size_t to be unsigned
688 echo "#define" size_t unsigned >> confdefs.h
689 DEFS="$DEFS -Dsize_t=unsigned"
693 rm -f conftest*
695 echo checking for uid_t in sys/types.h
696 echo '#include "confdefs.h"
697 #include <sys/types.h>' > conftest.c
698 eval "$CPP conftest.c > conftest.out 2>&1"
699 if egrep "uid_t" conftest.out >/dev/null 2>&1; then
700   :
701 else
702   rm -rf conftest*
703   
705 test -n "$verbose" && \
706 echo "  defining" uid_t to be int
707 echo "#define" uid_t int >> confdefs.h
708 DEFS="$DEFS -Duid_t=int"
712 test -n "$verbose" && \
713 echo "  defining" gid_t to be int
714 echo "#define" gid_t int >> confdefs.h
715 DEFS="$DEFS -Dgid_t=int"
719 rm -f conftest*
722 # checks for libraries
723 LIBS_save="${LIBS}"
724 LIBS="${LIBS} -ldl"
725 have_lib=""
726 echo checking for -ldl
727 cat > conftest.c <<EOF
728 #include "confdefs.h"
730 int main() { exit(0); }
731 int t() { main(); }
733 if eval $compile; then
734   rm -rf conftest*
735   have_lib="1"
738 rm -f conftest*
739 LIBS="${LIBS_save}"
740 if test -n "${have_lib}"; then
741    
743 test -n "$verbose" && \
744 echo "  defining HAVE_LIBDL"
745 echo "#define" HAVE_LIBDL 1 >> confdefs.h
746 DEFS="$DEFS -DHAVE_LIBDL=1"
749    LIBS="${LIBS} -ldl"
752 LIBS="${LIBS} -L${READLINESRC-${PWD-${CWD-`pwd`}}/readline}"
753 LIBS_save="${LIBS}"
754 LIBS="${LIBS} -lreadline"
755 have_lib=""
756 echo checking for -lreadline
757 cat > conftest.c <<EOF
758 #include "confdefs.h"
760 int main() { exit(0); }
761 int t() { main(); }
763 if eval $compile; then
764   rm -rf conftest*
765   have_lib="1"
768 rm -f conftest*
769 LIBS="${LIBS_save}"
770 if test -n "${have_lib}"; then
771    
773 test -n "$verbose" && \
774 echo "  defining HAVE_LIBREADLINE"
775 echo "#define" HAVE_LIBREADLINE 1 >> confdefs.h
776 DEFS="$DEFS -DHAVE_LIBREADLINE=1"
779    LIBS="${LIBS} -lreadline"
782 if test -n "${have_lib}"; then
783 LIBS_save="${LIBS}"
784 LIBS="${LIBS} -ltermcap"
785 have_lib=""
786 echo checking for -ltermcap
787 cat > conftest.c <<EOF
788 #include "confdefs.h"
790 int main() { exit(0); }
791 int t() { main(); }
793 if eval $compile; then
794   rm -rf conftest*
795   have_lib="1"
798 rm -f conftest*
799 LIBS="${LIBS_save}"
800 if test -n "${have_lib}"; then
801    
803 test -n "$verbose" && \
804 echo "  defining HAVE_LIBTERMCAP"
805 echo "#define" HAVE_LIBTERMCAP 1 >> confdefs.h
806 DEFS="$DEFS -DHAVE_LIBTERMCAP=1"
809    LIBS="${LIBS} -ltermcap"
814 # Check for IRIX or SOLARIS thread interface
815 LIBS_save="${LIBS}"
816 LIBS="${LIBS} -lmpc"
817 have_lib=""
818 echo checking for -lmpc
819 cat > conftest.c <<EOF
820 #include "confdefs.h"
822 int main() { exit(0); }
823 int t() { main(); }
825 if eval $compile; then
826   rm -rf conftest*
827   have_lib="1"
830 rm -f conftest*
831 LIBS="${LIBS_save}"
832 if test -n "${have_lib}"; then
833    
835 test -n "$verbose" && \
836 echo "  defining HAVE_LIBMPC"
837 echo "#define" HAVE_LIBMPC 1 >> confdefs.h
838 DEFS="$DEFS -DHAVE_LIBMPC=1"
841    LIBS="${LIBS} -lmpc"
844 if test -n "${have_lib}"; then
845 DEFS="${DEFS} -DUSE_THREAD"
846 LIBOBJS="${LIBOBJS} thread.o"
849 LIBS_save="${LIBS}"
850 LIBS="${LIBS} -lthread"
851 have_lib=""
852 echo checking for -lthread
853 cat > conftest.c <<EOF
854 #include "confdefs.h"
856 int main() { exit(0); }
857 int t() { main(); }
859 if eval $compile; then
860   rm -rf conftest*
861   have_lib="1"
864 rm -f conftest*
865 LIBS="${LIBS_save}"
866 if test -n "${have_lib}"; then
867    
869 test -n "$verbose" && \
870 echo "  defining HAVE_LIBTHREAD"
871 echo "#define" HAVE_LIBTHREAD 1 >> confdefs.h
872 DEFS="$DEFS -DHAVE_LIBTHREAD=1"
875    LIBS="${LIBS} -lthread"
878 if test -n "${have_lib}"; then
879 DEFS="${DEFS} -DUSE_THREAD"
880 LIBOBJS="${LIBOBJS} thread.o"
883 # checks for library functions
884 for func in clock ftime gettimeofday getpgrp getwd lstat readlink readline select setsid setpgid setpgrp siginterrupt symlink tcgetpgrp tcsetpgrp times uname waitpid
886 trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
887 echo checking for ${func}
888 cat > conftest.c <<EOF
889 #include "confdefs.h"
890 #include <ctype.h>
891 int main() { exit(0); }
892 int 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})
897 choke me
898 #else
899 /* Override any gcc2 internal prototype to avoid an error.  */
900 extern char ${func}(); ${func}();
901 #endif
904 if eval $compile; then
905   rm -rf conftest*
906   {
907 test -n "$verbose" && \
908 echo "  defining ${trfunc}"
909 echo "#define" ${trfunc} 1 >> confdefs.h
910 DEFS="$DEFS -D${trfunc}=1"
915 rm -f conftest*
916 done
918 for func in dup2 getcwd strerror strtoul strtod memmove
920 echo checking for ${func}
921 cat > conftest.c <<EOF
922 #include "confdefs.h"
923 #include <ctype.h>
924 int main() { exit(0); }
925 int 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})
930 choke me
931 #else
932 /* Override any gcc2 internal prototype to avoid an error.  */
933 extern char ${func}(); ${func}();
934 #endif
937 if eval $compile; then
938   :
939 else
940   rm -rf conftest*
941   LIBOBJS="$LIBOBJS ${func}.o"
942 test -n "$verbose" && echo "    using ${func}.o instead"
944 rm -f conftest*
946 done
948 echo checking for getpgrp
949 cat > conftest.c <<EOF
950 #include "confdefs.h"
951 #include <ctype.h>
952 int main() { exit(0); }
953 int 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)
958 choke me
959 #else
960 /* Override any gcc2 internal prototype to avoid an error.  */
961 extern char getpgrp(); getpgrp();
962 #endif
965 if eval $compile; then
966   rm -rf conftest*
967   echo checking for argument to getpgrp
968 cat > conftest.c <<EOF
969 #include "confdefs.h"
970 #include <unistd.h>
971 int main() { exit(0); }
972 int t() { getpgrp(0); }
974 if eval $compile; then
975   rm -rf conftest*
976   
978 test -n "$verbose" && \
979 echo "  defining GETPGRP_HAVE_ARG"
980 echo "#define" GETPGRP_HAVE_ARG 1 >> confdefs.h
981 DEFS="$DEFS -DGETPGRP_HAVE_ARG=1"
986 rm -f conftest*
990 rm -f conftest*
993 # checks for structures
994 echo checking for whether time.h and sys/time.h may both be included
995 cat > conftest.c <<EOF
996 #include "confdefs.h"
997 #include <sys/types.h>
998 #include <sys/time.h>
999 #include <time.h>
1000 int main() { exit(0); }
1001 int t() { struct tm *tp; }
1003 if eval $compile; then
1004   rm -rf conftest*
1005   
1007 test -n "$verbose" && \
1008 echo "  defining TIME_WITH_SYS_TIME"
1009 echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h
1010 DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
1015 rm -f conftest*
1017 echo checking for struct tm in time.h
1018 cat > conftest.c <<EOF
1019 #include "confdefs.h"
1020 #include <sys/types.h>
1021 #include <time.h>
1022 int main() { exit(0); }
1023 int t() { struct tm *tp; tp->tm_sec; }
1025 if eval $compile; then
1026   :
1027 else
1028   rm -rf conftest*
1029   
1031 test -n "$verbose" && \
1032 echo "  defining TM_IN_SYS_TIME"
1033 echo "#define" TM_IN_SYS_TIME 1 >> confdefs.h
1034 DEFS="$DEFS -DTM_IN_SYS_TIME=1"
1038 rm -f conftest*
1040 decl='#include <sys/types.h>
1042 case "$DEFS" in
1043   *TM_IN_SYS_TIME*) decl="$decl
1044 #include <sys/time.h>
1045 " ;;
1046   *) decl="$decl
1047 #include <time.h>
1048 " ;;
1049 esac
1050 echo checking for tm_zone in struct tm
1051 cat > conftest.c <<EOF
1052 #include "confdefs.h"
1053 $decl
1054 int main() { exit(0); }
1055 int t() { struct tm tm; tm.tm_zone; }
1057 if eval $compile; then
1058   rm -rf conftest*
1059   
1061 test -n "$verbose" && \
1062 echo "  defining HAVE_TM_ZONE"
1063 echo "#define" HAVE_TM_ZONE 1 >> confdefs.h
1064 DEFS="$DEFS -DHAVE_TM_ZONE=1"
1068 else
1069   rm -rf conftest*
1070   no_tm_zone=1
1072 rm -f conftest*
1074 if test -n "$no_tm_zone"; then
1075 echo checking for tzname
1076 cat > conftest.c <<EOF
1077 #include "confdefs.h"
1078 #include <time.h>
1079 #ifndef tzname /* For SGI.  */
1080 extern char *tzname[]; /* RS6000 and others want it this way.  */
1081 #endif
1082 int main() { exit(0); }
1083 int t() { atoi(*tzname); }
1085 if eval $compile; then
1086   rm -rf conftest*
1087   
1089 test -n "$verbose" && \
1090 echo "  defining HAVE_TZNAME"
1091 echo "#define" HAVE_TZNAME 1 >> confdefs.h
1092 DEFS="$DEFS -DHAVE_TZNAME=1"
1097 rm -f conftest*
1102 # checks for compiler characteristics
1103 prog='/* Ultrix mips cc rejects this.  */
1104 typedef int charset[2]; const charset x;
1105 /* SunOS 4.1.1 cc rejects this.  */
1106 char const *const *ccp;
1107 char **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 */
1111 const char *g = "string";
1112 ccp = &g + (g ? g-g : 0);
1113 /* HPUX 7.0 cc rejects these. */
1114 ++ccp;
1115 p = (char**) ccp;
1116 ccp = (char const *const *) p;
1117 { /* SCO 3.2v4 cc rejects this.  */
1118   char *t;
1119   char const *s = 0 ? (char *) 0 : (char const *) 0;
1121   *t++ = 0;
1123 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
1124   int x[] = {25,17};
1125   const int *foo = &x[0];
1126   ++foo;
1128 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
1129   typedef const int *iptr;
1130   iptr p = 0;
1131   ++p;
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;
1138 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
1139   const int foo = 10;
1141 echo checking for lack of working const
1142 cat > conftest.c <<EOF
1143 #include "confdefs.h"
1145 int main() { exit(0); }
1146 int t() { $prog }
1148 if eval $compile; then
1149   :
1150 else
1151   rm -rf conftest*
1152   
1154 test -n "$verbose" && \
1155 echo "  defining" const to be empty
1156 echo "#define" const  >> confdefs.h
1157 DEFS="$DEFS -Dconst="
1161 rm -f conftest*
1163 echo checking for prototypes
1164 cat > conftest.c <<EOF
1165 #include "confdefs.h"
1166 int foo(int x){return 0;} int main(){return foo(10);}
1168 eval $compile
1169 if test -s conftest && (./conftest; exit) 2>/dev/null; then
1170   
1172 test -n "$verbose" && \
1173 echo "  defining HAVE_PROTOTYPES"
1174 echo "#define" HAVE_PROTOTYPES 1 >> confdefs.h
1175 DEFS="$DEFS -DHAVE_PROTOTYPES=1"
1177  have_prototypes=1
1180 rm -fr conftest*
1181 if test "$have_prototypes"; then
1182 echo checking for "bad exec* prototypes"
1183 cat > conftest.c <<EOF
1184 #include "confdefs.h"
1185 #include <unistd.h>
1186 int main() { exit(0); }
1187 int t() { char *const*t;execve("@",t,t); }
1189 if eval $compile; then
1190   :
1191 else
1192   rm -rf conftest*
1193   
1195 test -n "$verbose" && \
1196 echo "  defining BAD_EXEC_PROTOTYPES"
1197 echo "#define" BAD_EXEC_PROTOTYPES 1 >> confdefs.h
1198 DEFS="$DEFS -DBAD_EXEC_PROTOTYPES=1"
1202 rm -f conftest*
1206 # checks for system services
1207 # (none yet)
1209 # other checks for UNIX variants
1210 LIBS_save="${LIBS}"
1211 LIBS="${LIBS} -lsun"
1212 have_lib=""
1213 echo checking for -lsun
1214 cat > conftest.c <<EOF
1215 #include "confdefs.h"
1217 int main() { exit(0); }
1218 int t() { main(); }
1220 if eval $compile; then
1221   rm -rf conftest*
1222   have_lib="1"
1225 rm -f conftest*
1226 LIBS="${LIBS_save}"
1227 if test -n "${have_lib}"; then
1228    :; LIBS="$LIBS -lsun"
1229 else
1230    :; 
1234 echo checking for Xenix
1235 cat > conftest.c <<EOF
1236 #include "confdefs.h"
1237 #if defined(M_XENIX) && !defined(M_UNIX)
1238   yes
1239 #endif
1242 eval "$CPP conftest.c > conftest.out 2>&1"
1243 if egrep "yes" conftest.out >/dev/null 2>&1; then
1244   rm -rf conftest*
1245   XENIX=1
1248 rm -f conftest*
1250 if 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
1259 # generate output files
1260 # Set default prefixes.
1261 if test -n "$prefix"; then
1262   test -z "$exec_prefix" && exec_prefix='${prefix}'
1263   prsub="s%^prefix\\([  ]*\\)=\\([      ]*\\).*$%prefix\\1=\\2$prefix%"
1265 if test -n "$exec_prefix"; then
1266   prsub="$prsub
1267 s%^exec_prefix\\([      ]*\\)=\\([      ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
1269 # Quote sed substitution magic chars in DEFS.
1270 cat >conftest.def <<EOF
1271 $DEFS
1273 escape_ampersand_and_backslash='s%[&\\]%\\&%g'
1274 DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
1275 rm -f conftest.def
1276 # Substitute for predefined variables.
1278 trap 'rm -f config.status; exit 1' 1 3 15
1279 echo creating config.status
1280 rm -f config.status
1281 cat > 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`:
1288 # $0 $configure_args
1290 for arg
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
1298 done
1300 trap 'rm -f Objects/Makefile Parser/Makefile Python/Makefile; exit 1' 1 3 15
1301 CC='$CC'
1302 RANLIB='$RANLIB'
1303 CPP='$CPP'
1304 LIBOBJS='$LIBOBJS'
1305 LIBS='$LIBS'
1306 srcdir='$srcdir'
1307 DEFS='$DEFS'
1308 prefix='$prefix'
1309 exec_prefix='$exec_prefix'
1310 prsub='$prsub'
1311 extrasub='$extrasub'
1313 cat >> config.status <<\EOF
1315 top_srcdir=$srcdir
1317 CONFIG_FILES=${CONFIG_FILES-"Objects/Makefile Parser/Makefile Python/Makefile"}
1318 for 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
1332 s%@CC@%$CC%g
1333 s%@RANLIB@%$RANLIB%g
1334 s%@CPP@%$CPP%g
1335 s%@LIBOBJS@%$LIBOBJS%g
1336 s%@LIBS@%$LIBS%g
1337 s%@srcdir@%$srcdir%g
1338 s%@DEFS@%$DEFS%
1339 " $top_srcdir/${file}.in >> $file
1340 fi; done
1343 exit 0
1345 chmod +x config.status
1346 ${CONFIG_SHELL-/bin/sh} config.status