forked from gambit/gambit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
4138 lines (3309 loc) · 138 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 system.
# Copyright (c) 1994-2023 by Marc Feeley, All Rights Reserved.
# Process this file with autoconf to produce a configure script.
AC_INIT(Gambit,v4.9.5,[email protected],gambit-v4_9_5)
AC_CONFIG_HEADERS(include/config.h)
PACKAGE_SHORTNAME="gambit"
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-2020 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`)
# This replace AC_CANONICAL_SYSTEM
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
###############################################################################
#
# Accumulate subsystems to include in runtime library.
RTLIBSUBSYS=""
RTLIBMAKEFILES=""
###############################################################################
#
# To accumulate flags and definitions for C compilation.
GAMBITLIB_DEFS=""
FLAGS_OBJ=""
FLAGS_DYN=""
FLAGS_LIB=""
FLAGS_EXE=""
FLAGS_OBJ_DYN=""
FLAGS_OBJ_DYN_LIB_EXE=""
FLAGS_DYN_LIB=""
FLAGS_OPT=""
FLAGS_OPT_RTS=""
DEFS_OBJ=""
DEFS_DYN="-D___DYNAMIC"
DEFS_LIB=""
DEFS_EXE=""
DEFS_OBJ_DYN_LIB_EXE=""
if test "${COMPILATION_OPTIONS+set}" != set; then
COMPILATION_OPTIONS=""
fi
RTLIB_COND_EXPAND_FEATURES=""
userlibdir="~/.gambit_userlib"
instlibdir="~~userlib"
# use the octal code \\176 instead of ~ to avoid a mingw bug on Windows
userlibdir="`echo $userlibdir | sed -e s/~/\\\\\\\\176/g`"
instlibdir="`echo $instlibdir | sed -e s/~/\\\\\\\\176/g`"
###############################################################################
#
# To accumulate flags to propagate to bootstrap configure script.
BOOTSTRAP_CONFIGURE_FLAGS=""
AC_SUBST(BOOTSTRAP_CONFIGURE_FLAGS)
###############################################################################
#
# Use GNU features when available.
AC_DEFINE([_GNU_SOURCE],[],[Use GNU features when available])
###############################################################################
#
# Check if the system must be compiled using the C compiler or C++ compiler.
AC_ARG_ENABLE(cplusplus,
AS_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
# Don't search for pkg-config, just assume it is in the path
#AC_PATH_PROG(PKG_CONFIG, pkg-config, , $PATH:/usr/bin:/usr/bin/X11:/usr/local/bin)
PKG_CONFIG="pkg-config"
AC_SUBST(C_COMPILER)
AC_SUBST(C_PREPROC)
AC_SUBST(PKG_CONFIG)
AC_SUBST(C_COMPILER_MF)
AC_SUBST(C_PREPROC_MF)
AC_SUBST(PKG_CONFIG_MF)
AC_SUBST(C_COMPILER_SH)
AC_SUBST(C_PREPROC_SH)
AC_SUBST(PKG_CONFIG_SH)
AC_SUBST(C_COMPILER_BAT)
AC_SUBST(C_PREPROC_BAT)
AC_SUBST(PKG_CONFIG_BAT)
###############################################################################
#
# Check if the system must include GUIDE (Gambit Universal IDE).
AC_ARG_ENABLE(guide,
AS_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,
AS_HELP_STRING([--enable-c-opt@<:@=level@:>@],
[use higher C optimization level (default is NO)]),
ENABLE_C_OPT=$enableval,
ENABLE_C_OPT=no)
if test "$ENABLE_C_OPT" != no; then
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-c-opt=$ENABLE_C_OPT"
fi
###############################################################################
#
# Check if a specific C optimization level should be used for the RTS. An
# optimization level of -O3 (if that is available from the compiler) will be
# used by default. If the option is omitted, we treat that as "yes".
AC_ARG_ENABLE(c-opt-rts,
AS_HELP_STRING([--enable-c-opt-rts@<:@=level@:>@],
[use specified C optimization level for the RTS (default is the highest supported by the compiler)]),
ENABLE_C_OPT_RTS=$enableval,
ENABLE_C_OPT_RTS=yes)
if test "$ENABLE_C_OPT_RTS" != yes; then
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-c-opt-rts=$ENABLE_C_OPT_RTS"
fi
###############################################################################
#
# Check if position independent code should be generated (this is usually
# enabled but can cause problems in some situations so this is mostly intended
# as a way to disable it).
AC_ARG_ENABLE(pic,
AS_HELP_STRING([--enable-pic],
[build system with position independent code (default is YES)]),
ENABLE_PIC=$enableval,
ENABLE_PIC=yes)
###############################################################################
#
# Check if the system is to be debugged.
AC_ARG_ENABLE(debug,
AS_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
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-debug"
fi
# Check if a debugging log file (gambit.log) should be generated.
AC_ARG_ENABLE(debug-log,
AS_HELP_STRING([--enable-debug-log],
[build system so that it generates a debugging log file (default is NO)]),
ENABLE_DEBUG_LOG=$enableval,
ENABLE_DEBUG_LOG=no)
if test "$ENABLE_DEBUG_LOG" = yes; then
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-debug-log"
fi
# Check if a C backtrace should be produced when a program crashes.
AC_ARG_ENABLE(debug-c-backtrace,
AS_HELP_STRING([--enable-debug-c-backtrace],
[build system so that it generates a C backtrace when a program crashes (default is NO)]),
ENABLE_DEBUG_C_BACKTRACE=$enableval,
ENABLE_DEBUG_C_BACKTRACE=no)
if test "$ENABLE_DEBUG_C_BACKTRACE" = yes; then
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-debug-c-backtrace"
AC_DEFINE([___DEBUG_C_BACKTRACE],[],[Enable generation of debugging log file])
ENABLE_DEBUG=yes
fi
# Check if debugging of the control flow history is needed.
AC_ARG_ENABLE(debug-ctrl-flow-history,
AS_HELP_STRING([--enable-debug-ctrl-flow-history],
[build system so that it tracks the control flow history (default is NO)]),
ENABLE_DEBUG_CTRL_FLOW_HISTORY=$enableval,
ENABLE_DEBUG_CTRL_FLOW_HISTORY=no)
if test "$ENABLE_DEBUG_CTRL_FLOW_HISTORY" = yes; then
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-debug-ctrl-flow-history"
AC_DEFINE([___DEBUG_CTRL_FLOW_HISTORY],[],[Enable debugging of control flow history])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___DEBUG_CTRL_FLOW_HISTORY"
ENABLE_DEBUG_LOG=yes
fi
# Check if debugging of the host changes is needed.
AC_ARG_ENABLE(debug-host-changes,
AS_HELP_STRING([--enable-debug-host-changes],
[build system so that it tracks the host changes (default is NO)]),
ENABLE_DEBUG_HOST_CHANGES=$enableval,
ENABLE_DEBUG_HOST_CHANGES=no)
if test "$ENABLE_DEBUG_HOST_CHANGES" = yes; then
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-debug-host-changes"
AC_DEFINE([___DEBUG_HOST_CHANGES],[],[Enable debugging of host changes])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___DEBUG_HOST_CHANGES"
ENABLE_DEBUG_LOG=yes
fi
# Check if debugging the memory allocations is needed.
AC_ARG_ENABLE(debug-alloc-mem,
AS_HELP_STRING([--enable-debug-alloc-mem],
[build system so that it tracks the memory allocations (default is NO)]),
ENABLE_DEBUG_ALLOC_MEM=$enableval,
ENABLE_DEBUG_ALLOC_MEM=no)
if test "$ENABLE_DEBUG_ALLOC_MEM" = yes; then
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-debug-alloc-mem"
AC_DEFINE([___DEBUG_ALLOC_MEM],[],[Enable debugging the memory allocations])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___DEBUG_ALLOC_MEM"
ENABLE_DEBUG_LOG=yes
fi
# Check if debugging the garbage collector is needed.
AC_ARG_ENABLE(debug-garbage-collect,
AS_HELP_STRING([--enable-debug-garbage-collect],
[build system so that it detects issues in the garbage collect (default is NO)]),
ENABLE_DEBUG_GARBAGE_COLLECT=$enableval,
ENABLE_DEBUG_GARBAGE_COLLECT=no)
if test "$ENABLE_DEBUG_GARBAGE_COLLECT" = yes; then
BOOTSTRAP_CONFIGURE_FLAGS="$BOOTSTRAP_CONFIGURE_FLAGS --enable-debug-garbage-collect"
AC_DEFINE([___DEBUG_GARBAGE_COLLECT],[],[Enable debugging of garbage collect])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___DEBUG_GARBAGE_COLLECT"
ENABLE_DEBUG_LOG=yes
fi
# Turn on debugging.
if test "$ENABLE_DEBUG" = yes; then
AC_DEFINE([___DEBUG],[],[Enable debugging])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___DEBUG"
fi
if test "$ENABLE_DEBUG_LOG" = yes; then
AC_DEFINE([___DEBUG_LOG],[],[Enable generation of debugging log file])
fi
###############################################################################
#
# Check if the system should keep an activity log.
AC_ARG_ENABLE(activity-log,
AS_HELP_STRING([--enable-activity-log],
[build system so it keeps an activity log (default is NO)]),
ENABLE_ACTIVITY_LOG=$enableval,
ENABLE_ACTIVITY_LOG=no)
if test "$ENABLE_ACTIVITY_LOG" = yes; then
CONF_ACTIVITY_LOG="___ACTIVITY_LOG"
else
CONF_ACTIVITY_LOG="___NO_ACTIVITY_LOG"
fi
AC_SUBST(CONF_ACTIVITY_LOG)
###############################################################################
#
# Check if the system is to be profiled.
AC_ARG_ENABLE(profile,
AS_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,
AS_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,
AS_HELP_STRING([--enable-feedback1],
[build system to accumulate trial run data (default is NO)]),
ENABLE_FEEDBACK1=$enableval,
ENABLE_FEEDBACK1=no)
AC_ARG_ENABLE(feedback2,
AS_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
# procedures in a file. This makes the executable much faster but the
# compilation will be much longer and take much more memory.
# By default there is a limit to the number of control points in a
# file for single host mode to be used. The limit is configurable.
AC_ARG_ENABLE(single-host,
AS_HELP_STRING([--enable-single-host@<:@=N@:>@],
[compile each Scheme module as a single C function (by default each Scheme procedure is compiled to a C function, otherwise N, which defaults to 30000, is the maximum number of control points in the module to use single host mode and the special case N=0 avoids a limit)]),
ENABLE_SINGLE_HOST=$enableval,
ENABLE_SINGLE_HOST=no)
CONF_SINGLE_HOST_LIMIT="30000"
if test "$ENABLE_SINGLE_HOST" != no; then
AC_DEFINE([___SINGLE_HOST],[],[Enable single host mode])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___SINGLE_HOST"
if test "$ENABLE_SINGLE_HOST" != yes; then
CONF_SINGLE_HOST_LIMIT="$ENABLE_SINGLE_HOST"
ENABLE_SINGLE_HOST=yes
fi
fi
AC_SUBST(CONF_SINGLE_HOST_LIMIT)
###############################################################################
#
# Determine the largest size of a module where the normal C compilation
# optimization level will be used. Beyond that limit the optimization level
# is lowered to keep the compilation time reasonable for large modules.
# A setting of 0 deactivates the lowering of the optimization level.
AC_ARG_ENABLE(optimized-module-limit,
AS_HELP_STRING([--enable-optimized-module-limit=N],
[set the maximal size of a module to use the normal C compilation optimization level (N is the number of control points in the module beyond which the optimization level is lowered; N=0 deactivates the lowering of the optimization level; N=20000 is the default)]),
ENABLE_OPTIMIZED_MODULE_LIMIT=$enableval,
ENABLE_OPTIMIZED_MODULE_LIMIT=20000)
CONF_OPTIMIZED_MODULE_LIMIT="$ENABLE_OPTIMIZED_MODULE_LIMIT"
AC_SUBST(CONF_OPTIMIZED_MODULE_LIMIT)
AC_SUBST(CONF_GNUC_HOST_FUNCTION_ATTRIBUTES_UNOPTIMIZED_MODULE)
AC_SUBST(CONF_GNUC_HOST_FUNCTION_ATTRIBUTES_OPTIMIZED_MODULE)
###############################################################################
#
# Check if the system must support mixing the execution of code generated
# by the C backend and machine code generated by one of the native backends.
AC_ARG_ENABLE(lowlevel-exec,
AS_HELP_STRING([--enable-lowlevel-exec],
[build system so C and machine code can be mixed (default is NO)]),
ENABLE_LOWLEVEL_EXEC=$enableval,
ENABLE_LOWLEVEL_EXEC=no)
if test "$ENABLE_LOWLEVEL_EXEC" = yes; then
AC_DEFINE([___SUPPORT_LOWLEVEL_EXEC],[],[Enable lowlevel code execution])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___SUPPORT_LOWLEVEL_EXEC"
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,
AS_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 code should trust that the C compiler does TCO (tail call
# optimization) properly.
AC_ARG_ENABLE(trust-c-tco,
AS_HELP_STRING([--enable-trust-c-tco],
[trust C compiler does TCO properly (default is NO)]),
ENABLE_TRUST_C_TCO=$enableval,
ENABLE_TRUST_C_TCO=no)
if test "$ENABLE_TRUST_C_TCO" = yes; then
AC_DEFINE([___TRUST_C_TCO],[],[Trust C compiler does TCO properly])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___TRUST_C_TCO"
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,
AS_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,
AS_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,
AS_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 if system should be built for a specific machine architecture.
# The default, an empty string, will select the architecture the C
# compiler defaults to. Using "native" as the architecture will select
# the architecture being used for the build.
AC_ARG_ENABLE(march,
AS_HELP_STRING([--enable-march=arch],
[build for specific machine architecture (default is native)]),
ENABLE_MARCH=$enableval,
ENABLE_MARCH=no_enable_march)
###############################################################################
#
# Check if direct calls to C library functions should be generated for
# dynamically loaded modules. This typically leads to more efficient
# code by allowing the C compiler to inline C library calls in
# dynamically loaded modules (for example calls to the math functions
# sqrt, sin, etc).
AC_ARG_ENABLE(dynamic-clib,
AS_HELP_STRING([--enable-dynamic-clib],
[allow direct calls to C library in dynamically loaded modules (default is NO)]),
ENABLE_DYNAMIC_CLIB=$enableval,
ENABLE_DYNAMIC_CLIB=no)
if test "$ENABLE_DYNAMIC_CLIB" = yes; then
AC_DEFINE([___CAN_IMPORT_CLIB_DYNAMICALLY],[],[Enable direct calls to C library in dynamically loaded modules])
AC_DEFINE([___CAN_IMPORT_SETJMP_DYNAMICALLY],[],[Enable direct calls to setjmp in dynamically loaded modules])
DEFS_OBJ_DYN_LIB_EXE="$DEFS_OBJ_DYN_LIB_EXE -D___CAN_IMPORT_CLIB_DYNAMICALLY -D___CAN_IMPORT_SETJMP_DYNAMICALLY"
fi
###############################################################################
#
# Check the width of Scheme characters.
AC_ARG_ENABLE(char-size,
AS_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,
AS_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
###############################################################################
#
# Determine module search order.
AC_ARG_ENABLE(module-search-order,
AS_HELP_STRING([--enable-module-search-order=...],
[Module search order (default is ~~lib,~~userlib)]),
ENABLE_MODULE_SEARCH_ORDER=$enableval,
ENABLE_MODULE_SEARCH_ORDER=[\~\~lib,\~\~userlib])
DEFAULT_RUNTIME_OPTIONS=""
if test "$ENABLE_MODULE_SEARCH_ORDER" != ""; then
# must reverse order for runtime options
for p in `echo "$ENABLE_MODULE_SEARCH_ORDER" | sed -e 's/,/ /g'`; do
if test "$DEFAULT_RUNTIME_OPTIONS" != ""; then
DEFAULT_RUNTIME_OPTIONS=",$DEFAULT_RUNTIME_OPTIONS"
fi
DEFAULT_RUNTIME_OPTIONS="search=$p$DEFAULT_RUNTIME_OPTIONS"
done
fi
###############################################################################
#
# Determine module whitelist.
AC_ARG_ENABLE(module-whitelist,
AS_HELP_STRING([--enable-module-whitelist=...],
[Module whitelist (default is github.com/gambit)]),
ENABLE_MODULE_WHITELIST=$enableval,
ENABLE_MODULE_WHITELIST=[github.com/gambit])
if test "$ENABLE_MODULE_WHITELIST" != ""; then
MODULE_WHITELIST=`echo "$ENABLE_MODULE_WHITELIST" | sed -e "s/^/whitelist=/" -e "s/,/,whitelist=/g"`
if test "$DEFAULT_RUNTIME_OPTIONS" != ""; then
DEFAULT_RUNTIME_OPTIONS="$DEFAULT_RUNTIME_OPTIONS,"
fi
DEFAULT_RUNTIME_OPTIONS="$DEFAULT_RUNTIME_OPTIONS$MODULE_WHITELIST"
fi
###############################################################################
#
# Determine default runtime options.
AC_ARG_ENABLE(default-runtime-options,
AS_HELP_STRING([--enable-default-runtime-options=...],
[Default runtime options (default is none)]),
ENABLE_DEFAULT_RUNTIME_OPTIONS=$enableval,
ENABLE_DEFAULT_RUNTIME_OPTIONS=)
if test "$ENABLE_DEFAULT_RUNTIME_OPTIONS" != ""; then
if test "$DEFAULT_RUNTIME_OPTIONS" != ""; then
DEFAULT_RUNTIME_OPTIONS=",$DEFAULT_RUNTIME_OPTIONS"
fi
DEFAULT_RUNTIME_OPTIONS="$ENABLE_DEFAULT_RUNTIME_OPTIONS$DEFAULT_RUNTIME_OPTIONS"
fi
if test "$DEFAULT_RUNTIME_OPTIONS" != ""; then
DEFAULT_RUNTIME_OPTIONS=`echo "$DEFAULT_RUNTIME_OPTIONS" | sed -e "s/\(.\)/'\1', /g" -e "s/''', /'\\\\\\\\'', /g" -e "s/'\\\\\\\\', /'\\\\\\\\\\\\\\\\', /g" -e "s/^/{/" -e "s/$/'\\\\\\\\0'}/"`
AC_DEFINE_UNQUOTED([___DEFAULT_RUNTIME_OPTIONS],[$DEFAULT_RUNTIME_OPTIONS],[Select default runtime options])
fi
###############################################################################
#
# Determine default compile options.
AC_ARG_ENABLE(default-compile-options,
AS_HELP_STRING([--enable-default-compile-options=...],
[Default compile options (default is (compactness 9))]),
ENABLE_DEFAULT_COMPILE_OPTIONS=$enableval,
ENABLE_DEFAULT_COMPILE_OPTIONS="(compactness 9)")
if test "$ENABLE_DEFAULT_COMPILE_OPTIONS" != ""; then
DEFAULT_COMPILE_OPTIONS="$ENABLE_DEFAULT_COMPILE_OPTIONS"
else
DEFAULT_COMPILE_OPTIONS=""
fi
if test "$DEFAULT_COMPILE_OPTIONS" != ""; then
DEFAULT_COMPILE_OPTIONS=`echo "$DEFAULT_COMPILE_OPTIONS" | sed -e "s/\(.\)/'\1', /g" -e "s/''', /'\\\\\\\\'', /g" -e "s/'\\\\\\\\', /'\\\\\\\\\\\\\\\\', /g" -e "s/^/{/" -e "s/$/'\\\\\\\\0'}/"`
AC_DEFINE_UNQUOTED([___DEFAULT_COMPILE_OPTIONS],[$DEFAULT_COMPILE_OPTIONS],[Select default compile options])
fi
###############################################################################
#
# Determine targets to build.
AC_ARG_ENABLE(targets,
AS_HELP_STRING([--enable-targets=...],
[Targets to build in addition to C (default is js)]),
ENABLE_TARGETS=$enableval,
ENABLE_TARGETS=js)
BUILD_TARGETS="C"
if test "$ENABLE_TARGETS" != ""; then
for t in `echo "$ENABLE_TARGETS" | sed -e 's/,/ /g'`; do
if test "$t" != "C"; then
BUILD_TARGETS="$BUILD_TARGETS $t"
fi
done
fi
echo BUILD_TARGETS="$BUILD_TARGETS"
###############################################################################
#
# 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,
AS_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,
AS_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,
AS_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 path of the Gambit central installation directory.
AC_ARG_ENABLE(gambitdir,
AS_HELP_STRING([--enable-gambitdir=DIR],
[Path to use for the Gambit central installation directory (default is to use --prefix)]),
ENABLE_GAMBITDIR=$enableval,
ENABLE_GAMBITDIR=)
###############################################################################
#
# Determine the name to use for the Gambit interpreter and compiler.
AC_ARG_ENABLE(interpreter-name,
AS_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,
AS_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,
AS_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,
AS_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,
AS_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,
AS_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,
AS_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,
AS_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
RTLIB_COND_EXPAND_FEATURES="$RTLIB_COND_EXPAND_FEATURES(define-cond-expand-feature|enable-type-checking|)"
else
RTLIB_COND_EXPAND_FEATURES="$RTLIB_COND_EXPAND_FEATURES(define-cond-expand-feature|disable-type-checking|)"
fi
###############################################################################
#
# Check if the system must automatically force promises.
AC_ARG_ENABLE(auto-forcing,
AS_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
RTLIB_COND_EXPAND_FEATURES="$RTLIB_COND_EXPAND_FEATURES(define-cond-expand-feature|enable-auto-forcing|)"
else
RTLIB_COND_EXPAND_FEATURES="$RTLIB_COND_EXPAND_FEATURES(define-cond-expand-feature|disable-auto-forcing|)"
fi