Add HOL Light and its dependencies.
[nixpkgs-libre.git] / pkgs / applications / science / logic / hol_light / configure-3.09.3
blobc52776894598cc3eb0abfb7e639f2a2836e2a565
1 #! /bin/sh
3 #########################################################################
4 # #
5 # Objective Caml #
6 # #
7 # Xavier Leroy, projet Cristal, INRIA Rocquencourt #
8 # #
9 # Copyright 1999 Institut National de Recherche en Informatique et #
10 # en Automatique. All rights reserved. This file is distributed #
11 # under the terms of the GNU Library General Public License, with #
12 # the special exception on linking described in file LICENSE. #
13 # #
14 #########################################################################
16 # $Id: configure,v 1.228.2.5 2006/03/30 10:00:19 doligez Exp $
18 configure_options="$*"
19 prefix=/usr/local
20 bindir=''
21 libdir=''
22 mandir=''
23 manext=1
24 host_type=unknown
25 ccoption=''
26 cclibs=''
27 curseslibs=''
28 mathlib='-lm'
29 dllib=''
30 x11_include_dir=''
31 x11_lib_dir=''
32 tk_wanted=yes
33 pthread_wanted=yes
34 tk_defs=''
35 tk_libs=''
36 tk_x11=yes
37 dl_defs=''
38 verbose=no
39 withcurses=yes
40 withsharedlibs=yes
41 gcc_warnings="-Wall"
43 # Try to turn internationalization off, can cause config.guess to malfunction!
44 unset LANG
45 unset LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
47 # Turn off some MacOS X debugging stuff, same reason
48 unset RC_TRACE_ARCHIVES RC_TRACE_DYLIBS RC_TRACE_PREBINDING_DISABLED
50 # Parse command-line arguments
52 while : ; do
53 case "$1" in
54 "") break;;
55 -prefix|--prefix)
56 prefix=$2; shift;;
57 -bindir|--bindir)
58 bindir=$2; shift;;
59 -libdir|--libdir)
60 libdir=$2; shift;;
61 -mandir|--mandir)
62 case "$2" in
63 */man[1-9ln])
64 mandir=`echo $2 | sed -e 's|^\(.*\)/man.$|\1|'`
65 manext=`echo $2 | sed -e 's/^.*\(.\)$/\1/'`;;
67 mandir=$2
68 manext=1;;
69 esac
70 shift;;
71 -host*|--host*)
72 host_type=$2; shift;;
73 -cc*)
74 ccoption="$2"; shift;;
75 -lib*)
76 cclibs="$2 $cclibs"; shift;;
77 -no-curses)
78 withcurses=no;;
79 -no-shared-libs)
80 withsharedlibs=no;;
81 -x11include*|--x11include*)
82 x11_include_dir=$2; shift;;
83 -x11lib*|--x11lib*)
84 x11_lib_dir=$2; shift;;
85 -with-pthread*|--with-pthread*)
86 ;; # Ignored for backward compatibility
87 -no-pthread*|--no-pthread*)
88 pthread_wanted=no;;
89 -no-tk|--no-tk)
90 tk_wanted=no;;
91 -tkdefs*|--tkdefs*)
92 tk_defs=$2; shift;;
93 -tklibs*|--tklibs*)
94 tk_libs=$2; shift;;
95 -tk-no-x11|--tk-no-x11)
96 tk_x11=no;;
97 -dldefs*|--dldefs*)
98 dl_defs="$2"; shift;;
99 -dllibs*|--dllibs*)
100 dllib="$2"; shift;;
101 -verbose|--verbose)
102 verbose=yes;;
103 *) echo "Unknown option \"$1\"." 1>&2; exit 2;;
104 esac
105 shift
106 done
108 # Sanity checks
110 case "$prefix" in
111 /*) ;;
112 *) echo "The -prefix directory must be absolute." 1>&2; exit 2;;
113 esac
114 case "$bindir" in
115 /*) ;;
116 "") ;;
117 *) echo "The -bindir directory must be absolute." 1>&2; exit 2;;
118 esac
119 case "$libdir" in
120 /*) ;;
121 "") ;;
122 *) echo "The -libdir directory must be absolute." 1>&2; exit 2;;
123 esac
124 case "$mandir" in
125 /*) ;;
126 "") ;;
127 *) echo "The -mandir directory must be absolute." 1>&2; exit 2;;
128 esac
130 # Generate the files
132 cd config/auto-aux
133 rm -f s.h m.h Makefile
134 touch s.h m.h Makefile
136 # Write options to Makefile
138 echo "# generated by ./configure $configure_options" >> Makefile
140 # Where to install
142 echo "PREFIX=$prefix" >> Makefile
143 case "$bindir" in
144 "") echo 'BINDIR=$(PREFIX)/bin' >> Makefile
145 bindir="$prefix/bin";;
146 *) echo "BINDIR=$bindir" >> Makefile;;
147 esac
148 case "$libdir" in
149 "") echo 'LIBDIR=$(PREFIX)/lib/ocaml' >> Makefile
150 libdir="$prefix/lib/ocaml";;
151 *) echo "LIBDIR=$libdir" >> Makefile;;
152 esac
153 echo 'STUBLIBDIR=$(LIBDIR)/stublibs' >> Makefile
154 case "$mandir" in
155 "") echo 'MANDIR=$(PREFIX)/man' >> Makefile
156 mandir="$prefix/man";;
157 *) echo "MANDIR=$mandir" >> Makefile;;
158 esac
159 echo "MANEXT=$manext" >> Makefile
161 # Determine the system type
163 if test "$host_type" = "unknown"; then
164 if host_type=`../gnu/config.guess`; then :; else
165 echo "Cannot guess host type"
166 echo "You must specify one with the -host option"
167 exit 2
170 if host=`../gnu/config.sub $host_type`; then :; else
171 echo "Please specify the correct host type with the -host option"
172 exit 2
174 echo "Configuring for a $host ..."
176 # Do we have gcc?
178 if test -z "$ccoption"; then
179 if sh ./searchpath gcc; then
180 echo "gcc found"
181 cc=gcc
182 else
183 cc=cc
185 else
186 cc="$ccoption"
189 # Check for buggy versions of GCC
191 buggycc="no"
193 case "$host,$cc" in
194 i[3456]86-*-*,gcc*)
195 case `$cc --version` in
196 2.7.2.1) cat <<'EOF'
198 WARNING: you are using gcc version 2.7.2.1 on an Intel x86 processor.
199 This version of gcc is known to generate incorrect code for the
200 Objective Caml runtime system on some Intel x86 machines. (The symptom
201 is a crash of boot/ocamlc when compiling stdlib/pervasives.mli.)
202 In particular, the version of gcc 2.7.2.1 that comes with
203 Linux RedHat 4.x / Intel is affected by this problem.
204 Other Linux distributions might also be affected.
205 If you are using one of these configurations, you are strongly advised
206 to use another version of gcc, such as 2.95, which are
207 known to work well with Objective Caml.
209 Press <enter> to proceed or <interrupt> to stop.
211 read reply;;
212 2.96*) cat <<'EOF'
214 WARNING: you are using gcc version 2.96 on an Intel x86 processor.
215 Certain patched versions of gcc 2.96 are known to generate incorrect
216 code for the Objective Caml runtime system. (The symptom is a segmentation
217 violation on boot/ocamlc.) Those incorrectly patched versions can be found
218 in RedHat 7.2 and Mandrake 8.0 and 8.1; other Linux distributions
219 might also be affected. (See bug #57760 on bugzilla.redhat.com)
221 Auto-configuration will now select gcc compiler flags that work around
222 the problem. Still, if you observe segmentation faults while running
223 ocamlc or ocamlopt, you are advised to try another version of gcc,
224 such as 2.95.3 or 3.2.
227 buggycc="gcc.2.96";;
229 esac;;
230 esac
232 # Configure the bytecode compiler
234 bytecc="$cc"
235 bytecccompopts=""
236 bytecclinkopts=""
237 ostype="Unix"
238 exe=""
240 case "$bytecc,$host" in
241 cc,*-*-nextstep*)
242 # GNU C extensions disabled, but __GNUC__ still defined!
243 bytecccompopts="-fno-defer-pop $gcc_warnings -U__GNUC__ -posix"
244 bytecclinkopts="-posix";;
245 *,*-*-rhapsody*)
246 # Almost the same as NeXTStep
247 bytecccompopts="-fno-defer-pop $gcc_warnings -DSHRINKED_GNUC"
248 mathlib="";;
249 *,*-*-darwin*)
250 # Almost the same as rhapsody
251 bytecccompopts="-fno-defer-pop -no-cpp-precomp $gcc_warnings"
252 mathlib="";;
253 *,*-*-beos*)
254 bytecccompopts="-fno-defer-pop $gcc_warnings"
255 # No -lm library
256 mathlib="";;
257 gcc,alpha*-*-osf*)
258 bytecccompopts="-fno-defer-pop $gcc_warnings"
259 if cc="$bytecc" sh ./hasgot -mieee; then
260 bytecccompopts="-mieee $bytecccompopts";
262 # Put code and static data in lower 4GB
263 bytecclinkopts="-Wl,-T,12000000 -Wl,-D,14000000"
264 # Tell gcc that we can use 32-bit code addresses for threaded code
265 echo "#define ARCH_CODE32" >> m.h;;
266 cc,alpha*-*-osf*)
267 bytecccompopts="-std1 -ieee";;
268 gcc,alpha*-*-linux*)
269 if cc="$bytecc" sh ./hasgot -mieee; then
270 bytecccompopts="-mieee $bytecccompopts";
271 fi;;
272 cc,mips-*-irix6*)
273 # Add -n32 flag to ensure compatibility with native-code compiler
274 bytecccompopts="-n32"
275 # Turn off warning "unused library"
276 bytecclinkopts="-n32 -Wl,-woff,84";;
277 cc*,mips-*-irix6*)
278 # (For those who want to force "cc -64")
279 # Turn off warning "unused library"
280 bytecclinkopts="-Wl,-woff,84";;
281 *,alpha*-*-unicos*)
282 # For the Cray T3E
283 bytecccompopts="-DUMK";;
284 gcc*,powerpc-*-aix*)
285 # Avoid name-space pollution by requiring Unix98-conformant includes
286 bytecccompopts="-fno-defer-pop $gcc_warnings -D_XOPEN_SOURCE=500";;
287 *,powerpc-*-aix*)
288 bytecccompopts="-D_XOPEN_SOURCE=500";;
289 gcc*,*-*-cygwin*)
290 bytecccompopts="-fno-defer-pop $gcc_warnings -U_WIN32"
291 exe=".exe"
292 ostype="Cygwin";;
293 gcc*,x86_64-*-linux*)
294 bytecccompopts="-fno-defer-pop $gcc_warnings"
295 # Tell gcc that we can use 32-bit code addresses for threaded code
296 # unless we are compiled for a shared library (-fPIC option)
297 echo "#ifndef __PIC__" >> m.h
298 echo "# define ARCH_CODE32" >> m.h
299 echo "#endif" >> m.h;;
300 gcc*)
301 bytecccompopts="-fno-defer-pop $gcc_warnings";;
302 esac
304 # Configure compiler to use in further tests
306 cc="$bytecc -O $bytecclinkopts"
307 export cc cclibs verbose
309 # Check C compiler
311 sh ./runtest ansi.c
312 case $? in
313 0) echo "The C compiler is ANSI-compliant.";;
314 1) echo "The C compiler $cc is not ANSI-compliant."
315 echo "You need an ANSI C compiler to build Objective Caml."
316 exit 2;;
317 *) echo "Unable to compile the test program."
318 echo "Make sure the C compiler $cc is properly installed."
319 exit 2;;
320 esac
322 # Check the sizes of data types
324 echo "Checking the sizes of integers and pointers..."
325 set `sh ./runtest sizes.c`
326 case "$2,$3" in
327 4,4) echo "OK, this is a regular 32 bit architecture."
328 echo "#undef ARCH_SIXTYFOUR" >> m.h;;
329 *,8) echo "Wow! A 64 bit architecture!"
330 echo "#define ARCH_SIXTYFOUR" >> m.h;;
331 *,*) echo "This architecture seems to be neither 32 bits nor 64 bits."
332 echo "Objective Caml won't run on this architecture."
333 exit 2;;
334 *) echo "Unable to compile the test program."
335 echo "Make sure the C compiler $cc is properly installed."
336 exit 2;;
337 esac
338 if test $1 != 4 && test $2 != 4 && test $4 != 4; then
339 echo "Sorry, we can't find a 32-bit integer type"
340 echo "(sizeof(short) = $4, sizeof(int) = $1, sizeof(long) = $2)"
341 echo "Objective Caml won't run on this architecture."
342 exit 2
345 echo "#define SIZEOF_INT $1" >> m.h
346 echo "#define SIZEOF_LONG $2" >> m.h
347 echo "#define SIZEOF_PTR $3" >> m.h
348 echo "#define SIZEOF_SHORT $4" >> m.h
350 if test $2 = 8; then
351 echo "#define ARCH_INT64_TYPE long" >> m.h
352 echo "#define ARCH_UINT64_TYPE unsigned long" >> m.h
353 echo '#define ARCH_INT64_PRINTF_FORMAT "l"' >> m.h
354 int64_native=true
355 else
356 sh ./runtest longlong.c
357 case $? in
358 0) echo "64-bit \"long long\" integer type found (printf with \"%ll\")."
359 echo "#define ARCH_INT64_TYPE long long" >> m.h
360 echo "#define ARCH_UINT64_TYPE unsigned long long" >> m.h
361 echo '#define ARCH_INT64_PRINTF_FORMAT "ll"' >> m.h
362 int64_native=true;;
363 1) echo "64-bit \"long long\" integer type found (printf with \"%q\")."
364 echo "#define ARCH_INT64_TYPE long long" >> m.h
365 echo "#define ARCH_UINT64_TYPE unsigned long long" >> m.h
366 echo '#define ARCH_INT64_PRINTF_FORMAT "q"' >> m.h
367 int64_native=true;;
368 2) echo "64-bit \"long long\" integer type found (but no printf)."
369 echo "#define ARCH_INT64_TYPE long long" >> m.h
370 echo "#define ARCH_UINT64_TYPE unsigned long long" >> m.h
371 echo '#undef ARCH_INT64_PRINTF_FORMAT' >> m.h
372 int64_native=true;;
373 *) echo "No suitable 64-bit integer type found, will use software emulation."
374 echo "#undef ARCH_INT64_TYPE" >> m.h
375 echo "#undef ARCH_UINT64_TYPE" >> m.h
376 echo '#undef ARCH_INT64_PRINTF_FORMAT' >> m.h
377 int64_native=false;;
378 esac
381 if test $3 = 8 && test $int64_native = false; then
382 echo "This architecture has 64-bit pointers but no 64-bit integer type."
383 echo "Objective Caml won't run on this architecture."
384 exit 2
387 # Determine endianness
389 sh ./runtest endian.c
390 case $? in
391 0) echo "This is a big-endian architecture."
392 echo "#define ARCH_BIG_ENDIAN" >> m.h;;
393 1) echo "This is a little-endian architecture."
394 echo "#undef ARCH_BIG_ENDIAN" >> m.h;;
395 2) echo "This architecture seems to be neither big endian nor little endian."
396 echo "Objective Caml won't run on this architecture."
397 exit 2;;
398 *) echo "Something went wrong during endianness determination."
399 echo "You'll have to figure out endianness yourself"
400 echo "(option ARCH_BIG_ENDIAN in m.h).";;
401 esac
403 # Determine alignment constraints
405 case "$host" in
406 sparc*-*-*|hppa*-*-*)
407 # On Sparc V9 with certain versions of gcc, determination of double
408 # alignment is not reliable (PR#1521), hence force it.
409 # Same goes for hppa.
410 # But there's a knack (PR#2572):
411 # if we're in 64-bit mode (sizeof(long) == 8),
412 # we must not doubleword-align floats...
413 if test $2 = 8; then
414 echo "Doubles can be word-aligned."
415 echo "#undef ARCH_ALIGN_DOUBLE" >> m.h
416 else
417 echo "Doubles must be doubleword-aligned."
418 echo "#define ARCH_ALIGN_DOUBLE" >> m.h
419 fi;;
421 sh ./runtest dblalign.c
422 case $? in
423 0) echo "Doubles can be word-aligned."
424 echo "#undef ARCH_ALIGN_DOUBLE" >> m.h;;
425 1) echo "Doubles must be doubleword-aligned."
426 echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
427 *) echo "Something went wrong during alignment determination for doubles."
428 echo "I'm going to assume this architecture has alignment constraints over doubles."
429 echo "That's a safe bet: Objective Caml will work even if"
430 echo "this architecture has actually no alignment constraints."
431 echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
432 esac;;
433 esac
435 if $int64_native; then
436 case "$host" in
437 sparc*-*-*|hppa*-*-*)
438 if test $2 = 8; then
439 echo "64-bit integers can be word-aligned."
440 echo "#undef ARCH_ALIGN_INT64" >> m.h
441 else
442 echo "64-bit integers must be doubleword-aligned."
443 echo "#define ARCH_ALIGN_INT64" >> m.h
444 fi;;
446 sh ./runtest int64align.c
447 case $? in
448 0) echo "64-bit integers can be word-aligned."
449 echo "#undef ARCH_ALIGN_INT64" >> m.h;;
450 1) echo "64-bit integers must be doubleword-aligned."
451 echo "#define ARCH_ALIGN_INT64" >> m.h;;
452 *) echo "Something went wrong during alignment determination for 64-bit integers."
453 echo "I'm going to assume this architecture has alignment constraints."
454 echo "That's a safe bet: Objective Caml will work even if"
455 echo "this architecture has actually no alignment constraints."
456 echo "#define ARCH_ALIGN_INT64" >> m.h;;
457 esac
458 esac
459 else
460 echo "#undef ARCH_ALIGN_INT64" >> m.h
463 # Check semantics of division and modulus
465 sh ./runtest divmod.c
466 case $? in
467 0) echo "Native division and modulus have round-towards-zero semantics, will use them."
468 echo "#undef NONSTANDARD_DIV_MOD" >> m.h;;
469 1) echo "Native division and modulus do not have round-towards-zero semantics, will use software emulation."
470 echo "#define NONSTANDARD_DIV_MOD" >> m.h;;
471 *) echo "Something went wrong while checking native division and modulus, please report it."
472 echo "#define NONSTANDARD_DIV_MOD" >> m.h;;
473 esac
475 # Shared library support
477 shared_libraries_supported=false
478 dl_needs_underscore=false
479 sharedcccompopts=''
480 mksharedlib=''
481 byteccrpath=''
482 mksharedlibrpath=''
484 if test $withsharedlibs = "yes"; then
485 case "$host" in
486 *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-gnu*)
487 sharedcccompopts="-fPIC"
488 mksharedlib="$bytecc -shared -o"
489 bytecclinkopts="$bytecclinkopts -Wl,-E"
490 byteccrpath="-Wl,-rpath,"
491 mksharedlibrpath="-Wl,-rpath,"
492 shared_libraries_supported=true;;
493 alpha*-*-osf*)
494 case "$bytecc" in
495 gcc*)
496 sharedcccompopts="-fPIC"
497 mksharedlib="$bytecc -shared -o"
498 byteccrpath="-Wl,-rpath,"
499 mksharedlibrpath="-Wl,-rpath,"
500 shared_libraries_supported=true;;
501 cc*)
502 sharedcccompopts=""
503 mksharedlib="ld -shared -expect_unresolved '*' -o"
504 byteccrpath="-Wl,-rpath,"
505 mksharedlibrpath="-rpath "
506 shared_libraries_supported=true;;
507 esac;;
508 *-*-solaris2*)
509 case "$bytecc" in
510 gcc*)
511 sharedcccompopts="-fPIC"
512 if sh ./solaris-ld; then
513 mksharedlib="$bytecc -shared -o"
514 byteccrpath="-R"
515 mksharedlibrpath="-R"
516 else
517 mksharedlib="$bytecc -shared -o"
518 bytecclinkopts="$bytecclinkopts -Wl,-E"
519 byteccrpath="-Wl,-rpath,"
520 mksharedlibrpath="-Wl,-rpath,"
522 shared_libraries_supported=true;;
524 sharedcccompopts="-KPIC"
525 byteccrpath="-R"
526 mksharedlibrpath="-R"
527 mksharedlib="/usr/ccs/bin/ld -G -o"
528 shared_libraries_supported=true;;
529 esac;;
530 mips*-*-irix[56]*)
531 case "$bytecc" in
532 cc*) sharedcccompopts="";;
533 gcc*) sharedcccompopts="-fPIC";;
534 esac
535 mksharedlib="ld -shared -rdata_shared -o"
536 byteccrpath="-Wl,-rpath,"
537 mksharedlibrpath="-rpath "
538 shared_libraries_supported=true;;
539 powerpc-apple-darwin*)
540 mksharedlib="cc -bundle -flat_namespace -undefined suppress -o"
541 bytecccompopts="$dl_defs $bytecccompopts"
542 #sharedcccompopts="-fnocommon"
543 dl_needs_underscore=true
544 shared_libraries_supported=true;;
545 esac
548 # Further machine-specific hacks
550 case "$host" in
551 ia64-*-linux*|alpha*-*-linux*|x86_64-*-linux*)
552 echo "Will use mmap() instead of malloc() for allocation of major heap chunks."
553 echo "#define USE_MMAP_INSTEAD_OF_MALLOC" >> s.h;;
554 esac
556 # Configure the native-code compiler
558 arch=none
559 model=default
560 system=unknown
562 case "$host" in
563 alpha*-*-osf*) arch=alpha; system=digital;;
564 alpha*-*-linux*) arch=alpha; system=linux;;
565 alpha*-*-gnu*) arch=alpha; system=gnu;;
566 alpha*-*-freebsd*) arch=alpha; system=freebsd;;
567 alpha*-*-netbsd*) arch=alpha; system=netbsd;;
568 alpha*-*-openbsd*) arch=alpha; system=openbsd;;
569 sparc*-*-sunos4.*) arch=sparc; system=sunos;;
570 sparc*-*-solaris2.*) arch=sparc; system=solaris;;
571 sparc*-*-*bsd*) arch=sparc; system=bsd;;
572 sparc*-*-linux*) arch=sparc; system=linux;;
573 sparc*-*-gnu*) arch=sparc; system=gnu;;
574 i[3456]86-*-linux*) arch=i386; system=linux_`sh ./runtest elf.c`;;
575 i[3456]86-*-*bsd*) arch=i386; system=bsd_`sh ./runtest elf.c`;;
576 i[3456]86-*-nextstep*) arch=i386; system=nextstep;;
577 i[3456]86-*-solaris*) arch=i386; system=solaris;;
578 i[3456]86-*-beos*) arch=i386; system=beos;;
579 i[3456]86-*-cygwin*) arch=i386; system=cygwin;;
580 i[3456]86-*-darwin*) arch=i386; system=macosx;;
581 i[3456]86-*-gnu*) arch=i386; system=gnu;;
582 mips-*-irix6*) arch=mips; system=irix;;
583 hppa1.1-*-hpux*) arch=hppa; system=hpux;;
584 hppa2.0*-*-hpux*) arch=hppa; system=hpux;;
585 hppa*-*-linux*) arch=hppa; system=linux;;
586 hppa*-*-gnu*) arch=hppa; system=gnu;;
587 powerpc-*-linux*) arch=power; model=ppc; system=elf;;
588 powerpc-*-netbsd*) arch=power; model=ppc; system=bsd;;
589 powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;;
590 powerpc-*-darwin*) arch=power; model=ppc; system=rhapsody;;
591 arm*-*-linux*) arch=arm; system=linux;;
592 arm*-*-gnu*) arch=arm; system=gnu;;
593 ia64-*-linux*) arch=ia64; system=linux;;
594 ia64-*-gnu*) arch=ia64; system=gnu;;
595 ia64-*-freebsd*) arch=ia64; system=freebsd;;
596 x86_64-*-linux*) arch=amd64; system=linux;;
597 x86_64-*-gnu*) arch=amd64; system=gnu;;
598 x86_64-*-freebsd*) arch=amd64; system=freebsd;;
599 x86_64-*-openbsd*) arch=amd64; system=openbsd;;
600 esac
602 if test -z "$ccoption"; then
603 case "$arch,$system,$cc" in
604 alpha,digital,gcc*) nativecc=cc;;
605 mips,*,gcc*) nativecc=cc;;
606 *) nativecc="$bytecc";;
607 esac
608 else
609 nativecc="$ccoption"
612 nativecccompopts=''
613 nativecclinkopts=''
614 nativeccrpath="$byteccrpath"
616 case "$arch,$nativecc,$system,$host_type" in
617 alpha,cc*,digital,*) nativecccompopts=-std1;;
618 mips,cc*,irix,*) nativecccompopts=-n32
619 nativecclinkopts="-n32 -Wl,-woff,84";;
620 *,*,nextstep,*) nativecccompopts="$gcc_warnings -U__GNUC__ -posix"
621 nativecclinkopts="-posix";;
622 *,*,rhapsody,*darwin[1-5].*)
623 nativecccompopts="$gcc_warnings -DSHRINKED_GNUC";;
624 *,*,rhapsody,*)
625 nativecccompopts="$gcc_warnings -DDARWIN_VERSION_6 $dl_defs";;
626 *,gcc*,cygwin,*) nativecccompopts="$gcc_warnings -U_WIN32";;
627 *,gcc*,*,*) nativecccompopts="$gcc_warnings";;
628 esac
630 asflags=''
631 aspp='$(AS)'
632 asppflags=''
633 asppprofflags='-DPROFILING'
635 case "$arch,$model,$system" in
636 alpha,*,digital) asflags='-O2'; asppflags='-O2 -DSYS_$(SYSTEM)';
637 asppprofflags='-pg -DPROFILING';;
638 alpha,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
639 alpha,*,gnu) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
640 alpha,*,freebsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
641 alpha,*,netbsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
642 alpha,*,openbsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
643 mips,*,irix) asflags='-n32 -O2'; asppflags="$asflags";;
644 sparc,*,bsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
645 sparc,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
646 sparc,*,gnu) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
647 sparc,*,*) case "$cc" in
648 gcc*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
649 *) asppflags='-P -DSYS_$(SYSTEM)';;
650 esac;;
651 i386,*,solaris) aspp='/usr/ccs/bin/as'; asppflags='-P -DSYS_$(SYSTEM)';;
652 i386,*,*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
653 hppa,*,*) aspp="$cc"; asppflags='-traditional -c -DSYS_$(SYSTEM)';;
654 power,*,elf) aspp='gcc'; asppflags='-c';;
655 power,*,bsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
656 power,*,rhapsody) ;;
657 arm,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
658 arm,*,gnu) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
659 ia64,*,*) asflags=-xexplicit
660 aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM) -Wa,-xexplicit';;
661 amd64,*,*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
662 esac
664 cc_profile='-pg'
665 case "$arch,$model,$system" in
666 alpha,*,digital) profiling='prof';;
667 i386,*,linux_elf) profiling='prof';;
668 i386,*,gnu) profiling='prof';;
669 i386,*,bsd_elf) profiling='prof';;
670 sparc,*,solaris)
671 profiling='prof'
672 case "$nativecc" in gcc*) ;; *) cc_profile='-xpg';; esac;;
673 amd64,*,linux) profiling='prof';;
674 amd64,*,gnu) profiling='prof';;
675 *) profiling='noprof';;
676 esac
678 # Where is ranlib?
680 if sh ./searchpath ranlib; then
681 echo "ranlib found"
682 echo "RANLIB=ranlib" >> Makefile
683 echo "RANLIBCMD=ranlib" >> Makefile
684 else
685 echo "ranlib not used"
686 echo "RANLIB=ar rs" >> Makefile
687 echo "RANLIBCMD=" >> Makefile
690 # Do #! scripts work?
692 # BRAVO: check disabled for NixOS
693 # if (SHELL=/bin/sh; export SHELL; (./sharpbang || ./sharpbang2) >/dev/null); then
694 # echo "#! appears to work in shell scripts"
695 case "$host" in
696 *-*-sunos*|*-*-unicos*)
697 echo "We won't use it, though, because under SunOS and Unicos it breaks"
698 echo "on pathnames longer than 30 characters"
699 echo "SHARPBANGSCRIPTS=false" >> Makefile;;
700 *-*-cygwin*)
701 echo "We won't use it, though, because of conflicts with .exe extension"
702 echo "under Cygwin"
703 echo "SHARPBANGSCRIPTS=false" >> Makefile;;
705 echo "SHARPBANGSCRIPTS=true" >> Makefile;;
706 esac
707 # else
708 # echo "No support for #! in shell scripts"
709 # echo "SHARPBANGSCRIPTS=false" >> Makefile
710 # fi
712 # Write the OS type (Unix or Cygwin)
714 echo "#define OCAML_OS_TYPE \"$ostype\"" >> s.h
715 echo "#define OCAML_STDLIB_DIR \"$libdir\"" >> s.h
717 # Use 64-bit file offset if possible
719 bytecccompopts="$bytecccompopts -D_FILE_OFFSET_BITS=64"
720 nativecccompopts="$nativecccompopts -D_FILE_OFFSET_BITS=64"
722 # Check the semantics of signal handlers
724 if sh ./hasgot sigaction sigprocmask; then
725 echo "POSIX signal handling found."
726 echo "#define POSIX_SIGNALS" >> s.h
727 else
728 if sh ./runtest signals.c; then
729 echo "Signals have the BSD semantics."
730 echo "#define BSD_SIGNALS" >> s.h
731 else
732 echo "Signals have the System V semantics."
734 if sh ./hasgot sigsetmask; then
735 echo "sigsetmask() found"
736 echo "#define HAS_SIGSETMASK" >> s.h
740 # For the sys module
742 if sh ./hasgot getrusage; then
743 echo "getrusage() found."
744 echo "#define HAS_GETRUSAGE" >> s.h
747 if sh ./hasgot times; then
748 echo "times() found."
749 echo "#define HAS_TIMES" >> s.h
752 # For the terminfo module
754 if test "$withcurses" = "yes"; then
755 for libs in "" "-lcurses" "-ltermcap" "-lcurses -ltermcap" "-lncurses"; do
756 if sh ./hasgot $libs tgetent tgetstr tgetnum tputs; then
757 echo "termcap functions found (with libraries '$libs')"
758 echo "#define HAS_TERMCAP" >> s.h
759 curseslibs="${libs}"
760 break
762 done
765 # Configuration for the libraries
767 otherlibraries="unix str num dynlink bigarray"
769 # For the Unix library
771 has_sockets=no
772 if sh ./hasgot socket socketpair bind listen accept connect; then
773 echo "You have BSD sockets."
774 echo "#define HAS_SOCKETS" >> s.h
775 has_sockets=yes
776 elif sh ./hasgot -lnsl -lsocket socket socketpair bind listen accept connect; then
777 echo "You have BSD sockets (with libraries '-lnsl -lsocket')"
778 cclibs="$cclibs -lnsl -lsocket"
779 echo "#define HAS_SOCKETS" >> s.h
780 has_sockets=yes
783 if sh ./hasgot -i sys/socket.h -t socklen_t; then
784 echo "socklen_t is defined in <sys/socket.h>"
785 echo "#define HAS_SOCKLEN_T" >> s.h
788 if sh ./hasgot inet_aton; then
789 echo "inet_aton() found."
790 echo "#define HAS_INET_ATON" >> s.h
793 if sh ./hasgot -i sys/types.h -i sys/socket.h -i netinet/in.h \
794 -t 'struct sockaddr_in6' \
795 && sh ./hasgot getaddrinfo getnameinfo inet_pton inet_ntop; then
796 echo "IPv6 is supported."
797 echo "#define HAS_IPV6" >> s.h
800 if sh ./hasgot -i unistd.h; then
801 echo "unistd.h found."
802 echo "#define HAS_UNISTD" >> s.h
805 if sh ./hasgot -i sys/types.h -t off_t; then
806 echo "off_t is defined in <sys/types.h>"
807 echo "#define HAS_OFF_T" >> s.h
810 if sh ./hasgot -i sys/types.h -i dirent.h; then
811 echo "dirent.h found."
812 echo "#define HAS_DIRENT" >> s.h
815 if sh ./hasgot rewinddir; then
816 echo "rewinddir() found."
817 echo "#define HAS_REWINDDIR" >> s.h
820 if sh ./hasgot lockf; then
821 echo "lockf() found."
822 echo "#define HAS_LOCKF" >> s.h
825 if sh ./hasgot mkfifo; then
826 echo "mkfifo() found."
827 echo "#define HAS_MKFIFO" >> s.h
830 if sh ./hasgot getcwd; then
831 echo "getcwd() found."
832 echo "#define HAS_GETCWD" >> s.h
835 if sh ./hasgot getwd; then
836 echo "getwd() found."
837 echo "#define HAS_GETWD" >> s.h
840 if sh ./hasgot getpriority setpriority; then
841 echo "getpriority() found."
842 echo "#define HAS_GETPRIORITY" >> s.h
845 if sh ./hasgot -i sys/types.h -i utime.h && sh ./hasgot utime; then
846 echo "utime() found."
847 echo "#define HAS_UTIME" >> s.h
850 if sh ./hasgot utimes; then
851 echo "utimes() found."
852 echo "#define HAS_UTIMES" >> s.h
855 if sh ./hasgot dup2; then
856 echo "dup2() found."
857 echo "#define HAS_DUP2" >> s.h
860 if sh ./hasgot fchmod fchown; then
861 echo "fchmod() found."
862 echo "#define HAS_FCHMOD" >> s.h
865 if sh ./hasgot truncate ftruncate; then
866 echo "truncate() found."
867 echo "#define HAS_TRUNCATE" >> s.h
870 select_include=''
871 if sh ./hasgot -i sys/types.h -i sys/select.h; then
872 echo "sys/select.h found."
873 echo "#define HAS_SYS_SELECT_H" >> s.h
874 select_include='-i sys/select.h'
877 has_select=no
878 if sh ./hasgot select && \
879 sh ./hasgot -i sys/types.h $select_include -t fd_set ; then
880 echo "select() found."
881 echo "#define HAS_SELECT" >> s.h
882 has_select=yes
885 if sh ./hasgot symlink readlink lstat; then
886 echo "symlink() found."
887 echo "#define HAS_SYMLINK" >> s.h
890 has_wait=no
891 if sh ./hasgot waitpid; then
892 echo "waitpid() found."
893 echo "#define HAS_WAITPID" >> s.h
894 has_wait=yes
897 if sh ./hasgot wait4; then
898 echo "wait4() found."
899 echo "#define HAS_WAIT4" >> s.h
900 has_wait=yes
903 if sh ./hasgot -i limits.h && sh ./runtest getgroups.c; then
904 echo "getgroups() found."
905 echo "#define HAS_GETGROUPS" >> s.h
908 if sh ./hasgot -i termios.h &&
909 sh ./hasgot tcgetattr tcsetattr tcsendbreak tcflush tcflow; then
910 echo "POSIX termios found."
911 echo "#define HAS_TERMIOS" >> s.h
914 # Async I/O under OSF1 3.x are so buggy that the test program hangs...
915 testasyncio=true
916 if test -f /usr/bin/uname; then
917 case "`/usr/bin/uname -s -r`" in
918 "OSF1 V3."*) testasyncio=false;;
919 esac
921 if $testasyncio && sh ./runtest async_io.c; then
922 echo "Asynchronous I/O are supported."
923 echo "#define HAS_ASYNC_IO" >> s.h
926 has_setitimer=no
927 if sh ./hasgot setitimer; then
928 echo "setitimer() found."
929 echo "#define HAS_SETITIMER" >> s.h
930 has_setitimer="yes"
933 if sh ./hasgot gethostname; then
934 echo "gethostname() found."
935 echo "#define HAS_GETHOSTNAME" >> s.h
938 if sh ./hasgot -i sys/utsname.h && sh ./hasgot uname; then
939 echo "uname() found."
940 echo "#define HAS_UNAME" >> s.h
943 has_gettimeofday=no
944 if sh ./hasgot gettimeofday; then
945 echo "gettimeofday() found."
946 echo "#define HAS_GETTIMEOFDAY" >> s.h
947 has_gettimeofday="yes"
950 if sh ./hasgot mktime; then
951 echo "mktime() found."
952 echo "#define HAS_MKTIME" >> s.h
955 case "$host" in
956 *-*-cygwin*) ;; # setsid emulation under Cygwin breaks the debugger
957 *) if sh ./hasgot setsid; then
958 echo "setsid() found."
959 echo "#define HAS_SETSID" >> s.h
960 fi;;
961 esac
963 if sh ./hasgot putenv; then
964 echo "putenv() found."
965 echo "#define HAS_PUTENV" >> s.h
968 if sh ./hasgot -i locale.h && sh ./hasgot setlocale; then
969 echo "setlocale() and <locale.h> found."
970 echo "#define HAS_LOCALE" >> s.h
973 if sh ./hasgot -i mach-o/dyld.h && sh ./hasgot NSLinkModule; then
974 echo "NSLinkModule() found. Using darwin dynamic loading."
975 echo "#define HAS_NSLINKMODULE" >> s.h
976 elif sh ./hasgot $dllib dlopen; then
977 echo "dlopen() found."
978 elif sh ./hasgot $dllib -ldl dlopen; then
979 echo "dlopen() found in -ldl."
980 dllib="$dllib -ldl"
981 else
982 shared_libraries_supported=no
985 if $shared_libraries_supported; then
986 echo "Dynamic loading of shared libraries is supported."
987 echo "#define SUPPORT_DYNAMIC_LINKING" >> s.h
988 if $dl_needs_underscore; then
989 echo '#define DL_NEEDS_UNDERSCORE' >>s.h
993 if sh ./hasgot -i sys/types.h -i sys/mman.h && sh ./hasgot mmap munmap; then
994 echo "mmap() found."
995 echo "#define HAS_MMAP" >> s.h
998 nargs=none
999 for i in 5 6; do
1000 if sh ./trycompile -DNUM_ARGS=${i} gethostbyname.c; then nargs=$i; break; fi
1001 done
1002 if test $nargs != "none"; then
1003 echo "gethostbyname_r() found (with ${nargs} arguments)."
1004 echo "#define HAS_GETHOSTBYNAME_R $nargs" >> s.h
1007 nargs=none
1008 for i in 7 8; do
1009 if sh ./trycompile -DNUM_ARGS=${i} gethostbyaddr.c; then nargs=$i; break; fi
1010 done
1011 if test $nargs != "none"; then
1012 echo "gethostbyaddr_r() found (with ${nargs} arguments)."
1013 echo "#define HAS_GETHOSTBYADDR_R $nargs" >> s.h
1016 # Determine if the debugger is supported
1018 if test "$has_sockets" = "yes"; then
1019 echo "Replay debugger supported."
1020 debugger="ocamldebugger"
1021 else
1022 echo "No replay debugger (missing system calls)"
1023 debugger=""
1027 # Determine if system stack overflows can be detected
1029 case "$arch,$system" in
1030 i386,linux_elf|amd64,linux)
1031 echo "System stack overflow can be detected."
1032 echo "#define HAS_STACK_OVERFLOW_DETECTION" >> s.h;;
1034 echo "Cannot detect system stack overflow.";;
1035 esac
1037 # Determine the target architecture for the "num" library
1039 case "$host" in
1040 alpha*-*-*) bng_arch=alpha; bng_asm_level=1;;
1041 i[3456]86-*-*) bng_arch=ia32
1042 if sh ./trycompile ia32sse2.c
1043 then bng_asm_level=2
1044 else bng_asm_level=1
1045 fi;;
1046 mips-*-*) bng_arch=mips; bng_asm_level=1;;
1047 powerpc-*-*) bng_arch=ppc; bng_asm_level=1;;
1048 sparc*-*-*) bng_arch=sparc; bng_asm_level=1;;
1049 x86_64-*-*) bng_arch=amd64; bng_asm_level=1;;
1050 *) bng_arch=generic; bng_asm_level=0;;
1051 esac
1053 echo "BNG_ARCH=$bng_arch" >> Makefile
1054 echo "BNG_ASM_LEVEL=$bng_asm_level" >> Makefile
1056 # Determine if the POSIX threads library is supported
1058 systhread_support=false
1060 if test "$pthread_wanted" = "yes"; then
1061 case "$host" in
1062 *-*-solaris*) pthread_link="-lpthread -lposix4";;
1063 *-*-freebsd*) pthread_link="-pthread";;
1064 *-*-openbsd*) pthread_link="-pthread";;
1065 *) pthread_link="-lpthread";;
1066 esac
1067 if ./hasgot -i pthread.h $pthread_link pthread_self; then
1068 echo "POSIX threads library supported."
1069 systhread_support=true
1070 otherlibraries="$otherlibraries systhreads"
1071 bytecccompopts="$bytecccompopts -D_REENTRANT"
1072 nativecccompopts="$nativecccompopts -D_REENTRANT"
1073 case "$host" in
1074 *-*-freebsd*)
1075 bytecccompopts="$bytecccompopts -D_THREAD_SAFE"
1076 nativecccompopts="$nativecccompopts -D_THREAD_SAFE";;
1077 *-*-openbsd*)
1078 bytecccompopts="$bytecccompopts -pthread"
1079 asppflags="$asppflags -pthread"
1080 nativecccompopts="$nativecccompopts -pthread";;
1081 esac
1082 echo "Options for linking with POSIX threads: $pthread_link"
1083 echo "PTHREAD_LINK=$pthread_link" >> Makefile
1084 if sh ./hasgot $pthread_link sigwait; then
1085 echo "sigwait() found"
1086 echo "#define HAS_SIGWAIT" >> s.h
1088 else
1089 echo "POSIX threads not found."
1090 pthread_link=""
1094 # Determine if the bytecode thread library is supported
1096 if test "$has_select" = "yes" \
1097 && test "$has_setitimer" = "yes" \
1098 && test "$has_gettimeofday" = "yes" \
1099 && test "$has_wait" = "yes"; then
1100 echo "Bytecode threads library supported."
1101 otherlibraries="$otherlibraries threads"
1102 else
1103 echo "Bytecode threads library not supported (missing system calls)"
1106 # Determine the location of X include files and libraries
1108 x11_include="not found"
1109 x11_link="not found"
1111 for dir in \
1112 $x11_include_dir \
1115 if test -f $dir/X11/X.h; then
1116 x11_include=$dir
1117 break
1119 done
1121 if test "$x11_include" = "not found"; then
1122 x11_try_lib_dir=''
1123 else
1124 x11_try_lib_dir=`echo $x11_include | sed -e 's|include|lib|'`
1127 for dir in \
1128 $x11_lib_dir \
1129 $x11_try_lib_dir \
1132 if test -f $dir/libX11.a || \
1133 test -f $dir/libX11.so || \
1134 test -f $dir/libX11.dll.a || \
1135 test -f $dir/libX11.sa; then
1136 if test $dir = /usr/lib; then
1137 x11_link="-lX11"
1138 else
1139 x11_link="-L$dir -lX11"
1140 x11_libs="-L$dir"
1142 break
1144 done
1147 if test "$x11_include" = "not found" || test "$x11_link" = "not found"
1148 then
1149 echo "X11 not found, the \"graph\" library will not be supported."
1150 x11_include=""
1151 else
1152 echo "Location of X11 include files: $x11_include/X11"
1153 echo "Options for linking with X11: $x11_link"
1154 otherlibraries="$otherlibraries graph"
1155 if test "$x11_include" = "/usr/include"; then
1156 x11_include=""
1157 else
1158 x11_include="-I$x11_include"
1160 echo "X11_INCLUDES=$x11_include" >> Makefile
1161 echo "X11_LINK=$x11_link" >> Makefile
1164 # See if we can compile the dbm library
1166 dbm_include="not found"
1167 dbm_link="not found"
1168 use_gdbm_ndbm=no
1170 for dir in /usr/include /usr/include/db1 /usr/include/gdbm; do
1171 if test -f $dir/ndbm.h; then
1172 dbm_include=$dir
1173 if sh ./hasgot dbm_open; then
1174 dbm_link=""
1175 elif sh ./hasgot -lndbm dbm_open; then
1176 dbm_link="-lndbm"
1177 elif sh ./hasgot -ldb1 dbm_open; then
1178 dbm_link="-ldb1"
1179 elif sh ./hasgot -lgdbm dbm_open; then
1180 dbm_link="-lgdbm"
1181 elif sh ./hasgot -lgdbm_compat -lgdbm dbm_open; then
1182 dbm_link="-lgdbm_compat -lgdbm"
1184 break
1186 if test -f $dir/gdbm-ndbm.h; then
1187 dbm_include=$dir
1188 use_gdbm_ndbm=yes
1189 if sh ./hasgot -lgdbm_compat -lgdbm dbm_open; then
1190 dbm_link="-lgdbm_compat -lgdbm"
1192 break
1194 done
1195 if test "$dbm_include" = "not found" || test "$dbm_link" = "not found"; then
1196 echo "NDBM not found, the \"dbm\" library will not be supported."
1197 else
1198 echo "NDBM found (in $dbm_include)"
1199 if test "$dbm_include" = "/usr/include"; then
1200 dbm_include=""
1201 else
1202 dbm_include="-I$dbm_include"
1204 echo "DBM_INCLUDES=$dbm_include" >> Makefile
1205 echo "DBM_LINK=$dbm_link" >> Makefile
1206 if test "$use_gdbm_ndbm" = "yes"; then
1207 echo "#define DBM_USES_GDBM_NDBM" >> s.h
1209 otherlibraries="$otherlibraries dbm"
1212 # Look for tcl/tk
1214 echo "Configuring LablTk..."
1216 if test $tk_wanted = no; then
1217 has_tk=false
1218 elif test $tk_x11 = no; then
1219 has_tk=true
1220 elif test "$x11_include" = "not found" || test "$x11_link" = "not found"; then
1221 echo "X11 not found."
1222 has_tk=false
1223 else
1224 tk_x11_include="$x11_include"
1225 tk_x11_libs="$x11_libs -lX11"
1226 has_tk=true
1229 if test $has_tk = true; then
1230 tcl_version=''
1231 tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
1232 for tk_incs in \
1234 do if test -z "$tcl_version"; then
1235 tk_defs="$tk_incs"
1236 tcl_version=`sh ./runtest $tk_defs $tk_x11_include tclversion.c`
1237 fi; done
1238 if test -n "$tcl_version" && test "x$tcl_version" != "xnone"; then
1239 echo "tcl.h and tk.h version $tcl_version found with \"$tk_defs\"."
1240 case $tcl_version in
1241 7.5) tclmaj=7 tclmin=5 tkmaj=4 tkmin=1 ;;
1242 7.6) tclmaj=7 tclmin=6 tkmaj=4 tkmin=2 ;;
1243 8.0) tclmaj=8 tclmin=0 tkmaj=8 tkmin=0 ;;
1244 8.1) tclmaj=8 tclmin=1 tkmaj=8 tkmin=1 ;;
1245 8.2) tclmaj=8 tclmin=2 tkmaj=8 tkmin=2 ;;
1246 8.3) tclmaj=8 tclmin=3 tkmaj=8 tkmin=3 ;;
1247 8.4) tclmaj=8 tclmin=4 tkmaj=8 tkmin=4 ;;
1248 *) echo "This version is not known."; has_tk=false ;;
1249 esac
1250 else
1251 echo "tcl.h and/or tk.h not found."
1252 has_tk=false
1256 tkauxlibs="$mathlib $dllib"
1257 tcllib=''
1258 tklib=''
1259 if test $has_tk = true; then
1260 if test -n "$tk_libs" && \
1261 sh ./hasgot $tk_libs $tk_x11_libs $tkauxlibs Tcl_DoOneEvent
1262 then tk_libs="$tk_libs $dllib"
1263 elif sh ./hasgot $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs Tcl_DoOneEvent
1264 then
1265 tk_libs="$tk_libs -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
1266 elif sh ./hasgot $tk_libs -ltcl$tclmaj$tclmin $tkauxlibs Tcl_DoOneEvent
1267 then
1268 tk_libs="$tk_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin $dllib"
1269 elif test -z "$tk_libs" && tk_libs=-L/usr/local/lib && \
1270 sh ./hasgot $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs Tcl_DoOneEvent
1271 then
1272 tk_libs="$tk_libs -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
1273 elif sh ./hasgot $tk_libs -ltcl$tclmaj$tclmin $tkauxlibs Tcl_DoOneEvent
1274 then
1275 tk_libs="$tk_libs -ltk$tkmaj$tkmin -ltcl$tclmaj$tclmin $dllib"
1276 elif sh ./hasgot -L/sw/lib $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs \
1277 Tcl_DoOneEvent
1278 then tk_libs="-L/sw/lib -ltk$tkmaj.$tkmin -ltcl$tclmaj.$tclmin $dllib"
1279 else
1280 echo "Tcl library not found."
1281 has_tk=false
1284 if test $has_tk = true; then
1285 if sh ./hasgot $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
1286 echo "Tcl/Tk libraries found."
1287 elif sh ./hasgot -L/sw/lib $tk_libs $tk_x11_libs $tkauxlibs Tk_SetGrid; then
1288 tk_libs="-L/sw/lib $tk_libs"
1289 echo "Tcl/Tk libraries found."
1290 else
1291 echo "Tcl library found."
1292 echo "Tk library not found."
1293 has_tk=false
1297 if test $has_tk = true; then
1298 if test $tk_x11 = yes; then
1299 echo "TK_DEFS=$tk_defs "'$(X11_INCLUDES)' >> Makefile
1300 echo "TK_LINK=$tk_libs "'$(X11_LINK)' >> Makefile
1301 else
1302 echo "TK_DEFS=$tk_defs" >> Makefile
1303 echo "TK_LINK=$tk_libs" >> Makefile
1305 otherlibraries="$otherlibraries labltk"
1306 else
1307 echo "Configuration failed, LablTk will not be built."
1310 # Begin Camlp4
1312 cd ../../camlp4/config
1313 EXE=$exe ./configure_batch -prefix "$prefix" -bindir "$bindir" -libdir "$libdir" -mandir "$mandir" -ocaml-top ../.. > /dev/null
1316 case $? in
1317 0) echo "Camlp4 correctly configured.";;
1318 *) echo "Warning: Camlp4 configuration terminated with error code $?";;
1319 esac
1320 # End Camlp4
1322 # Final twiddling of compiler options to work around known bugs
1324 nativeccprofopts="$nativecccompopts"
1325 case "$buggycc" in
1326 gcc.2.96)
1327 bytecccompopts="$bytecccompopts -fomit-frame-pointer"
1328 nativecccompopts="$nativecccompopts -fomit-frame-pointer";;
1329 esac
1331 # Finish generated files
1333 cclibs="$cclibs $mathlib"
1335 echo "BYTECC=$bytecc" >> Makefile
1336 echo "BYTECCCOMPOPTS=$bytecccompopts" >> Makefile
1337 echo "BYTECCLINKOPTS=$bytecclinkopts" >> Makefile
1338 echo "BYTECCLIBS=$cclibs $dllib $curseslibs $pthread_link" >> Makefile
1339 echo "BYTECCRPATH=$byteccrpath" >> Makefile
1340 echo "EXE=$exe" >> Makefile
1341 echo "SUPPORTS_SHARED_LIBRARIES=$shared_libraries_supported" >> Makefile
1342 echo "SHAREDCCCOMPOPTS=$sharedcccompopts" >> Makefile
1343 echo "MKSHAREDLIB=$mksharedlib" >> Makefile
1344 echo "MKSHAREDLIBRPATH=$mksharedlibrpath" >> Makefile
1345 echo "ARCH=$arch" >> Makefile
1346 echo "MODEL=$model" >> Makefile
1347 echo "SYSTEM=$system" >> Makefile
1348 echo "NATIVECC=$nativecc" >> Makefile
1349 echo "NATIVECCCOMPOPTS=$nativecccompopts" >> Makefile
1350 echo "NATIVECCPROFOPTS=$nativeccprofopts" >> Makefile
1351 echo "NATIVECCLINKOPTS=$nativecclinkopts" >> Makefile
1352 echo "NATIVECCRPATH=$nativeccrpath" >> Makefile
1353 echo "NATIVECCLIBS=$cclibs $dllib" >> Makefile
1354 echo "ASFLAGS=$asflags" >> Makefile
1355 echo "ASPP=$aspp" >> Makefile
1356 echo "ASPPFLAGS=$asppflags" >> Makefile
1357 echo "ASPPPROFFLAGS=$asppprofflags" >> Makefile
1358 echo "PROFILING=$profiling" >> Makefile
1359 echo "DYNLINKOPTS=$dllib" >> Makefile
1360 echo "OTHERLIBRARIES=$otherlibraries" >> Makefile
1361 echo "DEBUGGER=$debugger" >> Makefile
1362 echo "CC_PROFILE=$cc_profile" >> Makefile
1363 echo "SYSTHREAD_SUPPORT=$systhread_support" >>Makefile
1365 rm -f tst hasgot.c
1366 rm -f ../m.h ../s.h ../Makefile
1367 mv m.h s.h Makefile ..
1369 # Print a summary
1371 echo
1372 echo "** Configuration summary **"
1373 echo
1374 echo "Directories where Objective Caml will be installed:"
1375 echo " binaries.................. $bindir"
1376 echo " standard library.......... $libdir"
1377 echo " manual pages.............. $mandir (with extension .$manext)"
1379 echo "Configuration for the bytecode compiler:"
1380 echo " C compiler used........... $bytecc"
1381 echo " options for compiling..... $bytecccompopts"
1382 echo " options for linking....... $bytecclinkopts $cclibs $dllib $curseslibs $pthread_link"
1383 if $shared_libraries_supported; then
1384 echo " shared libraries are supported"
1385 echo " options for compiling..... $sharedcccompopts $bytecccompopts"
1386 echo " command for building...... $mksharedlib lib.so $mksharedlibrpath/a/path objs"
1387 else
1388 echo " shared libraries not supported"
1391 echo "Configuration for the native-code compiler:"
1392 if test "$arch" = "none"; then
1393 echo " (not supported on this platform)"
1394 else
1395 if test "$model" = "default"; then
1396 echo " hardware architecture..... $arch"
1397 else
1398 echo " hardware architecture..... $arch ($model)"
1400 if test "$system" = "unknown"; then : ; else
1401 echo " OS variant................ $system"
1403 echo " C compiler used........... $nativecc"
1404 echo " options for compiling..... $nativecccompopts"
1405 echo " options for linking....... $nativecclinkopts $cclibs"
1406 echo " assembler ................ \$(AS) $asflags"
1407 echo " preprocessed assembler ... $aspp $asppflags"
1408 if test "$profiling" = "prof"; then
1409 echo " profiling with gprof ..... supported"
1410 else
1411 echo " profiling with gprof ..... not supported"
1415 if test "$debugger" = "ocamldebugger"; then
1416 echo "Source-level replay debugger: supported"
1417 else
1418 echo "Source-level replay debugger: not supported"
1421 echo "Additional libraries supported:"
1422 echo " $otherlibraries"
1424 echo "Configuration for the \"num\" library:"
1425 echo " target architecture ...... $bng_arch (asm level $bng_asm_level)"
1427 if test "$x11_include" != "not found" && test "$x11_lib" != "not found"; then
1428 echo "Configuration for the \"graph\" library:"
1429 echo " options for compiling .... $x11_include"
1430 echo " options for linking ...... $x11_link"
1433 if test $has_tk = true; then
1434 echo "Configuration for the \"labltk\" library:"
1435 echo " use tcl/tk version ....... $tcl_version"
1436 echo " options for compiling .... $tk_defs"
1437 echo " options for linking ...... $tk_libs"
1438 else
1439 echo "The \"labltk\" library: not supported"
1442 echo
1443 echo "** Objective Caml configuration completed successfully **"
1444 echo