-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
1878 lines (1461 loc) · 57.7 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-2009 by Marc Feeley, All Rights Reserved.
# Process this file with autoconf to produce a configure script.
AC_INIT(Gambit-C,v4.5.1,[email protected],gambc-v4_5_1)
AC_CONFIG_HEADERS(include/config.h)
CONFIGURE_COMMAND="$0 $@"
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-2009 by Marc Feeley, All Rights Reserved.]])
AC_CONFIG_SRCDIR(include/gambit.h.in)
AC_PREFIX_DEFAULT(/usr/local/$PACKAGE_NAME)
AC_CANONICAL_SYSTEM
###############################################################################
#
# Accumulate subsystems to include in runtime library.
RTLIBSUBSYS=""
###############################################################################
#
# To accumulate flags and definitions for C compilation.
GAMBCLIB_DEFS=""
FLAGS_OBJ=""
FLAGS_DYN=""
FLAGS_LIB=""
FLAGS_EXE=""
DEFS_OBJ=""
DEFS_DYN="-D___DYNAMIC"
DEFS_LIB=""
DEFS_EXE=""
FLAGS_OBJ_DYN=""
FLAGS_OBJ_DYN_LIB_EXE=""
FLAGS_DYN_LIB=""
###############################################################################
#
# 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
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)
AC_SUBST(QTINCPATH)
RTLIBSUBSYS="$RTLIBSUBSYS guide"
LIBS="$LIBS $QTLIBS"
fi
AC_SUBST(ENABLE_GUIDE)
###############################################################################
#
# 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)
DEFS_DYN="$DEFS_DYN -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)
DEFS_DYN="$DEFS_DYN -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)
DEFS_DYN="$DEFS_DYN -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)
DEFS_DYN="$DEFS_DYN -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 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 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 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)
# don't add to DEFS_DYN
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 libraries should contain a version number suffix.
ENABLE_VERSIONNED_LIBS=no
# This option does not currently work. Some work is needed to make it
# work properly. Here is the documentation that should go in INSTALL.txt:
#The option --enable-versionned-libs will add a version number suffix
#to the libraries. For example the Gambit v4.3.2 runtime library which
#is normally libgambc.a will be named libgambc-v4_3_2.a and it must be
#linked to with the C compiler option -lgambc-v4_3_2 . If you give
#this option a value, as in --enable-versionned-libs=<suffix> then
#<suffix> will be appended to the name of the libraries.
#AC_ARG_ENABLE(versionned-libs,
# AC_HELP_STRING([--enable-versionned-libs],
# [libraries should contain a version number suffix (default is NO)]),
# ENABLE_VERSIONNED_LIBS=$enableval,
# ENABLE_VERSIONNED_LIBS=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
###############################################################################
#
# 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 for C compiler.
AC_DEFUN(AC_CHECK_C_COMPILER_DEF,
[AC_CACHE_CHECK(whether $C_COMPILER defines [$1], [$2],
[AC_SUBST($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
$2="yes"
else
$2=""
fi
])])
AC_DEFUN(AC_CHECK_C_COMPILER_OPT,
[AC_CACHE_CHECK(whether $C_COMPILER accepts [$1], [$2],
[AC_SUBST($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
$2=" $1"
else
$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
])])
AC_DEFUN(AC_CHECK_C_COMPILER_CPP_EXPR,
[AC_CACHE_CHECK(how $C_COMPILER's preprocessor evaluates [$1], [$2],
[AC_SUBST($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
$2="yes"
else
$2=""
fi
])])
AC_CHECK_C_COMPILER_DEF(__GNUC__,C_COMP_GNUC)
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)
###############################################################################
#
# 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(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(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)
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>
#include <sys/socket.h>],
[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)
fi
])
AC_TYPE_SOCKLEN_T
fi
#AC_TYPE_MODE_T
#AC_TYPE_OFF_T
#AC_TYPE_PID_T
#AC_TYPE_SIGNAL
#AC_TYPE_SIZE_T
#AC_TYPE_UID_T
#AC_HEADER_DIRENT
#AC_HEADER_STAT
#AC_HEADER_STDC
#AC_HEADER_SYS_WAIT
#AC_HEADER_TIME
#AC_HEADER_TIOCGWINSZ
#AC_FUNC_SELECT_ARGTYPES
#AC_FUNC_CLOSEDIR_VOID
#AC_FUNC_FSEEKO
#AC_FUNC_STAT
#AC_FUNC_LSTAT
if test "$C_COMP_VISUALC" = yes; then
LIBS="$LIBS Kernel32.Lib User32.Lib Gdi32.Lib WS2_32.Lib"
FLAGS_OBJ="$FLAGS_OBJ -D_WINDOWS"
else
case "$target_os" in
mingw*) # add Windows libraries needed by MinGW
LIBS="$LIBS -lws2_32"
FLAGS_OBJ="$FLAGS_OBJ -D_WINDOWS"
;;
*) # check libraries for other systems
AC_SEARCH_LIBS(asin,m)
AC_SEARCH_LIBS(dlopen,dl)
AC_SEARCH_LIBS(shl_load,dld)
#AC_SEARCH_LIBS(tgetstr,ncurses curses)
#AC_SEARCH_LIBS(tigetstr,ncurses curses)
AC_SEARCH_LIBS(socket,socket)
AC_SEARCH_LIBS(gethostbyname,nsl resolv xnet)
AC_SEARCH_LIBS(hstrerror,resolv)
AC_SEARCH_LIBS(openpty,util)
AC_SEARCH_LIBS(WSAStartup,ws2_32)
;;
esac
fi
AC_CHECK_FUNCS(pipe)
AC_CHECK_FUNCS(socketpair)
AC_CHECK_FUNCS(chdir)
AC_CHECK_FUNCS(execvp)
AC_CHECK_FUNCS(getgrnam)
AC_CHECK_FUNCS(getpid)
AC_CHECK_FUNCS(getppid)
AC_CHECK_FUNCS(getpwnam)
AC_CHECK_FUNCS(ioctl)
AC_CHECK_FUNCS(link)
AC_CHECK_FUNCS(mkdir)
AC_CHECK_FUNCS(mkfifo)
AC_CHECK_FUNCS(opendir)
AC_CHECK_FUNCS(rename)
AC_CHECK_FUNCS(rmdir)
AC_CHECK_FUNCS(socket)
AC_CHECK_FUNCS(stat)
AC_CHECK_FUNCS(stat64)
AC_CHECK_FUNCS(strerror)
AC_CHECK_FUNCS(symlink)
AC_CHECK_FUNCS(sysconf)
AC_CHECK_FUNCS(sysctl)
AC_CHECK_FUNCS(tcgetattr)
AC_CHECK_FUNCS(unlink)
AC_CHECK_FUNCS(waitpid)
AC_CHECK_FUNCS(clock_gettime)
AC_CHECK_FUNCS(getclock)
#AC_CHECK_FUNCS(GetSystemTime)
AC_CHECK_FUNCS(gettimeofday)
AC_CHECK_FUNCS(ftime)
AC_CHECK_FUNCS(time)
AC_CHECK_FUNCS(nanosleep)
#AC_CHECK_FUNCS(Sleep)
AC_CHECK_FUNCS(sleep)
#AC_CHECK_FUNCS(GetProcessTimes)
AC_CHECK_FUNCS(getrusage)
AC_CHECK_FUNCS(times)
AC_CHECK_FUNCS(clock)
AC_CHECK_FUNCS(DosQuerySysInfo)
AC_CHECK_FUNCS(setitimer)
AC_CHECK_FUNCS(dos_setvect)
AC_CHECK_FUNCS(DosStartTimer)
AC_CHECK_FUNCS(VInstall)
#AC_CHECK_FUNCS(CreateThread)
AC_CHECK_FUNCS(sigaction)
AC_CHECK_FUNCS(sigemptyset)
AC_CHECK_FUNCS(sigaddset)
AC_CHECK_FUNCS(sigprocmask)
AC_CHECK_FUNCS(signal)
AC_CHECK_FUNCS(shl_load)
#AC_CHECK_FUNCS(LoadLibrary)
AC_CHECK_FUNCS(DosLoadModule)
AC_CHECK_FUNCS(dxe_load)
AC_CHECK_FUNCS(GetDiskFragment)
AC_CHECK_FUNCS(dlopen)
AC_CHECK_FUNCS(NSLinkModule) # has been deprecated by Apple
AC_CHECK_FUNCS(gethostname)
AC_CHECK_FUNCS(inet_pton)
AC_CHECK_FUNCS(gethostbyname)
AC_CHECK_FUNCS(gethostbyaddr)
AC_CHECK_FUNCS(getservbyname)
AC_CHECK_FUNCS(getservbyport)
AC_CHECK_FUNCS(getprotobyname)
AC_CHECK_FUNCS(getprotobynumber)
AC_CHECK_FUNCS(getnetbyname)
AC_CHECK_FUNCS(select)
#AC_CHECK_FUNCS(MsgWaitForMultipleObjects)
#AC_CHECK_FUNCS(tgetstr)
#AC_CHECK_FUNCS(tigetstr)
AC_CHECK_FUNCS(openpty)
AC_CHECK_FUNCS(getpt)
AC_CHECK_FUNCS(ptsname)
AC_CHECK_FUNCS(hstrerror)
AC_CHECK_FUNCS(get_fpc_csr)
fi
###############################################################################
#
# Check which command line options are supported by $C_COMPILER.
if test "$C_COMP_GNUC" = yes; then
########## Using gcc...
# Determine which gcc version is being used.
AC_CHECK_C_COMPILER_CPP_EXPR((__GNUC__*100+__GNUC_MINOR__)>=402&&(__GNUC__*100+__GNUC_MINOR__)<=403,GCC_42_OR_43)
# preprocessor options:
AC_CHECK_C_COMPILER_OPT(-no-cpp-precomp,DASH_no_cpp_precomp)
# debugging options:
AC_CHECK_C_COMPILER_OPT(-Wall,DASH_Wall)
AC_CHECK_C_COMPILER_OPT(-W,DASH_W)
AC_CHECK_C_COMPILER_OPT(-Wno-unused,DASH_Wno_unused)
AC_CHECK_C_COMPILER_OPT(-g,DASH_g)
# profiling options:
AC_CHECK_C_COMPILER_OPT(-p,DASH_p)
AC_CHECK_C_COMPILER_OPT(-pg,DASH_pg)
AC_CHECK_C_COMPILER_OPT(-ftest-coverage,DASH_ftest_coverage)
AC_CHECK_C_COMPILER_OPT(-fprofile-arcs,DASH_fprofile_arcs)
AC_CHECK_C_COMPILER_OPT(-fbranch-probabilities,DASH_fbranch_probabilities)
# optimization options:
AC_CHECK_C_COMPILER_OPT(-O1,DASH_O1)
AC_CHECK_C_COMPILER_OPT(-fno-math-errno,DASH_fno_math_errno)
AC_CHECK_C_COMPILER_OPT(-fschedule-insns2,DASH_fschedule_insns2)
AC_CHECK_C_COMPILER_OPT(-fno-trapping-math,DASH_fno_trapping_math)
AC_CHECK_C_COMPILER_OPT(-fno-strict-aliasing,DASH_fno_strict_aliasing)
AC_CHECK_C_COMPILER_OPT(-fwrapv,DASH_fwrapv)
AC_CHECK_C_COMPILER_OPT(-fomit-frame-pointer,DASH_fomit_frame_pointer)
AC_CHECK_C_COMPILER_OPT(-fno-move-loop-invariants,DASH_fno_move_loop_invariants)
# It isn't clear these are useful:
# AC_CHECK_C_COMPILER_OPT(-fexpensive-optimizations,DASH_fexpensive_optimizations)
# AC_CHECK_C_COMPILER_OPT(-fforce-addr,DASH_fforce_addr)
# AC_CHECK_C_COMPILER_OPT(-fpeephole2,DASH_fpeephole2)
# AC_CHECK_C_COMPILER_OPT(-falign-jumps,DASH_falign_jumps)
# AC_CHECK_C_COMPILER_OPT(-falign-functions,DASH_falign_functions)
# AC_CHECK_C_COMPILER_OPT(-fno-function-cse,DASH_fno_function_cse)
# AC_CHECK_C_COMPILER_OPT(-ftree-copyrename,DASH_ftree_copyrename)
# AC_CHECK_C_COMPILER_OPT(-ftree-fre,DASH_ftree_fre)
# AC_CHECK_C_COMPILER_OPT(-ftree-dce,DASH_ftree_dce)
# AC_CHECK_C_COMPILER_OPT(-fschedule-interblock,DASH_fschedule_interblock)
# AC_CHECK_C_COMPILER_OPT(-fregmove,DASH_fregmove)
# AC_CHECK_C_COMPILER_OPT(-fgcse-las,DASH_fgcse_las)
# AC_CHECK_C_COMPILER_OPT(-freorder-functions,DASH_freorder_functions)
# AC_CHECK_C_COMPILER_OPT(-fcaller-saves,DASH_fcaller_saves)
# AC_CHECK_C_COMPILER_OPT(-fno-if-conversion2,DASH_fno_if_conversion2)
# AC_CHECK_C_COMPILER_OPT(-foptimize-sibling-calls,DASH_foptimize_sibling_calls)
# AC_CHECK_C_COMPILER_OPT(-fcse-skip-blocks,DASH_fcse_skip_blocks)
# AC_CHECK_C_COMPILER_OPT(-funit-at-a-time,DASH_funit_at_a_time)
# AC_CHECK_C_COMPILER_OPT(-finline-functions,DASH_finline_functions)
if test "$ENABLE_GCC_OPTS" = yes; then
AC_CHECK_C_COMPILER_OPT(-fmodulo-sched,DASH_fmodulo_sched)
AC_CHECK_C_COMPILER_OPT(-freschedule-modulo-scheduled-loops,DASH_freschedule_modulo_scheduled_loops)
fi
# code generation options:
case "$target_os" in
mingw*) # no special code generation options needed by MinGW
;;
cygwin*) # no special code generation options needed by cygwin
;;
*) # check for code generation options for other systems
AC_CHECK_C_COMPILER_OPT(-fPIC,DASH_fPIC)
AC_CHECK_C_COMPILER_OPT(-fpic,DASH_fpic)
;;
esac
AC_CHECK_C_COMPILER_OPT(-fno-common,DASH_fno_common)
# machine specific options:
AC_CHECK_C_COMPILER_OPT(-mieee,DASH_mieee)
AC_CHECK_C_COMPILER_OPT(-mieee-with-inexact,DASH_mieee_with_inexact)
AC_CHECK_C_COMPILER_OPT(-mieee-fp,DASH_mieee_fp)
# linking options:
case "$target_os" in
mingw*) # no special options needed by MinGW
AC_CHECK_C_COMPILER_OPT(-shared,DASH_shared,$DASH_fPIC$DASH_fpic)
;;
cygwin*) # no special options needed by cygwin
AC_CHECK_C_COMPILER_OPT(-shared,DASH_shared,$DASH_fPIC$DASH_fpic)
;;
solaris*) # check for options needed by Solaris
AC_CHECK_C_COMPILER_OPT(-shared,DASH_shared,$DASH_fPIC$DASH_fpic)
;;
hpux*) # check for options needed by HP-UX
AC_CHECK_C_COMPILER_OPT(-shared,DASH_shared,$DASH_fPIC$DASH_fpic)
;;
darwin*) # check for special options added by Apple
AC_CHECK_C_COMPILER_OPT(-dynamiclib,DASH_dynamiclib)
AC_CHECK_C_COMPILER_OPT(-bundle,DASH_bundle)
AC_CHECK_C_COMPILER_OPT(-flat_namespace -undefined suppress,DASH_flat_namespace_undefined_suppress)
;;
*) # for other systems
AC_CHECK_C_COMPILER_OPT(-rdynamic,DASH_rdynamic)
AC_CHECK_C_COMPILER_OPT(-shared,DASH_shared,$DASH_fPIC$DASH_fpic)
;;
esac
# determine which flags to add to CFLAGS, CXXFLAGS and LDFLAGS
case "$target_os" in
darwin*) # avoid the default C preprocessor which is setup for Objective-C
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_no_cpp_precomp"
;;
esac
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_Wno_unused"
if test "$ENABLE_DEBUG" = yes; then
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_g"
fi
if test "$ENABLE_PROFILE" = yes; then
if test "x$DASH_pg" != x; then
FLAGS_OBJ_DYN_LIB_EXE="$FLAGS_OBJ_DYN_LIB_EXE$DASH_pg"
else
FLAGS_OBJ_DYN_LIB_EXE="$FLAGS_OBJ_DYN_LIB_EXE$DASH_p"
fi
fi
if test "$ENABLE_DEBUG" != yes; then
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_O1$DASH_fno_math_errno$DASH_fschedule_insns2"
fi
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_fno_trapping_math$DASH_fno_strict_aliasing$DASH_fwrapv"
# It isn't clear these are useful:
# FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_fno_trapping_math$DASH_fno_strict_aliasing$DASH_fwrapv$DASH_fexpensive_optimizations$DASH_fforce_addr$DASH_fpeephole2$DASH_falign_jumps$DASH_falign_functions$DASH_fno_function_cse$DASH_ftree_copyrename$DASH_ftree_fre$DASH_ftree_dce$DASH_fschedule_interblock$DASH_fregmove$DASH_fgcse_las$DASH_freorder_functions$DASH_fcaller_saves$DASH_fno_if_conversion2$DASH_foptimize_sibling_calls$DASH_fcse_skip_blocks$DASH_funit_at_a_time$DASH_finline_functions"
if test "$ENABLE_GCC_OPTS" = yes; then
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_fmodulo_sched$DASH_freschedule_modulo_scheduled_loops"
fi
case "$target_os" in
mingw*) # MinGW's setjmp seems to need the frame pointer
;;
*) # other systems are fine as far as I can tell
if test "$ENABLE_DEBUG" != yes -a "$ENABLE_PROFILE" != yes; then
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_fomit_frame_pointer"
fi
;;
esac
ENABLE_GCC_MOVE_LOOP_INVARIANTS=yes
if test "$ENABLE_SINGLE_HOST" = yes; then
if test "$GCC_42_OR_43" = yes; then
ENABLE_GCC_MOVE_LOOP_INVARIANTS=no
fi
fi
if test "$ENABLE_GCC_MOVE_LOOP_INVARIANTS" != yes; then
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_fno_move_loop_invariants"
fi
if test "$ENABLE_FEEDBACK1" = yes -o "$ENABLE_COVERAGE" = yes; then
AC_DEFINE(___DONT_UNLOAD_DYN_CODE)
FLAGS_OBJ_DYN_LIB_EXE="$FLAGS_OBJ_DYN_LIB_EXE$DASH_fprofile_arcs"
if test "$ENABLE_COVERAGE" = yes; then
FLAGS_OBJ_DYN_LIB_EXE="$FLAGS_OBJ_DYN_LIB_EXE$DASH_ftest_coverage"
fi
fi
if test "$ENABLE_FEEDBACK2" = yes; then
AC_DEFINE(___DONT_UNLOAD_DYN_CODE)
FLAGS_OBJ_DYN_LIB_EXE="$FLAGS_OBJ_DYN_LIB_EXE$DASH_fbranch_probabilities"
fi
if test "x$DASH_fPIC" != x; then
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_fPIC"
else
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_fpic"
fi
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_fno_common"
FLAGS_OBJ_DYN="$FLAGS_OBJ_DYN$DASH_mieee$DASH_mieee_with_inexact$DASH_mieee_fp"
case "$target_os" in
darwin*) # check for special options added by Apple
FLAGS_DYN="$FLAGS_DYN$DASH_bundle"
FLAGS_LIB="$FLAGS_LIB$DASH_dynamiclib -install_name \$(libdir)/\$(LIBRARY)"
FLAGS_DYN_LIB="$FLAGS_DYN_LIB$DASH_flat_namespace_undefined_suppress"
;;
*) # for other systems
FLAGS_DYN_LIB="$FLAGS_DYN_LIB$DASH_rdynamic$DASH_shared"
FLAGS_EXE="$FLAGS_EXE$DASH_rdynamic"