forked from aranym/aranym
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2359 lines (2125 loc) · 75.6 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
dnl Process this file with autoconf to produce a configure script.
dnl Written in 1999 by Christian Bauer et al.
dnl Adapted for ARAnyM by Milan Jurik
dnl Adapted to automake by Thorsten Otto
m4_define(ARANYM_VERSION, m4_esyscmd([sed -n -e 's/#define.*VER_MAJOR.*\([0-9][0-9]*\).*$/\1./p
s/#define.*VER_MINOR.*\([0-9][0.9]*\).*$/\1./p
s/#define.*VER_MICRO.*\([0-9][0-9]*\).*$/\1/p' src/include/version.h | tr -d '\n']))
AC_INIT(aranym, ARANYM_VERSION, [[email protected]],,[https://github.com/aranym/aranym])
AC_PREREQ(2.52)
AC_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_SRCDIR([src/hostscreen.cpp])
dnl Define list of provided Native Features
PROVIDES_NF="audio bootstrap xhdi"
dnl Canonical system information.
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(check-news m4_esyscmd([case `automake --version | head -n 1` in
*1.10*);;
*) echo subdir-objects color-tests;;
esac]))
AM_MAINTAINER_MODE([disable])
dnl Silent rules
# Support silent build rules, requires at least automake-1.11. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AH_TOP([
#ifndef __ARANYM_CONFIG_H__
#define __ARANYM_CONFIG_H__
#if defined(__linux__) && !defined(__ANDROID__)
#include "linux/libcwrap.h"
#endif
#ifndef _FORTIFY_SOURCE
# define _FORTIFY_SOURCE 2
#endif
])
dnl Options.
AC_ARG_ENABLE(nat-debug, [AC_HELP_STRING([--enable-nat-debug], [enable native debugger support (default=yes)])], [WANT_NATDEBUG=$enableval], [WANT_NATDEBUG=yes])
AC_ARG_ENABLE(full-debug, [AC_HELP_STRING([--enable-full-debug], [enable full debug outputs (default=no)])], [WANT_FULLDEBUG=$enableval], [WANT_FULLDEBUG=no])
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug=which], [specify wether to use internal debugger (default=no)])],
[ case "$enableval" in
default | yes | uae | ndebug) USE_DEBUGGER=yes;;
no) USE_DEBUGGER="no";;
*) AC_MSG_ERROR([--enable-debug takes only one of the following values: default, uae, ndebug, no]);;
esac
],
[USE_DEBUGGER=no
])
AC_ARG_ENABLE(fullhistory, [AC_HELP_STRING([--enable-fullhistory], [enable full history for debugger (default=no)])], [WANT_HISTORY=$enableval], [WANT_HISTORY=no])
AC_ARG_ENABLE(flightrecorder, [AC_HELP_STRING([--enable-flightrecorder], [enable CPU flight recorder (default=no)])], [WANT_FLIGHTRECORDER=$enableval], [WANT_FLIGHTRECORDER=no])
AC_ARG_ENABLE(fullmmu, [AC_HELP_STRING([--enable-fullmmu], [enable full 68040 MMU (default=no)])], [WANT_MMU=$enableval], [WANT_MMU=no])
AC_ARG_ENABLE(atc,
[AC_HELP_STRING([--enable-atc=ATC], [select type of ATC for MMU (default=full)])],
[ case "$enableval" in
full) ATC_TYPE="full";;
small) ATC_type="small";;
no) ATC_TYPE="no";;
*) AC_MSG_ERROR([--enable-atc takes only one of the following values: full, small, no]);;
esac
], [ATC_TYPE=full])
AC_ARG_ENABLE(realstop, [AC_HELP_STRING([--enable-realstop], [enable real STOP instruction (default=yes)])], [WANT_REALSTOP=$enableval], [WANT_REALSTOP=yes])
AC_ARG_ENABLE(dsp, [AC_HELP_STRING([--enable-dsp], [enable DSP 56001 (default=yes)])], [WANT_DSP=$enableval], [WANT_DSP=yes])
AC_ARG_ENABLE(dsp-disasm, [AC_HELP_STRING([--enable-dsp-disasm], [enable DSP 56001 disassembler (default=no)])], [WANT_DSP_DISASM=$enableval], [WANT_DSP_DISASM=no])
AC_ARG_ENABLE(protect2k, [AC_HELP_STRING([--enable-protect2k], [enable first 2kB of RAM Super protection (default=yes)])], [WANT_PROTECT2K=$enableval], [WANT_PROTECT2K=yes])
AC_ARG_ENABLE(fixedfastram, [AC_HELP_STRING([--enable-fixedfastram=X], [use fixed size FastRAM of X MB (default=no)])], [WANT_FIXEDFASTRAM=$enableval], [WANT_FIXEDFASTRAM=no])
AC_ARG_ENABLE(fixedvideoram, [AC_HELP_STRING([--enable-fixedvideoram], [use fixed start of VideoRAM (default=no)])], [WANT_FIXEDVIDEORAM=$enableval], [WANT_FIXEDVIDEORAM=no])
AC_ARG_ENABLE(blitmemmove, [AC_HELP_STRING([--enable-blitmemmove], [enable Blitter memmove rout (default=no)])], [WANT_BLITMEMMOVE=$enableval], [WANT_BLITMEMMOVE=no])
AC_ARG_ENABLE(blitsdlblit, [AC_HELP_STRING([--enable-blitsdlblit], [enable SDL blitting routine EXPERIMENTAL UNSUPPORTED BUGGY (default=no)])], [WANT_BLITSDLBLIT=$enableval], [WANT_BLITSDLBLIT=no])
AC_ARG_ENABLE(hostfs, [AC_HELP_STRING([--enable-hostfs], [enable hostfs support (default=yes)])], [WANT_HOSTFS=$enableval], [WANT_HOSTFS=yes])
AC_ARG_ENABLE(ctrlkey,
[AC_HELP_STRING([--enable-ctrlkey=WHICH], [specify which key to use for control key emulation (default=both)])],
[ case "$enableval" in
dnl default is both
ctrl) CONTROL_KEY="ctrl";;
meta) CONTROL_KEY="meta";;
both) CONTROL_KEY="both";;
*) AC_MSG_ERROR([--enable-ctrlkey takes only one of the following values: ctrl, meta, both]);;
esac
],
[ CONTROL_KEY="both"
])
AC_ARG_ENABLE(gui, [AC_HELP_STRING([--enable-gui], [enable GUI (default=yes)])], [WANT_SDLGUI=$enableval], [WANT_SDLGUI=yes])
AC_ARG_ENABLE(opengl, [AC_HELP_STRING([--enable-opengl], [enable OpenGL (default=yes)])], [WANT_OPENGL=$enableval], [WANT_OPENGL=yes])
AC_ARG_WITH(mesa-headers, [AC_HELP_STRING([--with-mesa-headers], [Path to Mesa header files])], [WITH_MESAINC=$withval], [WITH_MESAINC=no])
AC_ARG_ENABLE(nfpci, [AC_HELP_STRING([--enable-nfpci], [enable NatFeat PCI (default=no)])], [WANT_NFPCI=$enableval], [WANT_NFPCI=no])
AC_ARG_ENABLE(usbhost, [AC_HELP_STRING([--enable-usbhost], [enable NatFeat USB (default=no)])], [WANT_USBHOST=$enableval], [WANT_USBHOST=no])
AC_ARG_ENABLE(nfosmesa, [AC_HELP_STRING([--enable-nfosmesa], [enable NatFeat OSMesa (default=no)])], [WANT_NFOSMESA=$enableval], [WANT_NFOSMESA=no])
AC_ARG_ENABLE(nfjpeg, [AC_HELP_STRING([--enable-nfjpeg], [enable NatFeat JPEG (default=yes)])], [WANT_NFJPEG=$enableval], [WANT_NFJPEG=yes])
AC_ARG_ENABLE(nfclipbrd, [AC_HELP_STRING([--enable-nfclipbrd], [enable NatFeat Clipboard (default=yes)])], [WANT_NFCLIPBRD=$enableval], [WANT_NFCLIPBRD=yes])
AC_ARG_ENABLE(nfvdi, [AC_HELP_STRING([--enable-nfvdi], [enable NatFeat VDI (default=yes)])], [WANT_NFVDI=$enableval], [WANT_NFVDI=yes])
AC_ARG_ENABLE(nfscsi, [AC_HELP_STRING([--enable-nfscsi], [enable NatFeat SCSI (default=yes)])], [WANT_NFSCSI=$enableval], [WANT_NFSCSI=yes])
AC_ARG_ENABLE(nfexec, [AC_HELP_STRING([--enable-nfexec], [enable NatFeat host file execution (default=yes)])], [WANT_NFEXEC=$enableval], [WANT_NFEXEC=yes])
AC_ARG_ENABLE(nfconfig, [AC_HELP_STRING([--enable-nfconfig], [enable NatFeat config support (default=yes)])], [WANT_NFCONFIG=$enableval], [WANT_NFCONFIG=yes])
AC_ARG_ENABLE(ata-cdrom, [AC_HELP_STRING([--enable-ata-cdrom], [enable ATA CD-ROM emulation (default=yes)])], [WANT_CDROM=$enableval], [WANT_CDROM=yes])
AC_ARG_ENABLE(epslimiter, [AC_HELP_STRING([--enable-epslimiter], [enable Exception per second limiter (default=no)])], [WANT_EPSLIMITER=$enableval], [WANT_EPSLIMITER=no])
AC_ARG_ENABLE(lilo, [AC_HELP_STRING([--enable-lilo], [enable Linux-m68k loader (default=no)])], WANT_LILO="$enableval", WANT_LILO="no")
AC_ARG_ENABLE(rtctimer, [AC_HELP_STRING([--enable-rtctimer], [enable Linux /dev/rtc as source timer (default=yes)])], WANT_RTCTIMER="$enableval", WANT_RTCTIMER="yes")
AC_ARG_ENABLE(parallelx86, [AC_HELP_STRING([--enable-parallelx86], [enable Linux X86 hw access for parallel port (default=no)])], [WANT_PARALLELX86=$enableval], [WANT_PARALLELX86=no])
AC_ARG_ENABLE(parport, [AC_HELP_STRING([--enable-parport], [enable Linux /dev/parport access for parallel port (default=yes)])], [WANT_PARALLELPARPORT=$enableval], [WANT_PARALLELPARPORT=yes])
AC_ARG_ENABLE(serialport, [AC_HELP_STRING([--enable-serialport], [enable Unix /dev/ttySn serial port support (default=yes)])], [WANT_UNIXSERIALPORT=$enableval], [WANT_UNIXSERIALPORT=yes])
AC_ARG_WITH(fink, [AC_HELP_STRING([--with-fink], [Use Fink suite to build Aranym on MacOSX (default=no)])], [WITH_FINK=$withval], [WITH_FINK=no])
AC_ARG_WITH(classicconfig, [AC_HELP_STRING([--with-classicconfig], [Use Classic config names on MacOSX (default=no)])], [WITH_CLASSIC_CONFIG=$withval], [WITH_CLASSIC_CONFIG=no])
dnl FPU emulation core.
if [[ "x$WANT_MMU" = "xyes" ]]; then
SUGGESTED_AUTO_FPE_CORE_TEST_ORDER="mpfr ieee uae"
else
SUGGESTED_AUTO_FPE_CORE_TEST_ORDER="ieee uae"
fi
AC_ARG_ENABLE(fpe,
[AC_HELP_STRING([--enable-fpe=FPE], [specify which fpu emulator to use (default=auto)])],
[ case "$enableval" in
dnl default is always ieee, if architecture has this fp format
auto) FPE_CORE_TEST_ORDER=$SUGGESTED_AUTO_FPE_CORE_TEST_ORDER;;
ieee) FPE_CORE_TEST_ORDER="ieee";;
uae) FPE_CORE_TEST_ORDER="uae";;
x86) FPE_CORE_TEST_ORDER="x86";;
mpfr) FPE_CORE_TEST_ORDER="mpfr";;
*) AC_MSG_ERROR([--enable-fpe takes only one of the following values: auto, uae, x86, ieee, mpfr]);;
esac
],
[ FPE_CORE_TEST_ORDER=$SUGGESTED_AUTO_FPE_CORE_TEST_ORDER
])
dnl Addressing modes.
AC_ARG_ENABLE(addressing,
[AC_HELP_STRING([--enable-addressing=AM], [specify the addressing mode to use (default=fastest)])],
[ case "$enableval" in
direct) ADDRESSING_TEST_ORDER="direct";;
normal) ADDRESSING_TEST_ORDER="normal";;
fixed) ADDRESSING_TEST_ORDER="fixed";;
*) AC_MSG_ERROR([--enable-addressing takes only one of the following values: direct, fixed, normal]);;
esac
],
[ ADDRESSING_TEST_ORDER="direct normal"
])
AC_ARG_ENABLE(addr-check,
[AC_HELP_STRING([--enable-addr-check=AM], [specify the memory check to use (default=page)])],
[ case "$enableval" in
no) MEMORY_CHECK="no";;
full) MEMORY_CHECK="full";;
page) MEMORY_CHECK="page";;
hwsp) MEMORY_CHECK="hwsp";;
pagehwsp) MEMORY_CHECK="pagehwsp";;
sseg) MEMORY_CHECK="sseg";;
*) AC_MSG_ERROR([--enable-addr-check takes only one of the following values: no, full, page, hwsp, pagehwsp, sseg]);;
esac
],
[ MEMORY_CHECK="page"
])
dnl Experimental hacks around spcflags handling.
AC_ARG_ENABLE(spcflags-excl, [AC_HELP_STRING([--enable-spcflags-excl], [enable exclusive spcflags handling (default=no)])], [WANT_SPCFLAGS_EXCL=$enableval], [WANT_SPCFLAGS_EXCL=no])
dnl JIT compiler options.
AC_ARG_ENABLE(jit-compiler, [AC_HELP_STRING([--enable-jit-compiler], [enable JIT compiler (default=no)])], [WANT_JIT=$enableval], [WANT_JIT=no])
AC_ARG_ENABLE(jit2, [AC_HELP_STRING([--enable-jit2], [enable JIT (v2) compiler (experimental/ARM only) (default=no)])], [WANT_JIT2=$enableval], [WANT_JIT2=no])
AC_ARG_ENABLE(jit-fpu,
[AC_HELP_STRING([--enable-jit-fpu], [enable JIT compiler for FPU instructions (default=no)])], [WANT_JIT_FPU=$enableval], [WANT_JIT_FPU=no])
AC_ARG_ENABLE(jit-debug, [AC_HELP_STRING([--enable-jit-debug], [activate native code disassemblers (default=no)])], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
AC_ARG_ENABLE(ethernet, [AC_HELP_STRING([--enable-ethernet], [enable ethernet card emulation (default=yes)])], [WANT_ETHERNET=$enableval], [WANT_ETHERNET=yes])
AC_ARG_ENABLE(bpf-ethernet, [AC_HELP_STRING([--enable-bpf-ethernet], [enable ethernet card emulation using BPF (default=no)])], [WANT_BFP_ETHERNET=$enableval], [WANT_BFP_ETHERNET=no])
AC_ARG_ENABLE(cxx-exceptions, [AC_HELP_STRING([--enable-cxx-exceptions], [enable the use of C++ try/catch instead of setjmp/longjmp (default=yes)])], [WANT_CXX_EXCEPTIONS=$enableval], [WANT_CXX_EXCEPTIONS=yes])
dnl Host OS type (host is build if not cross-compiling).
ANDROID_OS=no
case "$host_os" in
*android*) OS_TYPE=linux
ANDROID_OS=yes
LIBS="$LIBS -lgnustl_static -llog"
;;
linux*) OS_TYPE=linux;;
openbsd*) OS_TYPE=openbsd
CFLAGS="$CFLAGS -I/usr/local/include"
LIBS="$LIBS -L/usr/local/lib"
;;
netbsd*) OS_TYPE=netbsd;;
freebsd*|kfreebsd*-gnu) OS_TYPE=freebsd;;
solaris*) OS_TYPE=solaris;;
darwin*) OS_TYPE=darwin;;
cygwin*) OS_TYPE=cygwin;;
irix*) OS_TYPE=irix;;
mint*) OS_TYPE=mint;;
beos*|haiku*) OS_TYPE=beos;;
mingw*) OS_TYPE=mingw;;
*) OS_TYPE=unknown;;
esac
AM_CONDITIONAL([OS_TYPE_linux], test "$OS_TYPE" = "linux")
AM_CONDITIONAL([OS_TYPE_openbsd], test "$OS_TYPE" = "openbsd")
AM_CONDITIONAL([OS_TYPE_netbsd], test "$OS_TYPE" = "netbsd")
AM_CONDITIONAL([OS_TYPE_freebsd], test "$OS_TYPE" = "freebsd")
AM_CONDITIONAL([OS_TYPE_solaris], test "$OS_TYPE" = "solaris")
AM_CONDITIONAL([OS_TYPE_darwin], test "$OS_TYPE" = "darwin")
AM_CONDITIONAL([OS_TYPE_cygwin], test "$OS_TYPE" = "cygwin")
AM_CONDITIONAL([OS_TYPE_irix], test "$OS_TYPE" = "irix")
AM_CONDITIONAL([OS_TYPE_mint], test "$OS_TYPE" = "mint")
AM_CONDITIONAL([OS_TYPE_beos], test "$OS_TYPE" = "beos")
AM_CONDITIONAL([OS_TYPE_mingw], test "$OS_TYPE" = "mingw")
AM_CONDITIONAL([OS_TYPE_unknown], test "$OS_TYPE" = "unknown")
AM_CONDITIONAL([ANDROID_OS], test "$ANDROID_OS" = "yes")
AM_CONDITIONAL([WITH_FINK], test "$WITH_FINK" = "yes")
if test "$OS_TYPE" = "unknown"; then
OS_TYPE=`echo $host_os | sed -e 's/-/_/g' | sed -e 's/\./_/g'`
fi
#
# provide some defaults on cygwin,
# where we use the MinGW version of the SDL library,
# to simplify standard configuration.
# But only if the user did not override it.
#
if test "$OS_TYPE" = "cygwin"; then
if test "$prefix" = NONE; then
prefix=/usr
fi
fi
DEFINES="$DEFINES -DOS_$OS_TYPE"
AC_DEFINE_UNQUOTED([OS_TYPE], "$OS_TYPE", [Define OS type])
if test "$OS_TYPE" = "darwin"; then
# Make sure MPFR (and other 3rd party libs installed by MacPorts) are found
# Note that the order of these flags may be different
# in the Xcode project, which is important atleast for the
# SDL framework because we want to use the headers from
# the official build rather than the ones from MacPorts,
# which are only suitable for a single target architecture
LDFLAGS="$LDFLAGS -L/opt/local/lib"
CPPFLAGS="$CPPFLAGS -I/opt/local/include"
# SOURCE_ROOT is set when running from Xcode project
if test "$XCODE_VERSION_ACTUAL" != "" -a "$SOURCE_ROOT" != ""; then
LDFLAGS="$LDFLAGS -L$SOURCE_ROOT/external/lib"
CPPFLAGS="$CPPFLAGS -I$SOURCE_ROOT/external/include"
fi
fi
dnl Target CPU type.
ARCHFLAGS=
HAVE_I386=false
HAVE_ARM=false
HAVE_SPARC=false
HAVE_POWERPC=false
HAVE_X86_64=false
case "$host_cpu" in
i386* | i486* | i586* | i686* | i786* )
CPU_TYPE=i386
HAVE_I386=true
if [[ "x$OS_TYPE" = "xdarwin" ]]; then
ARCHFLAGS="-arch i386"
if [[ "x$DEVELOPER_SDK_DIR" = "x" ]]; then
DEVELOPER_SDK_DIR=/Developer/SDKs
fi
if [[ ! -d "$DEVELOPER_SDK_DIR" ]]; then
AC_MSG_ERROR([Cannot find SDKs directory at $DEVELOPER_SDK_DIR])
fi
case "$host_os" in
darwin8* | darwin9* ) ISYSROOT="-mmacosx-version-min=10.4 -isysroot $DEVELOPER_SDK_DIR/MacOSX10.4u.sdk";;
darwin10* ) ISYSROOT="-mmacosx-version-min=10.4 -isysroot $DEVELOPER_SDK_DIR/MacOSX10.5.sdk";;
darwin11* | darwin12* ) ISYSROOT="-mmacosx-version-min=10.5";;
darwin13* ) ISYSROOT="-mmacosx-version-min=10.7";;
darwin14* ) ISYSROOT="-mmacosx-version-min=10.10";;
darwin15* ) ISYSROOT="-mmacosx-version-min=10.10";;
darwin16* ) ISYSROOT="-mmacosx-version-min=10.10";;
darwin17* ) ISYSROOT="-mmacosx-version-min=10.13";;
*)
AC_MSG_ERROR([Sorry, unknown Darwin version: $host_os])
;;
esac
dnl Add the ARCHFLAGS here to let configure check for the target and not host capabilities.
CPPFLAGS="$CPPFLAGS $ISYSROOT $ARCHFLAGS"
LDFLAGS="$LDFLAGS $ISYSROOT $ARCHFLAGS"
fi
;;
sparc* ) CPU_TYPE=sparc HAVE_SPARC=true;;
arm* ) CPU_TYPE=arm HAVE_ARM=true
CFLAGS="$CFLAGS -ffast-math"
CXXFLAGS="$CXXFLAGS -ffast-math"
;;
powerpc* )
CPU_TYPE=powerpc
HAVE_POWERPC=true
if [[ "x$OS_TYPE" = "xdarwin" ]]; then
ARCHFLAGS="-arch ppc"
ISYSROOT="-mmacosx-version-min=10.3"
dnl Add the ARCHFLAGS here to let configure check for the target and not host capabilities.
CPPFLAGS="$CPPFLAGS $ISYSROOT $ARCHFLAGS"
LDFLAGS="$LDFLAGS $ISYSROOT $ARCHFLAGS"
fi
;;
x86_64* ) CPU_TYPE=x86_64 HAVE_X86_64=true;;
*) CPU_TYPE=unknown;;
esac
AM_CONDITIONAL([CPU_TYPE_x86], test "$CPU_TYPE" = "i386")
AM_CONDITIONAL([CPU_TYPE_x86_64], test "$CPU_TYPE" = "x86_64")
AM_CONDITIONAL([CPU_TYPE_sparc], test "$CPU_TYPE" = "sparc")
AM_CONDITIONAL([CPU_TYPE_arm], test "$CPU_TYPE" = "arm")
AM_CONDITIONAL([CPU_TYPE_powerpc], test "$CPU_TYPE" = "powerpc")
AM_CONDITIONAL([CPU_TYPE_unknown], test "$CPU_TYPE" = "unknown")
if test "$CPU_TYPE" = "unknown"; then
CPU_TYPE=`echo $host_cpu | sed -e 's/-/_/g'`
fi
DEFINES="$DEFINES -DCPU_$CPU_TYPE"
AC_DEFINE_UNQUOTED([CPU_TYPE], "$CPU_TYPE", [Define CPU type])
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CC_C_O
AC_PROG_OBJC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
AX_PROG_CC_FOR_BUILD
AX_PROG_CXX_FOR_BUILD
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_RANLIB
AC_PATH_PROG(PERL, perl)
AC_CHECK_TOOLS(WINDRES, [windres], :)
PKG_PROG_PKG_CONFIG
m4_ifndef([PKG_CHECK_MODULES], [AC_DEFUN([PKG_CHECK_MODULES], [true])])
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_CHECK_HEADERS(unistd.h fcntl.h sys/mman.h mach/mach.h sys/ioctl.h)
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_HEADERS(termios.h termio.h alloca.h sys/statfs.h sys/statvfs.h)
AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/vfs.h utime.h sys/param.h)
AC_CHECK_HEADERS(sys/mount.h types.h stat.h ext2fs/ext2_fs.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
])
AC_CHECK_HEADERS(net/bpf.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(long long, 8)
AC_CHECK_SIZEOF(float, 4)
AC_CHECK_SIZEOF(double, 8)
AC_CHECK_SIZEOF(long double, 12)
AC_CHECK_SIZEOF(void *, 4)
AC_TYPE_OFF_T
AC_CHECK_TYPE(loff_t, off_t)
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ssize_t, size_t)
AC_TYPE_SIGNAL
AC_HEADER_TIME
AC_STRUCT_TM
AC_SYS_LARGEFILE
gl_TM_GMTOFF
gl_STAT_TIME
AC_CXX_BOOL
dnl Checks for libraries
AC_CHECK_LIB(m, sin, [LIBS="$LIBS -lm"])
dnl Checks for library functions.
AC_CHECK_FUNCS(strdup)
AC_CHECK_FUNCS(sigaction signal sigsetjmp)
AC_CHECK_FUNCS(mmap mprotect munmap)
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect sbrk)
AC_CHECK_FUNCS(strchr memcpy bcopy)
AC_CHECK_FUNCS(usleep gettimeofday)
AC_CHECK_FUNCS(fseeko fsync futimes futimens link readlink symlink lstat truncate pathconf)
AC_CHECK_FUNCS(canonicalize_file_name realpath)
AC_CACHE_CHECK([whether sigsetjmp is supported],
ac_cv_have_sigsetjmp, [
AC_TRY_LINK([
#include <signal.h>
#include <setjmp.h>
], [
sigjmp_buf b;
sigsetjmp(b, 1);
siglongjmp(b, 1);
],
ac_cv_have_sigsetjmp=yes, ac_cv_have_sigsetjmp=no
)
])
if test "$ac_cv_have_sigsetjmp" = "yes"; then
AC_DEFINE([HAVE_SIGSETJMP], 1)
fi
dnl Darwin seems to define mach_task_self() instead of task_self().
AC_CHECK_FUNCS(mach_task_self task_self)
AC_DEFINE([DIRSEPARATOR], "/", [Default directory separator])
AH_TEMPLATE([ARANYMHOME], [Default ARAnyM directory])
AH_TEMPLATE([HAVE_O_FSYNC], [Define if you want to use FreeBSD's imitation of O_SYNC])
AH_TEMPLATE([ARANYMCONFIG], [Default ARAnyM config file])
AH_TEMPLATE([ARANYMNVRAM], [Default ARAnyM NVRAM file])
AH_TEMPLATE([ARANYMKEYMAP], [Default ARAnyM keymap])
AH_TEMPLATE([HAVE_LIBUDEV], [Define if you have <libudev.h> and libraries])
if test "$OS_TYPE" = "linux"; then
AC_CHECK_HEADERS([libudev.h])
if test "$ac_cv_header_libudev_h" = yes; then
AC_CHECK_LIB(udev, udev_monitor_new_from_netlink, [LIBS="$LIBS -ludev"])
if test $ac_cv_lib_udev_udev_monitor_new_from_netlink = yes; then
AC_DEFINE([HAVE_LIBUDEV])
fi
fi
fi
case "$host_os" in
linux*)
;;
cygwin*|mingw*)
AC_DEFINE([ARANYMHOME], "aranym")
;;
solaris*)
AC_DEFINE([_XOPEN_SOURCE], 500, [Define if needed])
AC_DEFINE([_POSIX_C_SOURCE], 199506L, [Define if needed])
DEFINES="$DEFINES -DBSD_COMP -D__EXTENSIONS__"
;;
freebsd*|kfreebsd*-gnu)
AC_DEFINE([HAVE_O_FSYNC], 1)
;;
darwin*)
AC_DEFINE([HAVE_O_FSYNC], 1)
if test "x$WITH_FINK" = "xyes"; then
AC_DEFINE([ARANYMHOME], "aranym")
else
AC_DEFINE([ARANYMHOME], "ARAnyM")
if test "x$WITH_CLASSIC_CONFIG" = "xyes"; then
echo "Using classic config"
AC_DEFINE([ARANYMCONFIG], "config")
AC_DEFINE([ARANYMNVRAM], "nvram")
AC_DEFINE([ARANYMKEYMAP], "keymap")
else
echo "Using preference files"
AC_DEFINE([ARANYMCONFIG], "org.aranym.amcfg")
AC_DEFINE([ARANYMNVRAM], "org.aranym.nvram")
AC_DEFINE([ARANYMKEYMAP], "org.aranym.keymap")
fi
BUNDLE_FRAMEWORKS= dnl Empty list of frameworks to bundle
dnl Check for some important frameworks
ARANYM_CHECK_FRAMEWORK(AppKit, [])
ARANYM_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
ARANYM_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
ARANYM_CHECK_FRAMEWORK(Security, [#include <Security/Security.h>])
dnl We (Mac OS X target) don't want to use PKG_CONFIG even if it exists (e.g. in /opt)
PKG_CONFIG=""
fi
;;
beos*|haiku*)
dnl Find tools needed to add resources
AC_PATH_PROG(BEOS_XRES, xres, [AC_MSG_ERROR([xres not found.])])
AC_PATH_PROG(BEOS_RC, rc, [AC_MSG_ERROR([rc not found.])])
AC_PATH_PROG(BEOS_SETVERSION, setversion, [AC_MSG_ERROR([setversion not found.])])
WANT_UNIXSERIALPORT=no
ac_cv_tun_tap_support=no
;;
*)
;;
esac
dnl Check that the host supports TUN/TAP devices
AC_CACHE_CHECK([whether TUN/TAP is supported],
ac_cv_tun_tap_support, [
AC_TRY_COMPILE([
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <linux/if.h>
#include <linux/if_tun.h>
#endif
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
#include <net/if.h>
#include <net/if_tun.h>
#endif
], [
struct ifreq ifr;
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
],
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
)
])
dnl Check that the host supports BPF devices
AC_CACHE_CHECK([whether BPF is supported],
ac_cv_bpf_support, [
AC_TRY_COMPILE([
#if defined(HAVE_NET_BPF_H)
#include <net/bpf.h>
#endif
], [
struct bpf_program filter;
],
ac_cv_bpf_support=yes, ac_cv_bpf_support=no
)
])
dnl Various checks if the system supports vm_allocate() and the like functions.
have_mach_vm=no
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
"x$ac_cv_func_vm_protect" = "xyes" ]]; then
have_mach_vm=yes
fi
AC_TRANSLATE_DEFINE(HAVE_MACH_VM, $have_mach_vm,
[Define if your system has a working vm_allocate()-based memory allocator.])
case "$host_os" in
darwin*) OSdarwinReq="#define OS_darwin";;
*) OSdarwinReq= ;;
esac
dnl Check that vm_allocate(), vm_protect() work
if [[ "x$have_mach_vm" = "xyes" ]]; then
AC_CACHE_CHECK([whether vm_protect works],
ac_cv_vm_protect_works, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_cv_vm_protect_works=yes
dnl First the tests that should segfault
for test_def in NONE_READ NONE_WRITE READ_WRITE; do
AC_TRY_RUN([
#define CONFIGURE_TEST_VM_MAP
#define TEST_VM_PROT_$test_def
$OSdarwinReq
#include "$srcdir/src/Unix/vm_alloc.cpp"
], ac_cv_vm_protect_works=no, rm -f core,
dnl When cross-compiling, do not assume anything
ac_cv_vm_protect_works="guessing no"
)
done
AC_TRY_RUN([
#define CONFIGURE_TEST_VM_MAP
#define TEST_VM_PROT_RDWR_WRITE
$OSdarwinReq
#include "$srcdir/src/Unix/vm_alloc.cpp"
], , ac_cv_vm_protect_works=no,
dnl When cross-compiling, do not assume anything
ac_cv_vm_protect_works="guessing no"
)
AC_LANG_RESTORE
]
)
dnl Remove support for vm_allocate() if vm_protect() does not work
if [[ "x$have_mach_vm" = "xyes" ]]; then
case $ac_cv_vm_protect_works in
*yes) have_mach_vm=yes;;
*no) have_mach_vm=no;;
esac
fi
AC_TRANSLATE_DEFINE(HAVE_MACH_VM, $have_mach_vm,
[Define if your system has a working vm_allocate()-based memory allocator.])
fi dnl HAVE_MACH_VM
dnl Various checks if the system supports mmap() and the like functions.
dnl ... and Mach memory allocators are not supported
have_mmap_vm=no
if [[ "x$ac_cv_func_mmap" = "xyes" -a "x$ac_cv_func_munmap" = "xyes" -a \
"x$ac_cv_func_mprotect" = "xyes" ]]; then
if [[ "x$have_mach_vm" = "xno" ]]; then
have_mmap_vm=yes
fi
fi
AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_mmap_vm,
[Define if your system has a working mmap()-based memory allocator.])
dnl Check that mmap() and associated functions work.
if [[ "x$have_mmap_vm" = "xyes" ]]; then
dnl Check if we have a working anonymous mmap()
AC_CACHE_CHECK([whether mmap supports MAP_ANON],
ac_cv_mmap_anon, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
#define HAVE_MMAP_ANON
#define CONFIGURE_TEST_VM_MAP
#define TEST_VM_MMAP_ANON
#include "$srcdir/src/Unix/vm_alloc.cpp"
], ac_cv_mmap_anon=yes, ac_cv_mmap_anon=no,
dnl When cross-compiling, do not assume anything.
ac_cv_mmap_anon="guessing no"
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(HAVE_MMAP_ANON, $ac_cv_mmap_anon,
[Define if <sys/mman.h> defines MAP_ANON and mmap()'ing with MAP_ANON works.])
AC_CACHE_CHECK([whether mmap supports MAP_ANONYMOUS],
ac_cv_mmap_anonymous, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
#define HAVE_MMAP_ANONYMOUS
#define CONFIGURE_TEST_VM_MAP
#define TEST_VM_MMAP_ANON
#include "$srcdir/src/Unix/vm_alloc.cpp"
], ac_cv_mmap_anonymous=yes, ac_cv_mmap_anonymous=no,
dnl When cross-compiling, do not assume anything.
ac_cv_mmap_anonymous="guessing no"
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(HAVE_MMAP_ANONYMOUS, $ac_cv_mmap_anonymous,
[Define if <sys/mman.h> defines MAP_ANONYMOUS and mmap()'ing with MAP_ANONYMOUS works.])
AC_CACHE_CHECK([whether mprotect works],
ac_cv_mprotect_works, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_cv_mprotect_works=yes
dnl First the tests that should segfault
for test_def in NONE_READ NONE_WRITE READ_WRITE; do
AC_TRY_RUN([
#define CONFIGURE_TEST_VM_MAP
#define TEST_VM_PROT_$test_def
#include "$srcdir/src/Unix/vm_alloc.cpp"
], ac_cv_mprotect_works=no, rm -f core,
dnl When cross-compiling, do not assume anything
ac_cv_mprotect_works="guessing no"
)
done
AC_TRY_RUN([
#define CONFIGURE_TEST_VM_MAP
#define TEST_VM_PROT_RDWR_WRITE
#include "$srcdir/src/Unix/vm_alloc.cpp"
], , ac_cv_mprotect_works=no,
dnl When cross-compiling, do not assume anything
ac_cv_mprotect_works="guessing no"
)
AC_LANG_RESTORE
]
)
dnl Remove support for mmap() if mprotect() does not work
if [[ "x$have_mmap_vm" = "xyes" ]]; then
case $ac_cv_mprotect_works in
*yes) have_mmap_vm=yes;;
*no) have_mmap_vm=no;;
esac
fi
AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_mmap_vm,
[Define if your system has a working mmap()-based memory allocator.])
fi dnl HAVE_MMAP_VM
AH_TEMPLATE(HAVE_WIN32_VM, [Define if your system has a working VirtualAlloc()-based memory allocator.])
if test "$OS_TYPE" = mingw; then
AC_DEFINE([HAVE_WIN32_VM])
if $HAVE_I386; then
LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
fi
fi
dnl Check signal handlers need to be reinstalled
AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
ac_cv_signal_need_reinstall, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
static int handled_signal = 0;
RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
int main(void) { /* returns 0 if signals need not to be reinstalled */
signal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
exit(handled_signal == 2);
}
], ac_cv_signal_need_reinstall=yes, ac_cv_signal_need_reinstall=no,
dnl When cross-compiling, do not assume anything.
ac_cv_signal_need_reinstall="guessing yes"
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(SIGNAL_NEED_REINSTALL, $ac_cv_signal_need_reinstall,
[Define if your system requires signals to be reinstalled.])
dnl Check if sigaction handlers need to be reinstalled
AC_CACHE_CHECK([whether sigaction handlers need to be reinstalled],
ac_cv_sigaction_need_reinstall, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_RUN([
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
static int handled_signal = 0;
RETSIGTYPE sigusr1_handler(int) { handled_signal++; }
typedef RETSIGTYPE (*signal_handler)(int);
static signal_handler mysignal(int sig, signal_handler handler) {
struct sigaction old_sa;
struct sigaction new_sa;
new_sa.sa_handler = handler;
return ((sigaction(sig,&new_sa,&old_sa) < 0) ? SIG_IGN : old_sa.sa_handler);
}
int main(void) { /* returns 0 if signals need not to be reinstalled */
mysignal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1);
exit(handled_signal == 2);
}
], ac_cv_sigaction_need_reinstall=yes, ac_cv_sigaction_need_reinstall=no,
dnl When cross-compiling, do not assume anything.
ac_cv_sigaction_need_reinstall="guessing yes"
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, $ac_cv_sigaction_need_reinstall,
[Define if your system requires sigactions to be reinstalled.])
dnl Check if we have vasprintf (_GNU_SOURCE)
AC_CACHE_CHECK([for vasprintf],
ac_cv_have_vasprintf, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <stdarg.h>
#include <stdio.h>
], [
va_list a;
vasprintf(NULL, NULL, a);
],
[ac_cv_have_vasprintf=yes],
[ac_cv_have_vasprintf=no]
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(HAVE_VASPRINTF, $ac_cv_have_vasprintf,
[Define if your system supports vasprintf function with GNU SOURCEs])
if [[ "x$ac_cv_have_vasprintf" = "xyes" ]]; then
DEFINES="$DEFINES -D_GNU_SOURCE"
fi
AC_CACHE_CHECK([for sighandler_t],
ac_cv_have_sighandler_t, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <signal.h>
#include <stdio.h>
], [
signal(0, (sighandler_t)NULL);
],
[ac_cv_have_sighandler_t=yes],
[ac_cv_have_sighandler_t=no]
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(HAVE_SIGHANDLER_T, $ac_cv_have_sighandler_t,
[Define if <signal.h> doesn't define sighandler_t])
dnl Check if we have getopt_long
AC_CACHE_CHECK([for getopt_long],
ac_cv_have_getopt_long, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#define _GNU_SOURCE
#include <unistd.h>
#include <getopt.h>
], [
getopt_long(0, NULL, NULL, NULL, NULL);
],
[ac_cv_have_getopt_long=yes],
[ac_cv_have_getopt_long=no]
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(HAVE_GETOPT_H, $ac_cv_have_getopt_long)
AM_CONDITIONAL([NEED_GETOPT], test "$ac_cv_have_getopt_long" = "no")
dnl Check if we have __builtin_bswap16/32
AC_CACHE_CHECK([for __builtin_bswap16],
ac_cv_have___builtin_bswap16, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#include <stdarg.h>
#include <stdio.h>
unsigned short v;
], [
v = __builtin_bswap16(v);
],
[ac_cv_have___builtin_bswap16=yes],
[ac_cv_have___builtin_bswap16=no]
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(HAVE___BUILTIN_BSWAP16, $ac_cv_have___builtin_bswap16,
[Define if your compiler supports __builtin_bswap16])
AC_CACHE_CHECK([for __builtin_bswap32],
ac_cv_have___builtin_bswap32, [
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([
#include <stdarg.h>
#include <stdio.h>
unsigned int v;
], [
v = __builtin_bswap32(v);
],
[ac_cv_have___builtin_bswap32=yes],
[ac_cv_have___builtin_bswap32=no]
)
AC_LANG_RESTORE
]
)
AC_TRANSLATE_DEFINE(HAVE___BUILTIN_BSWAP32, $ac_cv_have___builtin_bswap32,
[Define if your compiler supports __builtin_bswap32])
AH_TEMPLATE([MAP_META_TO_CONTROL], [Define if you want to map the meta key to the emulated control key])
AH_TEMPLATE([MAP_CONTROL_TO_CONTROL], [Define if you want to map the control key to the emulated control key])
case $CONTROL_KEY in
meta)
AC_DEFINE([MAP_META_TO_CONTROL], 1)
;;
both)
AC_DEFINE([MAP_META_TO_CONTROL], 1)
AC_DEFINE([MAP_CONTROL_TO_CONTROL], 1)
;;
ctrl)
AC_DEFINE([MAP_CONTROL_TO_CONTROL], 1)
;;
esac
if [[ "x$WANT_JIT" = "xyes" ]]; then
WANT_EXSIGSEGV=yes
MEMORY_CHECK=sseg
fi
AH_TEMPLATE([ARAM_PAGE_CHECK], [Define if you want to try out a different memory check])
AH_TEMPLATE([NOCHECKBOUNDARY], [Define if you don't want to use check memory boundary])
AH_TEMPLATE([EXTENDED_SIGSEGV], [Define if you want to use extended segfault handler])
AH_TEMPLATE([RAMENDNEEDED], [Define if you want protect end of memory])
AH_TEMPLATE([HW_SIGSEGV], [Define if you want to use extended segfault handler also for HW space])
case $MEMORY_CHECK in
no) AC_DEFINE([NOCHECKBOUNDARY], 1)
;;
page) AC_DEFINE([ARAM_PAGE_CHECK], 1)
;;
hwsp) ADDRESSING_TEST_ORDER="fixed"
WANT_EXSIGSEGV="yes"
AC_DEFINE([NOCHECKBOUNDARY], 1)
AC_DEFINE([EXTENDED_SIGSEGV], 1)
AC_DEFINE([RAMENDNEEDED])
;;
pagehwsp) ADDRESSING_TEST_ORDER="fixed"
WANT_EXSIGSEGV="yes"
AC_DEFINE([ARAM_PAGE_CHECK], 1)
AC_DEFINE([NOCHECKBOUNDARY], 1)
AC_DEFINE([EXTENDED_SIGSEGV], 1)
AC_DEFINE([RAMENDNEEDED], 1)
;;
sseg) ADDRESSING_TEST_ORDER="fixed"
WANT_EXSIGSEGV="yes"
AC_DEFINE([NOCHECKBOUNDARY], 1)
AC_DEFINE([RAMENDNEEDED], 1)
AC_DEFINE([EXTENDED_SIGSEGV], 1)
AC_DEFINE([HW_SIGSEGV], 1)
;;
*) ;;
esac
dnl Full opcode's history
if [[ "x$WANT_HISTORY" = "xyes" ]]; then
AC_DEFINE([FULL_HISTORY], 1, [Define if you want to use full history])
fi
dnl CPU flight recorder
if [[ "x$WANT_FLIGHTRECORDER" = "xyes" ]]; then
AC_DEFINE([FLIGHT_RECORDER], 1, [Define if you want to use CPU flight recorder])
fi
dnl ATA CD-ROM emulation
if [[ "x$WANT_CDROM" = "xyes" ]]; then
AC_DEFINE([SUPPORT_CDROM], 1, [Define if you want to use ATA CD-ROM emulation])
fi
dnl Full MMU
if [[ "x$WANT_MMU" = "xyes" ]]; then
AC_DEFINE([FULLMMU], 1, [Define if using full MMU])
fi
AM_CONDITIONAL([FULLMMU], test "$WANT_MMU" = "yes")
dnl Small ATC
if [[ "x$ATC_TYPE" = "xsmall" ]]; then
AC_DEFINE([SMALL_ATC], 1, [Define if using only small ATC])
fi
dnl Full ATC
if [[ "x$ATC_TYPE" = "xno" ]]; then
AC_DEFINE([DISABLE_ATC], 1, [Define if not using full ATC])
fi
dnl DSP
if [[ "x$WANT_DSP" = "xyes" ]]; then
AC_DEFINE([DSP_EMULATION], 1, [Define if using DSP])
dnl DSP disassembler
if [[ "x$WANT_DSP_DISASM" = "xyes" ]]; then
AC_DEFINE([DSP_DISASM], 1, [Define if DSP disassembly])
fi
fi
AM_CONDITIONAL([WANT_DSP], test "$WANT_DSP" = "yes")
AM_CONDITIONAL([WANT_DSP_DISASM], test "$WANT_DSP_DISASM" = "yes")
AH_TEMPLATE([FIXED_VIDEORAM], [Define if you want fixed position of VideoRAM])
AH_TEMPLATE([PROTECT2K], [Define if you want to protect first 2kB of RAM against user mode access])
dnl protect first 2kB of RAM
if [[ "x$WANT_PROTECT2K" != "xno" ]]; then
AC_DEFINE([PROTECT2K], 1, [Define if you want to protect first 2kB of RAM against user mode access])
fi