1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
|
#! /bin/sh
#*********************************************************************#
# #
# Objective Caml #
# #
# Xavier Leroy, projet Cristal, INRIA Rocquencourt #
# #
# Copyright 1995 Institut National de Recherche en Informatique et #
# Automatique. Distributed only by permission. #
# #
#*********************************************************************#
# $Id$
bindir=/usr/local/bin
libdir=/usr/local/lib/ocaml
mandir=/usr/local/man/man1
manext=1
host_type=unknown
cc=''
cclibs=''
x11_include_dir=''
x11_lib_dir=''
posix_threads=no
# Parse command-line arguments
while : ; do
case "$1" in
"") break;;
-bindir|--bindir)
bindir=$2; shift;;
-libdir|--libdir)
libdir=$2; shift;;
-mandir|--mandir)
mandir=$2
manext=`echo $mandir | sed -e 's/^.*\(.\)$/\1/'`
shift;;
-host*|--host*)
host_type=$2; shift;;
-cc*)
cc="$2"; shift;;
-lib*)
cclibs="$2 "; shift;;
-x11include*|--x11include*)
x11_include_dir=$2; shift;;
-x11lib*|--x11lib*)
x11_lib_dir=$2; shift;;
-with-pthread|--with-pthread)
posix_threads=yes;;
*) echo "Unknown option \"$1\"." 1>&2; exit 2;;
esac
shift
done
# Sanity checks
case "$bindir" in
/*) ;;
*) echo "The -bindir directory must be absolute." 1>&2; exit 2;;
esac
case "$libdir" in
/*) ;;
*) echo "The -libdir directory must be absolute." 1>&2; exit 2;;
esac
case "$mandir" in
/*) ;;
*) echo "The -mandir directory must be absolute." 1>&2; exit 2;;
esac
# Generate the files
cd config/auto-aux
rm -f s.h m.h Makefile
touch s.h m.h Makefile
# Where to install
echo "BINDIR=$bindir" >> Makefile
echo "LIBDIR=$libdir" >> Makefile
echo "MANDIR=$mandir" >> Makefile
echo "MANEXT=$manext" >> Makefile
# Determine the system type
if test "$host_type" = "unknown"; then
if host_type=`./config.guess`; then :; else
echo "Cannot guess host type"
echo "You must specify one with the -host option"
exit 2
fi
fi
if host=`./config.sub $host_type`; then :; else
echo "Please specify the correct host type with the -host option"
exit 2
fi
echo "Configuring for a $host ..."
# Do we have gcc?
if test -z "$cc"; then
if sh ./searchpath gcc; then
echo "gcc found"
cc=gcc
else
cc=cc
fi
fi
# Check for buggy versions of GCC
case "$host,$cc" in
i[3456]86-*-*,gcc*)
case `$cc --version` in
2.7.2.1) cat <<'EOF'
WARNING: you are using gcc version 2.7.2.1 on an Intel x86 processor.
This version of gcc is known to generate incorrect code for the
Objective Caml runtime system on some Intel x86 machines. (The symptom
is a crash of boot/ocamlc when compiling stdlib/pervasives.mli.)
In particular, the version of gcc 2.7.2.1 that comes with
Linux RedHat 4.x / Intel is affected by this problem.
Other Linux distributions might also be affected.
If you are using one of these configurations, you are strongly advised
to use another version of gcc, such as 2.7.2 or 2.7.2.2, which are
known to work well with Objective Caml.
Press <enter> to proceed or <interrupt> to stop.
EOF
read reply;;
esac;;
esac
# Configure the bytecode compiler
bytecc="$cc"
bytecccompopts=""
bytecclinkopts=""
case "$bytecc,$host" in
cc,*-*-nextstep*)
# GNU C extensions disabled, but __GNUC__ still defined!
bytecccompopts="-fno-defer-pop -Wall -U__GNUC__ -posix"
bytecclinkopts="-posix";;
gcc,alpha-*-osf*)
bytecccompopts="-fno-defer-pop -Wall"
# -taso puts code in lower 4GB
bytecclinkopts="-Xlinker -taso";;
gcc*)
bytecccompopts="-fno-defer-pop -Wall";;
cc,mips-*-irix6*)
# Add -32 flag to ensure compatibility with native-code compiler
bytecccompopts="-32"
# Turn off warning "unused library"
bytecclinkopts="-32 -Wl,-woff,84";;
cc*,mips-*-irix6*)
# Turn off warning "unused library"
bytecclinkopts="-Wl,-woff,84";;
esac
echo "BYTECC=$bytecc" >> Makefile
echo "BYTECCCOMPOPTS=$bytecccompopts" >> Makefile
echo "BYTECCLINKOPTS=$bytecclinkopts" >> Makefile
# Configure compiler to use in further tests
cc="$bytecc $bytecclinkopts"
export cc cclibs
# Check C compiler
sh ./runtest ansi.c
case $? in
0) echo "The C compiler is ANSI-compliant.";;
1) echo "The C compiler $cc is not ANSI-compliant."
echo "You need an ANSI C compiler to build Objective Caml."
exit 2;;
*) echo "Unable to compiler the test program."
echo "Make sure the C compiler $cc is properly installed."
exit 2;;
esac
# Check the sizes of data types
echo "Checking the sizes of integers and pointers..."
set `sh ./runtest sizes.c`
case "$1,$2,$3" in
4,4,4) echo "OK, this is a regular 32 bit architecture."
echo "#undef ARCH_SIXTYFOUR" >> m.h;;
4,8,8) echo "Wow! A 64 bit architecture!"
echo "#define ARCH_SIXTYFOUR" >> m.h
case "$bytecc,$host" in
gcc,alpha-*-osf*) echo "#define ARCH_CODE32" >> m.h;;
*) echo "#undef ARCH_CODE32" >> m.h;;
esac;;
8,*,*) echo "Wow! A 64 bit architecture!"
echo "Unfortunately, Objective Caml does not handle the case"
echo "sizeof(int) = 8."
echo "Objective Caml won't run on this architecture."
exit 2;;
*,*,8) echo "Wow! A 64 bit architecture!"
echo "Unfortunately, Objective Caml cannot work in the case"
echo "sizeof(long) != sizeof(long *)."
echo "Objective Caml won't run on this architecture."
exit 2;;
*,*,*) echo "This architecture seems to be neither 32 bits nor 64 bits."
echo "Objective Caml won't run on this architecture."
exit 2;;
*) echo "Unable to compile the test program."
echo "Make sure the C compiler $cc is properly installed."
exit 2;;
esac
# Determine endianness
sh ./runtest endian.c
case $? in
0) echo "This is a big-endian architecture."
echo "#define ARCH_BIG_ENDIAN" >> m.h;;
1) echo "This is a little-endian architecture."
echo "#undef ARCH_BIG_ENDIAN" >> m.h;;
2) echo "This architecture seems to be neither big endian nor little endian."
echo "Objective Caml won't run on this architecture."
exit 2;;
*) echo "Something went wrong during endianness determination."
echo "You'll have to figure out endianness yourself"
echo "(option ARCH_BIG_ENDIAN in m.h).";;
esac
# Determine alignment constraints
sh ./runtest dblalign.c
case $? in
0) echo "Doubles can be word-aligned."
echo "#undef ARCH_ALIGN_DOUBLE" >> m.h;;
1) echo "Doubles must be doubleword-aligned."
echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
*) echo "Something went wrong during alignment determination for doubles."
echo "I'm going to assume this architecture has alignment constraints over doubles."
echo "That's a safe bet: Objective Caml will work even if"
echo "this architecture has actually no alignment constraints."
echo "#define ARCH_ALIGN_DOUBLE" >> m.h;;
esac
# Configure the native-code compiler
arch=none
model=default
system=unknown
case "$host" in
alpha-*-osf*) arch=alpha; system=digital;;
alpha-*-linux*) arch=alpha; system=linux;;
sparc-*-sunos4.*) arch=sparc; system=sunos;;
sparc-*-solaris2.*) arch=sparc; system=solaris;;
sparc-*-*bsd*) arch=sparc; system=bsd;;
i[3456]86-*-linuxaout) arch=i386; system=linux_aout;;
i[3456]86-*-linuxoldld) arch=i386; system=linux_aout;;
i[3456]86-*-linux) arch=i386; system=linux_elf;;
i[3456]86-*-*bsd*) arch=i386; system=bsd;;
i[3456]86-*-nextstep*) arch=i386; system=nextstep;;
i[3456]86-*-solaris*) arch=i386; system=solaris;;
mips-*-irix6*) arch=mips; system=irix;;
mips-*-ultrix*) arch=mips; system=ultrix;;
hppa1.1-*-hpux*) arch=hppa; system=hpux;;
hppa1.1-*-nextstep*) arch=hppa; system=nextstep;;
rs6000-*-aix*) arch=power; model=rs6000; system=aix;;
powerpc-*-aix*) arch=power; model=ppc; system=aix;;
powerpc-*-linux*) arch=power; model=ppc; system=elf;;
m68k-*-sunos*) arch=m68k; system=sunos;;
esac
case "$arch,$system" in
alpha,digital) nativecc=cc;;
mips,*) nativecc=cc;;
*) nativecc="$bytecc";;
esac
nativecccompopts=''
nativecclinkopts=''
case "$arch,$nativecc,$system" in
alpha,cc,digital) nativecccompopts=-std1;;
mips,cc,irix) nativecccompopts=-32
nativecclinkopts="-32 -Wl,-woff,84";;
mips,cc,ultrix) nativecccompopts=-std;;
*,*,nextstep) nativecccompopts="-Wall -U__GNUC__ -posix"
nativecclinkopts="-posix";;
*,gcc,*) nativecccompopts=-Wall;;
esac
asflags=''
aspp='$(AS)'
asppflags=''
case "$arch,$model,$system" in
alpha,*,digital) asflags='-O2'; asppflags='-O2 -DSYS_$(SYSTEM)';;
alpha,*,linux) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
mips,*,irix) asflags='-32 -O2'; asppflags="$asflags";;
mips,*,ultrix) asflags='-O2'; asppflags="$asflags";;
sparc,*,bsd) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
sparc,*,*) asppflags='-P -DSYS_$(SYSTEM)';;
i386,*,solaris) asppflags='-P -DSYS_$(SYSTEM)';;
i386,*,*) aspp='gcc'; asppflags='-c -DSYS_$(SYSTEM)';;
hppa,*,*) aspp="$cc"; asppflags='-c -DSYS_$(SYSTEM)';;
power,rs6000,aix) asflags='-u -m pwr -w'; asppflags="$asflags";;
power,ppc,aix) asflags='-u -m ppc -w'; asppflags="$asflags";;
power,*,elf) aspp='gcc'; asppflags='-c';;
esac
echo "ARCH=$arch" >> Makefile
echo "MODEL=$model" >> Makefile
echo "SYSTEM=$system" >> Makefile
echo "NATIVECC=$nativecc" >> Makefile
echo "NATIVECCCOMPOPTS=$nativecccompopts" >> Makefile
echo "NATIVECCLINKOPTS=$nativecclinkopts" >> Makefile
echo "ASFLAGS=$asflags" >> Makefile
echo "ASPP=$aspp" >> Makefile
echo "ASPPFLAGS=$asppflags" >> Makefile
# Where is ranlib?
if sh ./searchpath ranlib; then
echo "ranlib found"
echo "RANLIB=ranlib" >> Makefile
echo "RANLIBCMD=ranlib" >> Makefile
else
echo "ranlib not used"
echo "RANLIB=ar rs" >> Makefile
echo "RANLIBCMD=" >> Makefile
fi
# Do #! scripts work?
if (SHELL=/bin/sh; export SHELL; ./sharpbang > /dev/null); then
echo "#! appears to work in shell scripts"
case "$host" in
*-*-sunos*)
if test `echo $bindir/ocamlrun | wc -c` -gt 32; then
echo "We won't use it, though, because the path"
echo " $bindir/ocamlrun"
echo "is too long (more than 32 characters -- some kernels don't support this)"
echo "SHARPBANGSCRIPTS=false" >> Makefile
else
echo "SHARPBANGSCRIPTS=true" >> Makefile
fi;;
*) echo "SHARPBANGSCRIPTS=true" >> Makefile;;
esac
else
echo "No support for #! in shell scripts"
echo "SHARPBANGSCRIPTS=false" >> Makefile
fi
# This is obviously a Unix system
echo '#define OCAML_OS_TYPE "Unix"' >> s.h
# Find a good byte move function
if sh ./runtest -Dcopy=memmove -Dreverse bytecopy.c; then
echo "Function \"memmove\" is provided and handles overlapping moves correctly."
echo "#define HAS_MEMMOVE" >> s.h
fi
if sh ./runtest -Dcopy=bcopy bytecopy.c; then
echo "Function \"bcopy\" is provided and handles overlapping moves correctly."
echo "#define HAS_BCOPY" >> s.h
fi
# Check the semantics of signal handlers
if sh ./hasgot sigaction sigprocmask; then
echo "POSIX signal handling found."
echo "#define POSIX_SIGNALS" >> s.h
else
if sh ./runtest signals.c; then
echo "Signals have the BSD semantics."
echo "#define BSD_SIGNALS" >> s.h
else
echo "Signals have the System V semantics."
fi
if sh ./hasgot sigsetmask; then
echo "sigsetmask() found"
echo "#define HAS_SIGSETMASK" >> s.h
fi
fi
# For the sys module
if sh ./hasgot strerror; then
echo "strerror() found."
echo "#define HAS_STRERROR" >> s.h
fi
# For the terminfo module
for libs in "" "-lcurses" "-ltermcap" "-lcurses -ltermcap"; do
if sh ./hasgot $libs tgetent tgetstr tgetnum tputs; then
echo "termcap functions found (with libraries '$libs')"
echo "#define HAS_TERMCAP" >> s.h
cclibs="${cclibs}${libs}"
break
fi
done
# Configuration for the libraries
otherlibraries="unix str num dynlink"
# For the Unix library
has_sockets=no
if sh ./hasgot socket socketpair bind listen accept connect; then
echo "You have BSD sockets."
echo "#define HAS_SOCKETS" >> s.h
has_sockets=yes
elif sh ./hasgot -lnsl -lsocket socket socketpair bind listen accept connect; then
echo "You have BSD sockets (with libraries '-lnsl -lsocket')"
cclibs="$cclibs -lnsl -lsocket"
echo "#define HAS_SOCKETS" >> s.h
has_sockets=yes
fi
if sh ./hasgot -i unistd.h; then
echo "unistd.h found."
echo "#define HAS_UNISTD" >> s.h
fi
if sh ./hasgot -i dirent.h; then
echo "dirent.h found."
echo "#define HAS_DIRENT" >> s.h
fi
if sh ./hasgot rewinddir; then
echo "rewinddir() found."
echo "#define HAS_REWINDDIR" >> s.h
fi
if sh ./hasgot lockf; then
echo "lockf() found."
echo "#define HAS_LOCKF" >> s.h
fi
if sh ./hasgot mkfifo; then
echo "mkfifo() found."
echo "#define HAS_MKFIFO" >> s.h
fi
if sh ./hasgot getcwd; then
echo "getcwd() found."
echo "#define HAS_GETCWD" >> s.h
fi
if sh ./hasgot getwd; then
echo "getwd() found."
echo "#define HAS_GETWD" >> s.h
fi
if sh ./hasgot getpriority setpriority; then
echo "getpriority() found."
echo "#define HAS_GETPRIORITY" >> s.h
fi
if sh ./hasgot -i utime.h && sh ./hasgot utime; then
echo "utime() found."
echo "#define HAS_UTIME" >> s.h
fi
if sh ./hasgot utimes; then
echo "utimes() found."
echo "#define HAS_UTIMES" >> s.h
fi
if sh ./hasgot dup2; then
echo "dup2() found."
echo "#define HAS_DUP2" >> s.h
fi
if sh ./hasgot fchmod fchown; then
echo "fchmod() found."
echo "#define HAS_FCHMOD" >> s.h
fi
if sh ./hasgot truncate ftruncate; then
echo "truncate() found."
echo "#define HAS_TRUNCATE" >> s.h
fi
has_select=no
if sh ./hasgot select; then
echo "select() found."
echo "#define HAS_SELECT" >> s.h
has_select=yes
fi
if sh ./hasgot -i sys/select.h; then
echo "sys/select.h found."
echo "#define HAS_SYS_SELECT_H" >> s.h
fi
if sh ./hasgot symlink readlink lstat; then
echo "symlink() found."
echo "#define HAS_SYMLINK" >> s.h
fi
has_wait=no
if sh ./hasgot waitpid; then
echo "waitpid() found."
echo "#define HAS_WAITPID" >> s.h
has_wait=yes
fi
if sh ./hasgot wait4; then
echo "wait4() found."
echo "#define HAS_WAIT4" >> s.h
has_wait=yes
fi
if sh ./hasgot -i sys/param.h && sh ./runtest getgroups.c; then
echo "getgroups() found."
echo "#define HAS_GETGROUPS" >> s.h
fi
if sh ./hasgot -i termios.h &&
sh ./hasgot tcgetattr tcsetattr tcsendbreak tcflush tcflow; then
echo "POSIX termios found."
echo "#define HAS_TERMIOS" >> s.h
fi
# Async I/O under OSF1 3.x are so buggy that the test program hangs...
testasyncio=true
if test -f /usr/bin/uname; then
case "`/usr/bin/uname -s -r`" in
"OSF1 V3."*) testasyncio=false;;
esac
fi
if $testasyncio && sh ./runtest async_io.c; then
echo "Asynchronous I/O are supported."
echo "#define HAS_ASYNC_IO" >> s.h
fi
has_setitimer=no
if sh ./hasgot setitimer; then
echo "setitimer() found."
echo "#define HAS_SETITIMER" >> s.h
has_setitimer="yes"
fi
if sh ./hasgot gethostname; then
echo "gethostname() found."
echo "#define HAS_GETHOSTNAME" >> s.h
fi
if sh ./hasgot -i sys/utsname.h && sh ./hasgot uname; then
echo "uname() found."
echo "#define HAS_UNAME" >> s.h
fi
has_gettimeofday=no
if sh ./hasgot gettimeofday; then
echo "gettimeofday() found."
echo "#define HAS_GETTIMEOFDAY" >> s.h
has_gettimeofday="yes"
fi
if sh ./hasgot mktime; then
echo "mktime() found."
echo "#define HAS_MKTIME" >> s.h
fi
if sh ./hasgot setsid; then
echo "setsid() found."
echo "#define HAS_SETSID" >> s.h
fi
# Determine if the debugger is supported
if test "$has_sockets" = "yes"; then
echo "Replay debugger supported."
debugger="ocamldebugger"
else
echo "No replay debugger (missing system calls)"
debugger=""
fi
# Determine the target architecture for the "num" library
case "$host" in
mips-*-ultrix*) bignum_arch=mips;;
alpha-*-osf*) bignum_arch=alpha;;
i960*) bignum_arch=i960;;
sparc-*-sunos*) bignum_arch=supersparc;;
sparc-*-solaris*) bignum_arch=supersparc-solaris;;
sparc-*-*bsd*) bignum_arch=sparc;;
m68k-*-sunos*) bignum_arch=68K;;
*) bignum_arch=C
esac
echo "BIGNUM_ARCH=$bignum_arch" >> Makefile
# Determine if the threads library is supported
if test "$posix_threads" = "yes"; then
echo "Threads library supported (using POSIX system threads)."
otherlibraries="$otherlibraries systhreads"
elif test "$has_select" = "yes" \
&& test "$has_setitimer" = "yes" \
&& test "$has_gettimeofday" = "yes" \
&& test "$has_wait" = "yes"; then
echo "Threads library supported."
otherlibraries="$otherlibraries threads"
else
echo "No threads library (missing system calls)"
fi
# Determine the location of X include files and libraries
x11_include="not found"
x11_link="not found"
for dir in $x11_include_dir \
/usr/X11R6/include /usr/X11R5/include /usr/X11R4/include \
/usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 \
/usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include \
/usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 \
/usr/X11/include /usr/include/X11 /usr/local/X11/include \
/usr/local/include/X11 /usr/X386/include /usr/x386/include \
/usr/XFree86/include/X11 /usr/include /usr/local/include \
/usr/unsupported/include /usr/athena/include /usr/local/x11r5/include \
/usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include \
/opt/X11R6/include /opt/X11R5/include
do
if test -f $dir/X11/X.h; then
x11_include=$dir
break
fi
done
for dir in $x11_lib_dir \
/usr/X11R6/lib /usr/X11R5/lib /usr/X11R4/lib \
/usr/lib/X11R6 /usr/lib/X11R5 /usr/lib/X11R4 \
/usr/local/X11R6/lib /usr/local/X11R5/lib /usr/local/X11R4/lib \
/usr/local/lib/X11R6 /usr/local/lib/X11R5 /usr/local/lib/X11R4 \
/usr/X11/lib /usr/lib/X11 /usr/local/X11/lib \
/usr/local/lib/X11 /usr/X386/lib /usr/x386/lib \
/usr/XFree86/lib/X11 /usr/lib /usr/local/lib \
/usr/unsupported/lib /usr/athena/lib /usr/local/x11r5/lib \
/usr/lpp/Xamples/lib /usr/openwin/lib /usr/openwin/share/lib \
/opt/X11R6/lib /opt/X11R5/lib
do
if test -f $dir/libX11.a || \
test -f $dir/libX11.so || \
test -f $dir/libX11.sa; then
x11_link="-cclib -L$dir -cclib -lX11"
break
fi
done
if test "$x11_include" = "not found" || test "$x11_link" = "not found"
then
echo "X11 not found, the \"graph\" library will not be supported."
else
echo "Location of X11 include files: $x11_include/X11"
echo "Options for linking with X11: $x11_link"
otherlibraries="$otherlibraries graph"
if test "$x11_include" = "/usr/include"; then
x11_include=""
else
x11_include="-I$x11_include"
fi
echo "X11_INCLUDES=$x11_include" >> Makefile
echo "X11_LINK=$x11_link" >> Makefile
fi
# See if we can compile the dbm library
if sh ./hasgot -i ndbm.h
then
echo "NDBM library found."
otherlibraries="$otherlibraries dbm"
else
echo "NDBM not found, the \"dbm\" library will not be supported."
fi
# Finish generated files
cclibs="$cclibs -lm"
echo "CCLIBS=$cclibs" >> Makefile
echo "OTHERLIBRARIES=$otherlibraries" >> Makefile
echo "DEBUGGER=$debugger" >> Makefile
rm -f tst hasgot.c
rm -f ../m.h ../s.h ../Makefile
mv m.h s.h Makefile ..
# Print a summary
echo
echo "** Configuration summary **"
echo
echo "Directories where Objective Caml will be installed:"
echo " binaries.................. $bindir"
echo " standard library.......... $libdir"
echo " manual pages.............. $mandir (with extension .$manext)"
echo "Configuration for the bytecode compiler:"
echo " C compiler used........... $bytecc"
echo " options for compiling..... $bytecccompopts"
echo " options for linking....... $bytecclinkopts $cclibs"
echo "Configuration for the native-code compiler:"
if test "$arch" = "none"; then
echo " (not supported on this platform)"
else
if test "$model" = "default"; then
echo " hardware architecture..... $arch"
else
echo " hardware architecture..... $arch ($model)"
fi
if test "$system" = "unknown"; then : ; else
echo " OS variant................ $system"
fi
echo " C compiler used........... $nativecc"
echo " options for compiling..... $nativecccompopts"
echo " options for linking....... $nativecclinkopts $cclibs"
echo " assembler ................ \$(AS) $asflags"
echo " preprocessed assembler ... $aspp $asppflags"
fi
if test "$debugger" = "ocamldebugger"; then
echo "Source-level replay debugger: supported"
else
echo "Source-level replay debugger: not supported"
fi
echo "Configuration for the external libraries:"
echo " libraries supported....... $otherlibraries"
echo "The \"num\" library:"
echo " target architecture ...... $bignum_arch"
if test "$x11_include" != "not found" && test "$x11_lib" != "not found"; then
echo "The \"graph\" library:"
echo " options for compiling .... $x11_include"
echo " options for linking ...... $x11_link"
fi
|