forked from gambit/gambit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
2784 lines (2195 loc) · 89.3 KB
/
configure.ac
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
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Configure template for Gambit-C system.
# Copyright (c) 1994-2015 by Marc Feeley, All Rights Reserved.
# Process this file with autoconf to produce a configure script.
AC_INIT(Gambit-C,v4.7.5,[email protected],gambc-v4_7_5)
AC_CONFIG_HEADERS(include/config.h)
PACKAGE_SHORTNAME="gambc"
AC_SUBST(PACKAGE_SHORTNAME)
AC_SUBST(PACKAGE_NAME)
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(PACKAGE_STRING)
AC_SUBST(PACKAGE_BUGREPORT)
AC_SUBST(PACKAGE_TARNAME)
AC_COPYRIGHT([[Copyright (c) 1994-2015 by Marc Feeley, All Rights Reserved.]])
AC_CONFIG_SRCDIR(include/gambit.h.in)
AC_PREFIX_DEFAULT(`if test -d "C:" ; then
echo "C:/Program Files/$PACKAGE_NAME" ;
else
echo "/usr/local/$PACKAGE_NAME" ;
fi`)
AC_CANONICAL_SYSTEM
###############################################################################
#
# Accumulate subsystems to include in runtime library.
RTLIBSUBSYS=""
RTLIBMAKEFILES=""
###############################################################################
#
# To accumulate flags and definitions for C compilation.
GAMBCLIB_DEFS=""
FLAGS_OBJ=""
FLAGS_DYN=""
FLAGS_LIB=""
FLAGS_EXE=""
FLAGS_OBJ_DYN=""
FLAGS_OBJ_DYN_LIB_EXE=""
FLAGS_DYN_LIB=""
DEFS_OBJ=""
DEFS_DYN="-D___DYNAMIC"
DEFS_LIB=""
DEFS_EXE=""
DEFS_OBJ_DYN_LIB_EXE=""
COMPILATION_OPTIONS=""
###############################################################################
#
# Check if the system must be compiled using the C compiler or C++ compiler.
AC_ARG_ENABLE(cplusplus,
AC_HELP_STRING([--enable-cplusplus],
[compile using C++ compiler (default is NO)]),
ENABLE_CPLUSPLUS=$enableval,
ENABLE_CPLUSPLUS=no)
if test "${CFLAGS+set}" != set; then
CFLAGS=""
fi
if test "${CXXFLAGS+set}" != set; then
CXXFLAGS=""
fi
if test "${LDFLAGS+set}" != set; then
LDFLAGS=""
fi
case "$target_os" in
darwin*) if test "$CC" = ""; then
SEARCH_LIST_FOR_CC="i686-apple-darwin11-gcc-4.2.1 i686-apple-darwin10-gcc-4.2.1 gcc clang"
for cc in $SEARCH_LIST_FOR_CC; do
AC_CHECK_PROG(HAVE_SPECIAL_CC, $cc, yes)
if test "$HAVE_SPECIAL_CC" = yes; then
CC=$cc
break
fi
unset ac_cv_prog_HAVE_SPECIAL_CC
done
fi
if test "$CXX" = "" -a "$ENABLE_CPLUSPLUS" = yes; then
SEARCH_LIST_FOR_CXX="i686-apple-darwin11-g++-4.2.1 i686-apple-darwin10-g++-4.2.1 g++ clang++"
for cxx in $SEARCH_LIST_FOR_CXX; do
AC_CHECK_PROG(HAVE_SPECIAL_CXX, $cxx, yes)
if test "$HAVE_SPECIAL_CXX" = yes; then
CXX=$cxx
break
fi
unset ac_cv_prog_HAVE_SPECIAL_CXX
done
fi
;;
esac
AC_LANG(C)
AC_PROG_CC
AC_PROG_CPP
C_COMPILER=$CC
C_PREPROC=$CPP
if test "$ENABLE_CPLUSPLUS" = yes; then
AC_LANG(C++)
AC_PROG_CXX
AC_PROG_CXXCPP
C_COMPILER=$CXX
C_PREPROC=$CXXCPP
fi
AC_SUBST(C_COMPILER)
AC_SUBST(C_PREPROC)
AC_SUBST(C_COMPILER_MF)
AC_SUBST(C_PREPROC_MF)
AC_SUBST(C_COMPILER_SH)
AC_SUBST(C_PREPROC_SH)
AC_SUBST(C_COMPILER_BAT)
AC_SUBST(C_PREPROC_BAT)
###############################################################################
#
# Check if the system must include GUIDE (Gambit Universal IDE).
AC_ARG_ENABLE(guide,
AC_HELP_STRING([--enable-guide],
[include the Gambit Universal IDE (default is NO)]),
ENABLE_GUIDE=$enableval,
ENABLE_GUIDE=no)
if test "$ENABLE_GUIDE" = yes; then
if test "$ENABLE_CPLUSPLUS" = yes; then
# Determine if Qt is available, if the version is good, etc
ac_qmake='qmake -o conftest.qt /dev/null >&5'
rm -f conftest.qt
if { (eval echo "$as_me:$LINENO: \"$ac_qmake\"") >&5
(eval $ac_qmake) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
ac_qt_version_check="grep -q '^# Generated by qmake ([^)]*) (Qt 3\\.3\\..*' conftest.qt"
if { (eval echo "$as_me:$LINENO: \"$ac_qt_version_check\"") >&5
(eval $ac_qt_version_check) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
QTINCPATH=`sed -n -e '/^INCPATH[[ ]]*=[[ ]]*\(.*\)/s//\1/p' conftest.qt`
QTLIBS=`sed -n -e '/^LIBS[[ ]]*=[[ ]]*\\\$(SUBLIBS)[[ ]]*\(.*\)/s//\1/p' conftest.qt`
else
qt_version=`sed -n -e '/^# Generated by qmake (\([^)]*\)) (Qt \([0-9]*\.[0-9]*\).*/s//\2/p' conftest.qt`
ENABLE_GUIDE=no
AC_MSG_NOTICE([
************************************************************************
*** ***
*** The Gambit Universal IDE requires that the system be built using ***
*** the Qt GUI library version 3.3. Version $qt_version of Qt is currently ***
*** installed. ***
*** ***
************************************************************************
])
fi
else
ENABLE_GUIDE=no
AC_MSG_NOTICE([
************************************************************************
*** ***
*** The Gambit Universal IDE requires that the system be built using ***
*** the Qt GUI library. This library could not be located. Make ***
*** sure that the program qmake is in your PATH. ***
*** ***
************************************************************************
])
fi
else
ENABLE_GUIDE=no
AC_MSG_NOTICE([
************************************************************************
*** ***
*** The Gambit Universal IDE requires that the system be built using ***
*** a C++ compiler. You must specify both "--enable-cplusplus" and ***
*** "--enable-guide" to include the Gambit Universal IDE. ***
*** ***
************************************************************************
])
fi
fi
if test "$ENABLE_GUIDE" = yes; then
AC_DEFINE([___GUIDE],[],[Enable GUIDE])
AC_SUBST(QTINCPATH)
RTLIBSUBSYS="$RTLIBSUBSYS guide"
RTLIBMAKEFILES="$RTLIBMAKEFILES lib/guide/guidepro lib/guide/makefile lib/guide/images/makefile"
LIBS="$LIBS $QTLIBS"
fi
AC_SUBST(ENABLE_GUIDE)
###############################################################################
#
# Check if a specific C optimization level should be used. An
# optimization level of -O1 will be used by default.
AC_ARG_ENABLE(c-opt,
AC_HELP_STRING([--enable-c-opt@<:@=level@:>@],
[use higher C optimization level (default is NO)]),
ENABLE_C_OPT=$enableval,
ENABLE_C_OPT=no)
###############################################################################
#
# Check if the system is to be debugged.
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[build system so that it can be debugged (default is NO)]),
ENABLE_DEBUG=$enableval,
ENABLE_DEBUG=no)
if test "$ENABLE_DEBUG" = yes; then
AC_DEFINE([___DEBUG],[],[Enable debugging])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___DEBUG"
fi
###############################################################################
#
# Check if the system is to be profiled.
AC_ARG_ENABLE(profile,
AC_HELP_STRING([--enable-profile],
[build system so that it can be profiled (default is NO)]),
ENABLE_PROFILE=$enableval,
ENABLE_PROFILE=no)
if test "$ENABLE_PROFILE" = yes; then
AC_DEFINE([___PROFILE],[],[Enable profiling])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___PROFILE"
fi
###############################################################################
#
# Check if the system is to be compiled to accumulate coverage statistics.
AC_ARG_ENABLE(coverage,
AC_HELP_STRING([--enable-coverage],
[build system to accumulate coverage statistics (default is NO)]),
ENABLE_COVERAGE=$enableval,
ENABLE_COVERAGE=no)
###############################################################################
#
# Check if the system is to be compiled with trial run feedback.
AC_ARG_ENABLE(feedback1,
AC_HELP_STRING([--enable-feedback1],
[build system to accumulate trial run data (default is NO)]),
ENABLE_FEEDBACK1=$enableval,
ENABLE_FEEDBACK1=no)
AC_ARG_ENABLE(feedback2,
AC_HELP_STRING([--enable-feedback2],
[build system using trial run feedback (default is NO)]),
ENABLE_FEEDBACK2=$enableval,
ENABLE_FEEDBACK2=no)
###############################################################################
#
# Check if a single C function should be generated for all the Scheme
# functions in a file. This makes the executable much faster but the
# compilation will be much longer and take much more memory.
AC_ARG_ENABLE(single-host,
AC_HELP_STRING([--enable-single-host],
[compile each Scheme module as a single C function (default is NO)]),
ENABLE_SINGLE_HOST=$enableval,
ENABLE_SINGLE_HOST=no)
if test "$ENABLE_SINGLE_HOST" = yes; then
AC_DEFINE([___SINGLE_HOST],[],[Enable single host mode])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___SINGLE_HOST"
fi
###############################################################################
#
# Check if inline code should be generated for jumps. It is possible
# that on some platforms this will result in a faster but larger
# executable program.
AC_ARG_ENABLE(inline-jumps,
AC_HELP_STRING([--enable-inline-jumps],
[generate inline code for jumps (default is NO)]),
ENABLE_INLINE_JUMPS=$enableval,
ENABLE_INLINE_JUMPS=no)
if test "$ENABLE_INLINE_JUMPS" = yes; then
AC_DEFINE([___INLINE_JUMPS],[],[Enable inlining of jumps])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___INLINE_JUMPS"
fi
###############################################################################
#
# Check if expensive GCC optimizations should be used. This makes the
# executable faster but the compilation will be much longer and take
# much more memory.
AC_ARG_ENABLE(gcc-opts,
AC_HELP_STRING([--enable-gcc-opts],
[use expensive GCC optimizations (default is NO)]),
ENABLE_GCC_OPTS=$enableval,
ENABLE_GCC_OPTS=no)
###############################################################################
#
# Check if GNU GCC specific options should be used. When the system
# is to be built in a setting where the target C compiler is either
# the GNU GCC or the LLVM GCC it is advisable to avoid using GNU GCC
# specific options that are not accepted by the LLVM GCC compiler
# (this is the case on OS X, where the program "gcc" may be the LLVM
# GCC which is part of Xcode, or the GNU GCC if it was installed
# manually).
AC_ARG_ENABLE(gnu-gcc-specific-options,
AC_HELP_STRING([--enable-gnu-gcc-specific-options],
[use GNU GCC specific options (default is YES)]),
ENABLE_GNU_GCC_SPECIFIC_OPTIONS=$enableval,
ENABLE_GNU_GCC_SPECIFIC_OPTIONS=yes)
AC_ARG_ENABLE(gnu-gcc-no-strict-aliasing,
AC_HELP_STRING([--enable-gnu-gcc-no-strict-aliasing],
[use GNU GCC -fno-strict-aliasing option (default is YES)]),
ENABLE_GNU_GCC_NO_STRICT_ALIASING=$enableval,
ENABLE_GNU_GCC_NO_STRICT_ALIASING=yes)
###############################################################################
#
# Check the width of Scheme characters.
AC_ARG_ENABLE(char-size,
AC_HELP_STRING([--enable-char-size=N],
[Scheme character size in bytes (default is 4)]),
CHAR_SIZE=$enableval,
CHAR_SIZE=4)
if test "$CHAR_SIZE" = 1; then
CONF_MAX_CHR="0xff"
else
if test "$CHAR_SIZE" = 2; then
CONF_MAX_CHR="0xffff"
else
CONF_MAX_CHR="0x10ffff"
fi
fi
AC_SUBST(CONF_MAX_CHR)
###############################################################################
#
# Check the encoding of filesystem paths.
AC_ARG_ENABLE(path-encoding,
AC_HELP_STRING([--enable-path-encoding=utf8|latin1|ucs2|ucs4|wchar|native],
[Filesystem path encoding (default is ucs2 on Windows and utf8 on other OSes)]),
ENABLE_PATH_ENCODING=$enableval,
ENABLE_PATH_ENCODING=no)
if test "$ENABLE_PATH_ENCODING" = utf8; then
AC_DEFINE([___PATH_ENCODING_UTF8],[],[Select UTF-8 for path encoding])
else
if test "$ENABLE_PATH_ENCODING" = latin1; then
AC_DEFINE([___PATH_ENCODING_LATIN1],[],[Select LATIN-1 for path encoding])
else
if test "$ENABLE_PATH_ENCODING" = ucs2; then
AC_DEFINE([___PATH_ENCODING_UCS2],[],[Select UCS-2 for path encoding])
else
if test "$ENABLE_PATH_ENCODING" = ucs4; then
AC_DEFINE([___PATH_ENCODING_UCS4],[],[Select UCS-4 for path encoding])
else
if test "$ENABLE_PATH_ENCODING" = wchar; then
AC_DEFINE([___PATH_ENCODING_WCHAR],[],[Select WCHAR for path encoding])
else
if test "$ENABLE_PATH_ENCODING" = native; then
AC_DEFINE([___PATH_ENCODING_NATIVE],[],[Select NATIVE for path encoding])
fi
fi
fi
fi
fi
fi
###############################################################################
#
# Check the size of the type "void*". On many systems it is the same
# size as "long". If this isn't the case then define
# ___VOIDSTAR_WIDTH appropriately.
AC_CHECK_SIZEOF(void*)
AC_CHECK_SIZEOF(long)
if test "$ac_cv_sizeof_voidp" != "$ac_cv_sizeof_long"; then
CONF_VOIDSTAR_WIDTH="($ac_cv_sizeof_voidp * ___CHAR_WIDTH)"
else
CONF_VOIDSTAR_WIDTH="___LONG_WIDTH"
fi
AC_SUBST(CONF_VOIDSTAR_WIDTH)
###############################################################################
#
# Check for existence of the type "bool". If the compiler does not
# support it, the ___BOOL type will be mapped to "int".
AC_CHECK_TYPE([bool])
if test "$ac_cv_type_bool" = yes; then
CONF_BOOL="bool"
else
CONF_BOOL="int"
fi
AC_SUBST(CONF_BOOL)
###############################################################################
#
# Check if a shared library must be built.
AC_ARG_ENABLE(shared,
AC_HELP_STRING([--enable-shared],
[build the Scheme runtime system as a shared library (default is NO)]),
ENABLE_SHARED=$enableval,
ENABLE_SHARED=no)
if test "$ENABLE_SHARED" = yes; then
AC_DEFINE([___SHARED],[],[Enable shared libraries])
# don't add to DEFS_OBJ_DYN_LIB_EXE
fi
###############################################################################
#
# Check if only ANSI C headers and libraries should be used.
AC_ARG_ENABLE(ansi-c,
AC_HELP_STRING([--enable-ansi-c],
[link only with ANSI C libraries (default is NO)]),
ANSI_C=$enableval,
ANSI_C=no)
###############################################################################
#
# Check if symbolic links should be used for files not in the
# central installation directory.
AC_ARG_ENABLE(symlinks,
AC_HELP_STRING([--enable-symlinks],
[use symbolic links for installed files not in the central installation directory (default is YES)]),
ENABLE_SYMLINKS=$enableval,
ENABLE_SYMLINKS=no)
###############################################################################
#
# Determine the name to use for the Gambit interpreter and compiler.
AC_ARG_ENABLE(interpreter-name,
AC_HELP_STRING([--enable-interpreter-name=INTERP],
[Name to use for Gambit interpreter (default is gsi)]),
ENABLE_INTERPRETER_NAME=$enableval,
ENABLE_INTERPRETER_NAME="gsi")
AC_ARG_ENABLE(compiler-name,
AC_HELP_STRING([--enable-compiler-name=COMP],
[Name to use for Gambit compiler (default is gsc)]),
ENABLE_COMPILER_NAME=$enableval,
ENABLE_COMPILER_NAME="gsc")
###############################################################################
#
# Check if multiple installed versions are supported.
AC_ARG_ENABLE(multiple-versions,
AC_HELP_STRING([--enable-multiple-versions],
[multiple installed versions are supported (default is NO)]),
ENABLE_MULTIPLE_VERSIONS=$enableval,
ENABLE_MULTIPLE_VERSIONS=no)
###############################################################################
#
# Check if shared libraries should be linked to using an absolute path.
AC_ARG_ENABLE(absolute-shared-libs,
AC_HELP_STRING([--enable-absolute-shared-libs],
[shared libraries should be linked to using an absolute path (default is YES)]),
ENABLE_ABSOLUTE_SHARED_LIBS=$enableval,
ENABLE_ABSOLUTE_SHARED_LIBS=yes)
if test "$ENABLE_SHARED" != yes; then
ENABLE_ABSOLUTE_SHARED_LIBS=no
fi
###############################################################################
#
# Check if library names should contain a version number suffix.
AC_ARG_ENABLE(versioned-shared-libs,
AC_HELP_STRING([--enable-versioned-shared-libs],
[library names should contain a version number suffix (default is NO)]),
ENABLE_VERSIONED_SHARED_LIBS=$enableval,
ENABLE_VERSIONED_SHARED_LIBS=no)
###############################################################################
#
# Check if library names should contain a special suffix.
AC_ARG_ENABLE(lib-suffix,
AC_HELP_STRING([--enable-lib-suffix],
[library names should contain a suffix before the extension (default is NO)]),
LIB_SUFFIX=$enableval,
LIB_SUFFIX=no)
if test "$LIB_SUFFIX" = no; then
LIB_SUFFIX=""
else
if test "$LIB_SUFFIX" = yes; then
LIB_SUFFIX="-`echo $PACKAGE_VERSION | sed -e 's/\./_/g'`"
fi
fi
###############################################################################
#
# Determine which browser to use for help.
AC_ARG_ENABLE(help-browser,
AC_HELP_STRING([--enable-help-browser=BROWSER],
[Browser to use for help (default is to search)]),
HELP_BROWSER=$enableval,
HELP_BROWSER="")
###############################################################################
#
# Check if the system must perform type checking.
AC_ARG_ENABLE(type-checking,
AC_HELP_STRING([--enable-type-checking],
[perform type checking (default is YES)]),
ENABLE_TYPE_CHECKING=$enableval,
ENABLE_TYPE_CHECKING=yes)
if test "$ENABLE_TYPE_CHECKING" = yes; then
COMPILATION_OPTIONS="$COMPILATION_OPTIONS -check"
fi
###############################################################################
#
# Check if the system must automatically force promises.
AC_ARG_ENABLE(auto-forcing,
AC_HELP_STRING([--enable-auto-forcing],
[automatically force promises (default is NO)]),
ENABLE_AUTO_FORCING=$enableval,
ENABLE_AUTO_FORCING=no)
if test "$ENABLE_AUTO_FORCING" = yes; then
COMPILATION_OPTIONS="$COMPILATION_OPTIONS -force"
fi
###############################################################################
#
# Check if debugging information for the Scheme runtime library is to
# be generated when the system is bootstrapped (with
# "make bootstrap; make bootclean; make").
AC_ARG_ENABLE(rtlib-debug,
AC_HELP_STRING([--enable-rtlib-debug],
[Include all debugging information in the code generated for the Scheme runtime library (default is NO)]),
ENABLE_RTLIB_DEBUG=$enableval,
ENABLE_RTLIB_DEBUG=no)
if test "$ENABLE_RTLIB_DEBUG" = yes; then
COMPILATION_OPTIONS="$COMPILATION_OPTIONS -debug"
fi
AC_ARG_ENABLE(rtlib-debug-location,
AC_HELP_STRING([--enable-rtlib-debug-location],
[Include source code location debugging information in the code generated for the Scheme runtime library (default is NO)]),
ENABLE_RTLIB_DEBUG_LOCATION=$enableval,
ENABLE_RTLIB_DEBUG_LOCATION=no)
if test "$ENABLE_RTLIB_DEBUG_LOCATION" = yes; then
COMPILATION_OPTIONS="$COMPILATION_OPTIONS -debug-location"
fi
AC_ARG_ENABLE(rtlib-debug-source,
AC_HELP_STRING([--enable-rtlib-debug-source],
[Include the source code debugging information in the code generated for the Scheme runtime library (default is NO)]),
ENABLE_RTLIB_DEBUG_SOURCE=$enableval,
ENABLE_RTLIB_DEBUG_SOURCE=no)
if test "$ENABLE_RTLIB_DEBUG_SOURCE" = yes; then
COMPILATION_OPTIONS="$COMPILATION_OPTIONS -debug-source"
fi
AC_ARG_ENABLE(rtlib-debug-environments,
AC_HELP_STRING([--enable-rtlib-debug-environments],
[Include environment debugging information in the code generated for the Scheme runtime library (default is NO)]),
ENABLE_RTLIB_DEBUG_ENVIRONMENTS=$enableval,
ENABLE_RTLIB_DEBUG_ENVIRONMENTS=no)
if test "$ENABLE_RTLIB_DEBUG_ENVIRONMENTS" = yes; then
COMPILATION_OPTIONS="$COMPILATION_OPTIONS -debug-environments"
fi
AC_ARG_ENABLE(track-scheme,
AC_HELP_STRING([--enable-track-scheme],
[Include Scheme code location in C code generated (default is NO)]),
ENABLE_TRACK_SCHEME=$enableval,
ENABLE_TRACK_SCHEME=no)
if test "$ENABLE_TRACK_SCHEME" = yes; then
COMPILATION_OPTIONS="$COMPILATION_OPTIONS -track-scheme"
fi
###############################################################################
#
# Check whether to enable poll as the select method
AC_ARG_ENABLE(poll,
AC_HELP_STRING([--enable-poll],
[Enable poll as the select method (default is NO)]),
ENABLE_POLL=$enableval,
ENABLE_POLL=no)
if test "$ENABLE_POLL" = yes; then
AC_DEFINE([USE_POLL_FOR_SELECT],[],[Enable use of poll instead of select])
fi
###############################################################################
#
# Check whether to enable high-resolution timing
AC_ARG_ENABLE(high-res-timing,
AC_HELP_STRING([--enable-high-res-timing],
[Enable high-resolution timing (default is NO)]),
ENABLE_HIGH_RES_TIMING=$enableval,
ENABLE_HIGH_RES_TIMING=no)
if test "$ENABLE_HIGH_RES_TIMING" = yes; then
AC_DEFINE([USE_HIGH_RES_TIMING],[],[Enable high-resolution timing])
fi
###############################################################################
#
# Check if the runtime system must be compiled to support multiple
# Gambit VM instances or not. A Gambit VM instance has its own global
# environment and heap, separate from other Gambit VM instances.
AC_ARG_ENABLE(multiple-vms,
AC_HELP_STRING([--enable-multiple-vms],
[support multiple Gambit VM instances (default is NO)]),
ENABLE_MULTIPLE_VMS=$enableval,
ENABLE_MULTIPLE_VMS=no)
if test "$ENABLE_MULTIPLE_VMS" = no; then
CONF_SINGLE_MULTIPLE_VMS="___SINGLE_VM"
else
CONF_SINGLE_MULTIPLE_VMS="___MULTIPLE_VMS"
fi
AC_SUBST(CONF_SINGLE_MULTIPLE_VMS)
###############################################################################
#
# Check if the runtime system must be compiled to support multiple OS
# threads per Gambit VM instance. In other words, is it allowed for
# multiple OS threads to be running in a given VM instance?
AC_ARG_ENABLE(multiple-threaded-vms,
AC_HELP_STRING([--enable-multiple-threaded-vms],
[support multiple OS threads per Gambit VM instance (default is NO)]),
ENABLE_MULTIPLE_THREADED_VMS=$enableval,
ENABLE_MULTIPLE_THREADED_VMS=no)
if test "$ENABLE_MULTIPLE_THREADED_VMS" = no; then
CONF_SINGLE_MULTIPLE_THREADED_VMS="___SINGLE_THREADED_VMS"
else
CONF_SINGLE_MULTIPLE_THREADED_VMS="___MULTIPLE_THREADED_VMS"
fi
AC_SUBST(CONF_SINGLE_MULTIPLE_THREADED_VMS)
###############################################################################
#
# Check if OS threads are supported by the runtime system and if so
# which thread system is to be used.
AC_ARG_ENABLE(thread-system,
AC_HELP_STRING([--enable-thread-system@<:@=thread-system@:>@],
[use OS threads (default is NO)]),
ENABLE_THREAD_SYSTEM=$enableval,
ENABLE_THREAD_SYSTEM=no)
if test "$ENABLE_THREAD_SYSTEM" = no; then
if test "$ENABLE_MULTIPLE_VMS" != no -o "$ENABLE_MULTIPLE_THREADED_VMS" != no; then
ENABLE_THREAD_SYSTEM=yes
fi
fi
###############################################################################
#
# Check if SSL support should be added using OpenSSL.
AC_ARG_ENABLE(openssl,
AC_HELP_STRING([--enable-openssl],
[compile with SSL support using OpenSSL (default is NO)]),
ENABLE_OPENSSL=$enableval,
ENABLE_OPENSSL=no)
if test "$ENABLE_OPENSSL" = yes; then
AC_DEFINE([USE_OPENSSL],[],[Enable SSL support using OpenSSL])
AC_SEARCH_LIBS([main], [ssl crypto], [], [
AC_MSG_ERROR([unable to find the SSL libraries])
])
fi
###############################################################################
#
# Check for C compiler.
AC_DEFUN([AC_CHECK_C_COMPILER_DEF],
[AC_CACHE_CHECK([whether $C_COMPILER defines $1], [ac_cv_$2],
[
rm -f conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
int
main ()
{
#ifndef $1
choke me
#endif
;
return 0;
}
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
ac_cv_$2="yes"
else
ac_cv_$2=""
fi
])
$2="$ac_cv_$2"
AC_SUBST($2)
])
AC_DEFUN([AC_CHECK_C_COMPILER_OPT],
[AC_CACHE_CHECK([whether $C_COMPILER accepts $1], [ac_cv_$2],
[
rm -f conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
int
main ()
{
return 0;
}
_ACEOF
ac_test_CFLAGS=${CFLAGS+set}
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CFLAGS=$CFLAGS
ac_save_CXXFLAGS=$CXXFLAGS
CFLAGS="$1$3"
CXXFLAGS="$1$3"
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
ac_cv_$2=" $1"
else
ac_cv_$2=""
fi
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
fi
if test "$ac_test_CXXFLAGS" = set; then
CXXFLAGS=$ac_save_CXXFLAGS
fi
])
$2="$ac_cv_$2"
AC_SUBST($2)
])
AC_DEFUN([AC_CHECK_C_COMPILER_CPP_EXPR],
[AC_CACHE_CHECK([how $C_COMPILER's preprocessor evaluates $1], [ac_cv_$2],
[
rm -f conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
int
main ()
{
#if $1
#else
choke me
#endif
;
return 0;
}
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
ac_cv_$2="yes"
else
ac_cv_$2=""
fi
])
$2="$ac_cv_$2"
AC_SUBST($2)
])
AC_CHECK_C_COMPILER_DEF(__GNUC__,C_COMP_GNUC)
AC_CHECK_C_COMPILER_DEF(__clang__,C_COMP_CLANG)
AC_CHECK_C_COMPILER_DEF(__llvm__,C_COMP_LLVM)
AC_CHECK_C_COMPILER_DEF(_MSC_VER,C_COMP_VISUALC)
#AC_CHECK_C_COMPILER_DEF(__WATCOMC__,C_COMP_WATCOMC)
#AC_CHECK_C_COMPILER_DEF(__BORLANDC__,C_COMP_BORLANDC)
AC_CHECK_C_COMPILER_DEF(_WIN32,OS_WIN32)
###############################################################################
#
# Check for header files.
AC_CHECK_HEADERS(errno.h)
AC_CHECK_HEADERS(float.h)
AC_CHECK_HEADERS(signal.h)
AC_CHECK_HEADERS(stdio.h)
AC_CHECK_HEADERS(stdlib.h)
AC_CHECK_HEADERS(string.h)
AC_CHECK_HEADERS(time.h)
if test "$ANSI_C" = yes; then
# Check if linking to the math library needs some special linker flags.
AC_SEARCH_LIBS(asin,m)
# The following functions should be provided by an ANSI-C conforming
# compiler, but it is safest to double check. If they are not
# available, the system will still compile but some functionality
# will be missing from the Gambit runtime system.
AC_CHECK_FUNCS(getenv)
AC_CHECK_FUNCS(time)
AC_CHECK_FUNCS(clock)
else
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(pwd.h)
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_HEADERS(dl.h)
AC_CHECK_HEADERS(sys/dxe.h)
AC_CHECK_HEADERS(mach-o/dyld.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(sys/times.h)
AC_CHECK_HEADERS(sys/timeb.h)
AC_CHECK_HEADERS(sys/timers.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/stat.h)
AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_HEADERS(sys/mman.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS(stat.h)
AC_CHECK_HEADERS(netdb.h)
AC_CHECK_HEADERS(grp.h)
#AC_CHECK_HEADERS(windows.h)
#AC_CHECK_HEADERS(io.h)
#AC_CHECK_HEADERS(tchar.h)
AC_CHECK_HEADERS(fpu_control.h)
AC_CHECK_HEADERS(os2.h)
AC_CHECK_HEADERS(dos.h)
AC_CHECK_HEADERS(direct.h)
#AC_CHECK_HEADERS(Retrace.h)
#AC_CHECK_HEADERS(Files.h)
#AC_CHECK_HEADERS(Finder.h)
#AC_CHECK_HEADERS(Errors.h)
#AC_CHECK_HEADERS(Folders.h)
#AC_CHECK_HEADERS(OSUtils.h)
#AC_CHECK_HEADERS(Power.h)
#AC_CHECK_HEADERS(CodeFragments.h)
#AC_CHECK_HEADERS(SIOUX.h)
#AC_CHECK_HEADERS(mac_gui.h)
#AC_CHECK_HEADERS(unix.h)
AC_CHECK_HEADERS(wdefwin.h)
AC_CHECK_HEADERS(tfork.h)
AC_CHECK_HEADERS(curses.h)
AC_CHECK_HEADERS(ncurses.h)
AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(termios.h)
#AC_CHECK_HEADERS(term.h)
AC_CHECK_HEADERS(pty.h)
AC_CHECK_HEADERS(stropts.h)
AC_CHECK_HEADERS(libutil.h)
AC_CHECK_HEADERS(util.h)
AC_CHECK_HEADERS(sys/fpu.h)
AC_CHECK_HEADERS(fenv.h)
AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(strings.h)
AC_CHECK_HEADERS(memory.h)
AC_CHECK_HEADERS(sys/sysctl.h)
AC_CHECK_HEADERS(crt_externs.h)
AC_CHECK_HEADERS(ws2tcpip.h)
AC_CHECK_HEADERS(TargetConditionals.h)
AC_CHECK_HEADERS(poll.h)
if test "$C_COMP_VISUALC" != yes; then
AC_DEFUN([AC_TYPE_SOCKLEN_T],
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
[
AC_TRY_COMPILE(
[#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h>
#endif],
[socklen_t len = 42; return 0;],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no)
])
if test $ac_cv_type_socklen_t != yes; then
AC_DEFINE([socklen_t],[int],[C type for socklen_t])
fi
])