-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
1694 lines (1512 loc) · 45.8 KB
/
configure.in
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 1996, 1997, 1998 Bernd Schmidt
dnl
dnl Updated, re-written and generally mauled 2003 Richard Drummond
dnl Updated and generally mauled 2008 Mustafa Tufan
dnl
AC_PREREQ(2.55)
AC_INIT(E-UAE, 1.6.10, ,e-uae)
AC_CONFIG_SRCDIR([bootstrap.sh])
AM_CONFIG_HEADER([src/sysconfig.h])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.7 dist-bzip2 foreign)
dnl
dnl Checks for programs.
dnl
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AS_PROG_OBJC
AM_PROG_AS
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar)
AC_PROG_INSTALL
AC_PATH_PROG(MAKEDEPPRG, makedepend, not-found)
AC_PATH_PROG(FILEPRG, file, not-found)
AC_PATH_PROG(WRCPRG, wrc, not-found)
AC_PATH_PROG(RCLPRG, rcl, not-found)
AC_AIX
AC_ISC_POSIX
NR_WARNINGS=0
NR_ERRORS=0
ADDITIONAL_CFLAGS=
OPTIMIZE_CFLAGS=
WARNING_CFLAGS=
DEBUG_CFLAGS=
NO_SCHED_CFLAGS=
dnl
dnl Checks for libraries.
dnl
dnl Replace main' with a function in -lMedia_s: (Ian!)
dnl AC_CHECK_LIB(Media_s, main, HAVE_MEDIA_LIB=yes, HAVE_MEDIA_LIB=no)
dnl Replace main' with a function in -lNeXT_s:
dnl AC_CHECK_LIB(NeXT_s, main, HAVE_NEXT_LIB=yes, HAVE_NEXT_LIB=no)
dnl AC_CHECK_LIB(moto, cos, HAVE_MOTO_LIB=yes, HAVE_MOTO_LIB=no)
dnl AC_CHECK_LIB(amiga, OpenLibrary, HAVE_AMIGA_LIB=yes, HAVE_AMIGA_LIB=n)
dnl AC_CHECK_LIB(vga, vga_setmode, HAVE_SVGA_LIB=yes, HAVE_SVGA_LIB=no)
AC_CHECK_LIB(ossaudio,_oss_ioctl, HAVE_LIBOSSAUDIO=yes, HAVE_LIBOSSAUDIO=no)
dnl Prefer Gtk2.x over Gtk1.x if both are available
AM_PATH_GTK_2_0(2.0.0,HAVE_GTK=yes,HAVE_GTK=no)
if [[ "x$HAVE_GTK" = "xno" ]]; then
AM_PATH_GTK(1.0.0,HAVE_GTK=yes,HAVE_GTK=no)
fi
dnl
dnl Checks for header files.
dnl
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h utime.h])
AC_CHECK_HEADERS([values.h ncurses.h curses.h sys/termios.h])
AC_CHECK_HEADERS([sys/stat.h sys/ipc.h sys/shm.h sys/mman.h])
AC_CHECK_HEADERS([sys/filio.h])
AC_CHECK_HEADERS([libraries/cybergraphics.h cybergraphx/cybergraphics.h])
AC_CHECK_HEADERS([devices/ahi.h])
AC_CHECK_HEADERS([sys/soundcard.h machine/soundcard.h sun/audioio.h sys/audioio.h])
AC_CHECK_HEADERS([machine/joystick.h])
AC_CHECK_HEADER([amigainput/amigainput.h], HAVE_AMIGAINPUT=yes, HAVE_AMIGAINPUT=no)
AC_CHECK_HEADERS([byteswap.h])
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_STRUCT_ST_BLOCKS
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(long long, 8)
AC_CHECK_SIZEOF(__int64, 8)
AC_CHECK_SIZEOF(void *)
TYPE_SOCKLEN_T
dnl
dnl Checks for library functions.
dnl
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL
AC_CHECK_FUNCS(gettimeofday sigaction)
AC_CHECK_FUNCS(select strerror isnan isinf setitimer alarm sync)
AC_CHECK_FUNCS(readdir_r)
AC_CHECK_FUNCS(strdup strstr strcasecmp stricmp strcmpi)
AC_CHECK_FUNCS(nanosleep usleep sleep)
AC_CHECK_FUNCS(vprintf vsprintf vfprintf)
dnl AC_CHECK_FUNCS(statvfs statfs)
dnl AC_VAR_TIMEZONE_EXTERNALS - broken on *BSD
AC_CHECK_FUNCS(localtime_r timegm gmtime_r)
AC_SYS_LARGEFILE
AC_MSG_CHECKING(for bswap_16)
AC_TRY_LINK([
#if HAVE_BYTESWAP_H
# include <byteswap.h>
#endif
],[
bswap_16 (0x12);
],[
AC_DEFINE(HAVE_BSWAP_16, 1, [Define to 1 if you have the 'bswap_16' function.])
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for bswap_32)
AC_TRY_LINK([
#if HAVE_BYTESWAP_H
# include <byteswap.h>
#endif
],[
bswap_32 (0x1234);
],[
AC_DEFINE(HAVE_BSWAP_32, 1, [Define to 1 if you have the 'bswap_32' function.])
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
])
dnl
dnl Checks for fsuage
dnl
AC_CHECK_HEADERS(sys/param.h sys/vfs.h sys/fs_types.h)
AC_CHECK_HEADERS(sys/mount.h, [], [],
[#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
])
jm_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
if test $gl_cv_fs_space = yes; then
AC_LIBOBJ(fsusage)
gl_PREREQ_FSUSAGE_EXTRA
fi
AC_CACHE_SAVE
dnl
dnl Check for libz
dnl
AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
then
UAE_LIBS="-lz $UAE_LIBS"
else
AC_MSG_ERROR(Check for libz failed)
fi
dnl
dnl Check for pthreads
dnl
ACX_PTHREAD(HAVE_PTHREAD=yes,HAVE_PTHREAD=no)
dnl Solaris, for example, needs additional libs to use POSIX semaphores.
if [[ "x$HAVE_PTHREAD" = "xyes" ]]; then
SAVE_CFLAGS="$CFLAGS"
SAVE_LIBS="$LIBS"
CFLAGS="$PTHREAD_CFLAGS $CFLAGS"
LIBS="$PTHREAD_LIBS"
AC_SEARCH_LIBS(sem_init, rt posix4,,,"$SAVE_LIBS")
PTHREAD_LIBS="$LIBS"
CFLAGS="$SAVE_CFLAGS"
LIBS="$SAVE_LIBS"
fi
dnl
dnl Check for dlopen
dnl
AC_CHECK_LIB(dl, dlopen, [
UAE_LIBS="-ldl $UAE_LIBS"
AC_DEFINE(HAVE_DLOPEN, 1, "Define to 1 if you have 'dlopen' function)
],
)
dnl
dnl Check availability of OSS
dnl
HAVE_USS_SOUND=no
if [[ "x$ac_cv_header_sys_soundcard_h" = "xyes" -o "x$ac_cv_header_machine_soundcard_h" = "xyes" ]]; then
if [[ "x$HAVE_LIBOSSAUDIO" = "xyes" ]]; then
SAVE_LIBS="$LIBS"
LIBS="$LIBS -lossaudio"
fi
dnl Avoid surprises
AC_MSG_CHECKING(whether sys/soundcard.h or machine/soundcard.h works)
AC_TRY_LINK([
#include "confdefs.h"
#ifdef HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h>
#else
#include <machine/soundcard.h>
#endif
#include <sys/ioctl.h>
],
[int soundfd; ioctl (soundfd, SNDCTL_DSP_GETFMTS, 0);],
AC_MSG_RESULT(yes)
HAVE_USS_SOUND=yes,
AC_MSG_RESULT(no))
if [[ "x$HAVE_LIBOSSAUDIO" = "xyes" ]]; then
LIBS="$SAVE_LIBS"
fi
fi
dnl
dnl Find out which platform to build for
dnl
AC_MSG_CHECKING([host OS support])
dnl default is generic Unix-like OS
HOST_OS=generic
OSDEP=od-generic
case $host_os in
linux*)
HOST_OS=linux
OSDEP=od-linux
;;
darwin*)
HOST_OS=darwin
OSDEP=od-macosx
;;
beos)
HOST_OS=beos
OSDEP=od-beos
;;
amigaos)
HOST_OS=amiga
OSDEP=od-amiga
;;
morphos)
HOST_OS=morphos
OSDEP=od-amiga
;;
aros)
HOST_OS=aros
OSDEP=od-amiga
;;
mingw32*)
HOST_OS=win32
OSDEP=od-win32
esac
AC_MSG_RESULT([$HOST_OS])
dnl
dnl Find out what CPU arch to build for
dnl
AC_MSG_CHECKING([host cpu support])
dnl default is to use no CPU-specific features
HOST_CPU=generic
MDFPP_H=fpp-unknown.h
case $host_cpu in
i[[3-6]]86)
HOST_CPU=i386
MDFPP_H=fpp-ieee.h
;;
amd64 | x86_64)
HOST_CPU=amd64
MDFPP_H=fpp-ieee.h
;;
powerpc)
HOST_CPU=ppc
MDFPP_H=fpp-ieee.h
;;
m68k)
HOST_CPU=68k
MDFPP_H=fpp-ieee.h
;;
esac
AC_MSG_RESULT([$HOST_CPU])
MACHDEP="md-$HOST_CPU"
dnl
dnl MULTIPLICATION_PROFITABLE?
dnl
dnl We always set this for now. It's only used in the audio emulation,
dnl where the option is to do multiplication or table look-up. On just
dnl about any CPU it's worthwhile running E-UAE on, multiplication will be
dnl better.
dnl should we move this in enable-gccopt ?
dnl
AC_DEFINE(MULTIPLICATION_PROFITABLE, 1, [Define to 1 if your CPU profitably supports multiplication.])
dnl
dnl Find out what compiler we have
dnl
HAVE_GCC27=no
HAVE_GCC30=no
HAVE_GCC40=no
HAVE_GLIBC2=no
AC_MSG_CHECKING([for GCC 2.7 or higher])
AC_EGREP_CPP(yes,
[#if (__GNUC__ - 1 > 0 && __GNUC_MINOR__ - 1 > 5) || __GNUC__ - 1 > 1
yes
#endif
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
if [[ "x$HAVE_GCC27" = "xyes" ]]; then
AC_MSG_CHECKING([for GCC 3.0 or higher])
AC_EGREP_CPP(yes,
[#if __GNUC__ - 1 > 1
yes
#endif
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
fi
if [[ "x$HAVE_GCC30" = "xyes" ]]; then
AC_MSG_CHECKING([for GCC 4.0 or higher])
AC_EGREP_CPP(yes,
[#if __GNUC__ - 1 > 2
yes
#endif
], [AC_MSG_RESULT(yes); HAVE_GCC40=yes], AC_MSG_RESULT(no))
fi
if test $ac_cv_prog_gcc = yes; then
if test $HAVE_GCC27 != yes; then
AC_MSG_WARN([Version 2.7 or better of GCC is recommended])
NR_WARNINGS=`expr $NR_WARNINGS + 1`
fi
else
if test $uae_cv_prog_cc_watcom != yes; then
AC_MSG_WARN([UAE may not compile and run correctly with your compiler])
NR_WARNINGS=`expr $NR_WARNINGS + 1`
fi
fi
if test $ac_cv_prog_gcc = yes; then
if [[ "$HOST_CPU" = i386 -o "$HOST_CPU" = ppc -o "$HOST_CPU" = amd64 ]]; then
MACHDEP="$MACHDEP-gcc"
fi
fi
dnl
dnl Now we know the compiler, check some compiler options
dnl
if [[ "x$HAVEGCC27" = "xyes" -a "$HOST_CPU" = "i386" ]]; then
SAVECFLAGS=$CFLAGS
CFLAGS="$CFLAGS -mno-schedule-prologue"
AC_TRY_COMPILE(,int main(){return 0;}, OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -mno-schedule-prologue")
CFLAGS=$SAVECFLAGS
fi
if [[ "x$HAVEGCC27" = "xyes" -a "$HOST_CPU" = "i386" ]]; then
SAVECFLAGS=$CFLAGS
CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
AC_TRY_COMPILE(,int main(){return 0;}, OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -mpreferred-stack-boundary=2")
CFLAGS=$SAVECFLAGS
fi
dnl If GCC supports exceptions, we don't want them.
dnl
if [[ "x$HAVEGCC27" = "xyes" -a "$HOST_CPU" = "i386" ]]; then
SAVECFLAGS=$CFLAGS
CFLAGS="$CFLAGS -fno-exceptions"
AC_TRY_COMPILE(,int main(){return 0;}, OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -fno-exceptions")
CFLAGS=$SAVECFLAGS
fi
dnl on OS X, we don't want position-independent code, so
dnl include the option -mdynamic-no-pic.
dnl
if [[ "$HOST_OS" = "darwin" ]]; then
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -mdynamic-no-pic"
fi
if [[ "x$ac_cv_header_features_h" = "xyes" ]]; then
AC_MSG_CHECKING(for glibc-2.0 or higher)
AC_EGREP_CPP(yes,
[#include <features.h>
#if __GLIBC__ - 1 >= 1
yes
#endif
], [AC_MSG_RESULT(yes); HAVE_GLIBC2=yes], AC_MSG_RESULT(no))
fi
dnl
dnl Generic default targets
dnl
TARGET=x11
TARGETDEP=t-unix.h
if [[ "$HAVE_PTHREAD" = "yes" ]]; then
THREADDEP=td-posix
THREADNAME=posix
else
THREADDEP=td-none
THREADNAME=none
fi
if [[ "x$no_x" != "xyes" ]]; then
GFX_DEP=gfx-x11
GFX_NAME=x11
else
GFX_DEP=
GXF_NAME=
fi
GUI_DEP=gui-none
GUI_NAME=none
GUI_LIBS=
SND_DEP=sd-none
SND_NAME=none
JOY_DEP=jd-none
JOY_NAME=none
DO_PROFILING=no
if [[ "$HOST_CPU" = "i386" ]]; then
WANT_JIT=yes
else
WANT_JIT=no
fi
NATMEM=no
NOFLAGS=no
WANT_DGA=no
WANT_VIDMODE=no
WANT_THREADS=dunno
NEED_THREAD_SUPPORT=no
WANT_AUTOCONFIG=dunno
WANT_SCSIEMU=no
WANT_AGA=yes
WANT_CD32=dunno
WANT_CDTV=dunno
WANT_BSDSOCK=dunno
WANT_UI=dunno
WANT_AUDIO=dunno
WANT_FPU=yes
WANT_COMPATIBLE=yes
WANT_CYCLEEXACT=yes
WANT_CAPS=no
WANT_FDI=yes
WANT_ENFORCER=dunno
MATHLIB=-lm
dnl
dnl Override defaults for specific targets
dnl
if [[ "$HOST_OS" = "linux" ]]; then
JOY_DEP=jd-linuxold
JOY_NAME="linux"
if [[ "$HOST_CPU" = "i386" ]]; then
NATMEM="0x50000000"
fi
else if [[ "$OSDEP" = "od-beos" ]]; then
TARGET=beos
TARGETDEP=t-beos.h
THREADDEP=td-beos
THREADNAME="native BeOS"
GFX_DEP=gfx-beos
GFX_NAME="native BeOS"
GFX_LIBS="-lgame"
GUI_DEP="gui-beos"
GUI_NAME="native BeOS"
GUI_LIBS="-lbe -ltracker"
JOY_DEP=jd-beos
JOY_NAME="native BeOS"
JOY_LIBS="-ldevice"
SND_DEP=sd-beos
SND_NAME="native BeOS"
SND_LIBS="-lmedia"
WANT_BSDSOCK=no
MATHLIB=""
UAE_RSRCFILE="$OSDEP/uae.rsrc"
else if [[ "$OSDEP" = "od-amiga" ]]; then
TARGET=amiga
TARGETDEP=t-amiga.h
THREADDEP=td-amigaos
THREADNAME="native AmigaOS"
GFX_DEP=gfx-amigaos
GFX_NAME="native AmigaOS"
GUI_DEP=gui-muirexx
GUI_NAME="MUIRexx"
SND_DEP=sd-amigaos
SND_NAME="native AmigaOS/AHI"
if [[ "x$HAVE_AMIGAINPUT" = "xyes" ]]; then
JOY_DEP=jd-amigainput
JOY_NAME="AmigaInput"
else
JOY_DEP=jd-amigaos
JOY_NAME="Amiga lowlevel.library"
fi
WANT_BSDSOCK=no
else if [[ "$OSDEP" = "od-win32" ]]; then
TARGET=win32
TARGETDEP=t-win32.h
WANT_BSDSOCK=no
fi
fi
fi
fi
dnl
dnl Win32 build has its own writelog.c
dnl
if [[ "$OSDEP" != "od-win32" ]]; then
EXTRAOBJS='writelog.$(OBJEXT)'
fi
dnl
dnl Options
dnl
AC_ARG_ENABLE(profiling, AS_HELP_STRING([--enable-profiling], [Build a profiling (SLOW!) version]), [DO_PROFILING=$enableval],[])
AC_ARG_ENABLE(aga, AS_HELP_STRING([--enable-aga], [Enable AGA chipset emulation (default yes)]), [WANT_AGA=$enableval],[])
AC_ARG_ENABLE(cdtv, AS_HELP_STRING([--enable-cdtv], [Enable CDTV emulation (default no)]), [WANT_CDTV=$enableval],[])
AC_ARG_ENABLE(cd32, AS_HELP_STRING([--enable-cd32], [Enable CD32 emulation (default no)]), [WANT_CD32=$enableval],[])
AC_ARG_ENABLE(cycle-exact-cpu, AS_HELP_STRING([--enable-cycle-exact-cpu], [Enable cycle-exact CPU emulation (default yes)]), [WANT_CYCLEEXACT=$enableval],[])
AC_ARG_ENABLE(compatible-cpu, AS_HELP_STRING([--enable-compatible-cpu], [Enable compatible CPU emulation (default yes)]), [WANT_COMPATIBLE=$enableval],[])
AC_ARG_ENABLE(fpu, AS_HELP_STRING([--enable-fpu], [Enable FPU emulation (default yes)]), [WANT_FPU=$enableval],[])
AC_ARG_ENABLE(jit, AS_HELP_STRING([--enable-jit], [Enable JIT compiler (currently x86 only)]), [WANT_JIT=$enableval],[])
AC_ARG_ENABLE(natmem, AS_HELP_STRING([--enable-natmem], [Enable JIT direct memory support (default auto)]), [NATMEM=$enableval],[])
AC_ARG_ENABLE(noflags, AS_HELP_STRING([--enable-noflags], [Enable noflags support in JIT (default no)]), [NOFLAGS=$enableval],[])
AC_ARG_ENABLE(threads, AS_HELP_STRING([--enable-threads], [Enable thread support (default auto)]), [WANT_THREADS=$enableval],[])
AC_ARG_ENABLE(autoconfig, AS_HELP_STRING([--enable-autoconfig], [Enable emulaton of autoconfig devices (default auto)]), [WANT_AUTOCONFIG=$enableval],[])
AC_ARG_ENABLE(scsi-device, AS_HELP_STRING([--enable-scsi-device], [Enable emulaton of SCSI devices (default no)]), [WANT_SCSIEMU=$enableval],[])
AC_ARG_ENABLE(bsdsock, AS_HELP_STRING([--enable-bsdsock], [Enable bsdsocket.library emulation]), [WANT_BSDSOCK=$enableval],[])
AC_ARG_ENABLE(debugger, AS_HELP_STRING([--disable-debugger], [Disable internal debugger/monitor (default no)]), [WANT_DEBUGGER=$enableval],[])
AC_ARG_ENABLE(state-saving, AS_HELP_STRING([--disable-state-saving], [Disable support for saving state snapshots (default no)]), [WANT_STATESAVING=$enableval],[])
AC_ARG_ENABLE(enforcer, AS_HELP_STRING([--enable-enforcer], [Enable ersatz Enforcer support (default auto)]), [WANT_ENFORCER=$enableval],[])
AC_ARG_ENABLE(action-replay, AS_HELP_STRING([--enable-action-replay], [Enable Action Replay cartridge emulation (default yes)]), [WANT_ACTION_REPLAY=$enableval],[])
AC_ARG_ENABLE(xarcade, AS_HELP_STRING([--disable-xarcade], [Disable keymaps for X-Aracde joysticks (default: enabled)]), [WANT_XARCADE=$enableval],[WANT_XARCADE=yes])
AC_ARG_ENABLE(dga, AS_HELP_STRING([--enable-dga], [X11 version: Use the DGA extension]), [WANT_DGA=$enableval],[])
AC_ARG_ENABLE(vidmode, AS_HELP_STRING([--enable-vidmode], [X11 version: Use the XF86VidMode extension]), [WANT_VIDMODE=$enableval],[])
AC_ARG_ENABLE(ui, AS_HELP_STRING([--enable-ui], [Use a user interface if possible (default on)]), [WANT_UI=$enableval],[])
AC_ARG_ENABLE(audio, AS_HELP_STRING([--enable-audio], [Enable audio output (default auto)]), [WANT_AUDIO=$enableval],[])
AC_ARG_ENABLE(fdi, AS_HELP_STRING([--enable-fdi], [Enable FDI support (default yes)]), [WANT_FDI=$enableval],[])
AC_ARG_ENABLE(gccopt, AS_HELP_STRING([--enable-gccopt], [Enable CPU Specific Optimizations (default no)]),
[WANT_OPT=$enableval],[])
AC_ARG_WITH(sdl,
AS_HELP_STRING([--with-sdl], [Use SDL library for low-level functions]),
[WANT_SDL=$withval], [])
AC_ARG_WITH(sdl-sound,
AS_HELP_STRING([--with-sdl-sound], [Use SDL library for sound]),
[WANT_SDLSND=$withval], [])
AC_ARG_WITH(sdl-gfx,
AS_HELP_STRING([--with-sdl-gfx], [Use SDL library for graphics]),
[WANT_SDLGFX=$withval], [])
AC_ARG_WITH(sdl-gl,
AS_HELP_STRING([--with-sdl-gl], [Allow GL for 2D acceleration with SDL graphics]),
[WANT_SDLGL=$withval], [])
AC_ARG_WITH(curses,
AS_HELP_STRING([--with-curses], [Use ncurses library for graphics]),
[WANT_NCURSES=$withval], [])
AC_ARG_WITH(cocoa-gui,
AS_HELP_STRING([--with-cocoa-gui], [Use Cocoa for GUI on OS X]),
[WANT_COCOA_UI=$withval], [])
AC_ARG_WITH(libscg-prefix,
AS_HELP_STRING([--with-libscg-prefix], [Absolute path to where libscg is installed (optional)]),
[LIBSCG_PREFIX=$withval], [])
AC_ARG_WITH(libscg-includedir,
AS_HELP_STRING([--with-libscg-includedir], [Absolute path to libscg headers are installed (default LIBSCG_PREFIX/include)]),
[LIBSCG_INCLUDEDIR=$withval], [])
AC_ARG_WITH(libscg-libdir,
AS_HELP_STRING([--with-libscg-libdir], [Absolute path to libscg libs are installed (default LIBSCG_PREFIX/lib)]),
[LIBSCG_LIBDIR=$withval], [])
AC_ARG_WITH(alsa,
AS_HELP_STRING([--with-alsa], [Use ALSA library for sound]),
[WANT_ALSA=$withval],[])
dnl
dnl Some simple plausibility tests...
dnl
AC_MSG_CHECKING([configuration options])
if [[ "x$WANT_SDLGL" = "xyes" ]]; then
WANT_SDLGFX=yes
fi
if [[ "x$WANT_SDLSND" = "xyes" -o "x$WANT_SDLGFX" = "xyes" ]]; then
WANT_SDL=yes
fi
if [[ "x$WANT_SDL" = "xno" ]]; then
WANT_SDLGFX=no
WANT_SDLSND=no
WANT_SDLGL=no
fi
if [[ "x$WANT_DGA" = "xyes" -a "x$WANT_SDLGFX" = "xyes" ]]; then
AC_MSG_WARN([DGA support cannot be enabled for non-X11 targets!])
NR_ERRORS=`expr $NR_ERRORS + 1`
WANT_DGA=no
fi
if [[ "x$WANT_DGA" = "xyes" -a "x$no_x" = "xyes" ]]; then
AC_MSG_WARN([Ignoring --enable-dga, since X was disabled or not found])
NR_ERRORS=`expr $NR_ERRORS + 1`
WANT_DGA=no
fi
if [[ "x$WANT_DGA" = "xno" -a "x$WANT_VIDMODE" = "xyes" ]]; then
AC_MSG_WARN([The XF86VidMode extension can only be used in DGA mode. Disabling it])
NR_ERRORS=`expr $NR_ERRORS + 1`
WANT_VIDMODE=no
fi
AC_MSG_RESULT(ok)
dnl Check for X
AC_PATH_XTRA
dnl Check for ncurses
AC_CHECK_LIB(ncurses, waddch, HAVE_NCURSES_LIB=yes, HAVE_NCURSES_LIB=no)
dnl Check for SDL
if [[ "x$WANT_SDL" != "xno" ]]; then
if [[ "$HOST_OS" = "darwin" ]]; then
dnl Assume this is MacOS X and try to use SDL framework
SDL_CFLAGS="-I/Library/Frameworks/SDL.framework/Headers -D_REENTRANT"
SDL_LIBS="-framework Cocoa -framework SDL -lobjc"
AC_MSG_CHECKING(for SDL framework)
SAVE_CPPFLAGS=$CPPFLAGS
SAVE_LIBS=$LIBS
CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
LIBS="$SDL_LIBS $LIBS"
AC_TRY_LINK(
[
#include "confdefs.h"
#include <SDL.h>
#undef main
],
[
SDL_Init(SDL_INIT_VIDEO);
],
AC_MSG_RESULT(yes)
HAVE_SDL=yes
WANT_COCOA_UI=yes,
AC_MSG_RESULT(no)
HAVE_SDL=no)
CPPFLAGS="$SAVE_CPPFLAGS"
LIBS="$SAVE_LIBS"
else
AM_PATH_SDL(1.2.0,HAVE_SDL=yes,HAVE_SDL=no)
fi
if [[ "x$WANT_SDL" = "xyes" -a "x$HAVE_SDL" = "xno" ]]; then
AC_MSG_WARN([SDL support wanted, but libSDL could not be found])
WANT_SDL=no
NR_ERRORS=`expr $NR_ERRORS + 1`
fi
fi
if test $ac_cv_prog_gcc = yes; then
WARNING_CFLAGS="$WARNING_CFLAGS -Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes"
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -fomit-frame-pointer"
fi
if [[ "x$DO_PROFILING" = "xyes" ]]; then
if [[ "x$HAVE_GCC27" = "xyes" ]]; then
OPTIMIZE_CFLAGS=""
DEBUG_CFLAGS="-g -fno-inline -fno-omit-frame-pointer -pg -DUSE_PROFILING"
LDFLAGS="-pg"
else
DO_PROFILING=no
AC_MSG_WARN([Don't know how to set up profiling for your compiler])
NR_ERRORS=`expr $NR_ERRORS + 1`
fi
fi
UAE_CFLAGS="$OPTIMIZE_CFLAGS $DEBUG_CFLAGS $WARNING_CFLAGS"
dnl
dnl Check CPU emulation options
dnl
dnl Now configure the CPU emulation proper
ASMOBJS=
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_0"
CPUOBJS='cpuemu_0.$(OBJEXT)'
if [[ "x$WANT_COMPATIBLE" != "xno" ]]; then
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_5"
CPUOBJS="$CPUOBJS cpuemu_5.\$(OBJEXT)"
fi
if [[ "x$WANT_CYCLEEXACT" != "xno" ]]; then
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_6"
CPUOBJS="$CPUOBJS cpuemu_6.\$(OBJEXT)"
fi
if [[ "x$WANT_FPU" != "xno" ]]; then
UAE_DEFINES="$UAE_DEFINES -DFPUEMU"
CPUOBJS="$CPUOBJS fpp.\$(OBJEXT)"
fi
if [[ "x$HAVE_GCC27" = "xyes" -a "$HOST_CPU" = "i386" -a "x$DO_PROFILING" = "xno" ]]; then
dnl strength-reduce is turned off not because of paranoia, but because it
dnl actually makes the code worse in some cases on the i386 (generates too
dnl many registers, which all end up on the stack).
UAE_CFLAGS="$UAE_CFLAGS -fno-strength-reduce -DREGPARAM=\"__attribute__((regparm(3)))\""
UAE_DEFINES="$UAE_DEFINES -DUNALIGNED_PROFITABLE"
else if [[ "x$HAVE_GCC27" = "xyes" -a "$HOST_CPU" = "68k" ]]; then
UAE_CFLAGS="$UAE_CFLAGS -DREGPARAM=\"__attribute__((regparm(4)))\""
UAE_DEFINES="$UAE_DEFINES -DUNALIGNED_PROFITABLE -DM68K_FLAG_OPT=1 -DSTATIC_INLINE=\"static inline\""
else
UAE_CFLAGS="$UAE_CFLAGS -DREGPARAM="
fi
fi
dnl
dnl Check whether to build with optimized CCR flags handling
dnl
if [[ "x$HAVE_GCC27" = "xyes" ]]; then
if [[ "$HOST_CPU" = "i386" -o "$HOST_CPU" = "ppc" -o "$HOST_CPU" = "68k" ]]; then
GENCPUOPTS="--optimized-flags"
fi
fi
dnl
dnl Check whether to build JIT
dnl
AC_MSG_CHECKING([whether to build JIT compiler])
JITOBJS=""
if [[ "x$WANT_JIT" != "xno" -a "$HOST_CPU" = "i386" ]]; then
UAE_DEFINES="$UAE_DEFINES -DJIT"
if [[ "x$NATMEM" = "xyes" ]]; then
NATMEM="0x50000000"
fi
if [[ "x$NATMEM" != "xno" ]]; then
UAE_DEFINES="$UAE_DEFINES -DNATMEM_OFFSET=$NATMEM"
fi
JITOBJS='compstbl.$(OBJEXT) compemu.$(OBJEXT) compemu_support.$(OBJEXT) compemu_fpp.$(OBJEXT)'
if [[ "x$NOFLAGS" != "xno" ]]; then
JITOBJS="$JITOBJS cpustbl_nf.\$(OBJEXT)"
JITOBJS="$JITOBJS cpuemu_nf_0.\$(OBJEXT)"
if [[ "x$WANT_COMPATIBLE" != "xno" ]]; then
JITOBJS="$JITOBJS cpuemu_nf_5.\$(OBJEXT)"
fi
if [[ "x$WANT_CYCLEEXACT" != "xno" ]]; then
JITOBJS="$JITOBJS cpuemu_nf_6.\$(OBJEXT)"
fi
fi
AC_MSG_RESULT(yes)
AC_MSG_CHECKING([whether assembler supports --execstack option])
SAVE_CFLAGS="$CFLAGS"
CFLAGS="-Wa,--execstack $CFLAGS"
AC_TRY_COMPILE(, int main (void) {return 0;},
[AC_MSG_RESULT(yes)
UAE_CFLAGS="-Wa,--execstack $UAE_CFLAGS"],
AC_MSG_RESULT(no)
)
CFLAGS="$SAVE_CFLAGS"
else
AC_MSG_RESULT(no)
fi
AC_CACHE_SAVE
dnl
dnl Check which graphics target to build
dnl
AC_MSG_CHECKING([for graphics target to build])
dnl Check whether we wanted to use ncurses
dnl
dnl First check if we need to uses ncurses because no
dnl other gfx support is available
if [[ "x$WANT_NCURSES" != "xno" -a "x$WANT_SDL" = "xno" -a "x$GFX_DEP" = "x" ]]; then
WANT_NCURSES=yes
fi
if [[ "x$WANT_NCURSES" = "xyes" ]]; then
if [[ "x$HAVE_NCURSES_LIB" = "xyes" ]]; then
GFX_LIBS="-lncurses"
GFX_CFLAGS=
GFX_CPPFLAGS=
GFX_DEP=gfx-curses
GFX_NAME=ncurses
else
AC_MSG_WARN([ncurses support wanted, but libncurses could not be found])
fi
fi
dnl Check whether we actually wanted to use SDL or whether
dnl we need to use SDL because we couldn't find any other
dnl graphics support
dnl
if [[ "x$WANT_SDL" = "xyes" -o "x$GFX_DEP" = "x" ]]; then
if [[ "x$HAVE_SDL" = "xyes" -a "x$WANT_SDLGFX" != "xno" ]]; then
WANT_SDL=yes
if [[ "x$WANT_SDLGFX" = "xyes" -o "x$GFX_DEP" = "x" ]]; then
GFX_DEP=gfx-sdl
GFX_NAME=SDL
GFX_LIBS=""
GFX_CFLAGS=""
GFX_CPPFLAGS=""
if [[ "x$WANT_SDLGL" = "xyes" ]]; then
GFX_CFLAGS="-DUSE_GL"
if [[ "x$OSDEP" = "xod-macosx" ]]; then
GFX_LIBS="-framework OpenGL"
else
GFX_LIBS="-lGL -lGLU"
fi
fi
fi
fi
fi
dnl If we got here and we still haven't found a graphics target
dnl then bail out.
dnl
if [[ "x$GFX_DEP" = "x" ]]; then
AC_MSG_RESULT(none)
AC_MSG_ERROR([Could not find a useable graphics target])
fi
AC_MSG_RESULT("$GFX_NAME")
dnl
dnl If we're using X, find out what extensions are wanted/available
dnl
if [[ "$GFX_DEP" = "gfx-x11" ]]; then
dnl If the user wants DGA, see if we have it.
dnl This must come after we checked for X11.
if [[ "x$WANT_DGA" = "xyes" ]]; then
TMP_SAVE_LIBS=$LIBS
LIBS="$X_LIBS $LIBS"
AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no, [ $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
LIBS=$TMP_SAVE_LIBS
if [[ "x$HAVE_DGA" = "xno" ]]; then
AC_MSG_WARN([Could not find DGA extension, ignoring --enable-dga])
NR_ERRORS=`expr $NR_ERRORS + 1`
WANT_DGA=no
else
X_CFLAGS="$X_CFLAGS -DUSE_DGA_EXTENSION"
X_EXTRA_LIBS="$X_EXTRA_LIBS -lXxf86dga"
fi
fi
if [[ "x$WANT_VIDMODE" = "xyes" ]]; then
TMP_SAVE_LIBS=$LIBS
LIBS="$X_LIBS $LIBS"
AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension, HAVE_VIDMODE=yes, HAVE_VIDMODE=no, [ $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS ])
LIBS=$TMP_SAVE_LIBS
if [[ "x$HAVE_VIDMODE" = "xno" ]]; then
AC_MSG_WARN([Could not find VidMode extension, ignoring --enable-vidmode])
NR_ERRORS=`expr $NR_ERRORS + 1`
WANT_VIDMODE=no
else
X_CFLAGS="$X_CFLAGS -DUSE_VIDMODE_EXTENSION"
X_EXTRA_LIBS="$X_EXTRA_LIBS -lXxf86vm"
fi
fi
dnl Check if we can compile with XKB/XKBfile support
AC_MSG_CHECKING(whether to compile XKB extension support)
TMP_SAVE_LIBS=$LIBS
TMP_SAVE_CFLAGS=$CFLAGS
LIBS="$X_LIBS $LIBS -lxkbfile"
CFLAGS="$CFLAGS $X_CFLAGS"
AC_TRY_LINK([
#include "confdefs.h"
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>],[
int major, minor;
XkbRF_RulesPtr rules;
XkbLibraryVersion (&major, &minor);
rules = XkbRF_Load ("dummy", "", True, True);
],
AC_MSG_RESULT(yes)
X_CFLAGS="$X_CFLAGS -DUSE_XKB"
X_EXTRA_LIBS="$X_EXTRA_LIBS -lxkbfile"
xkb_rules_dir_found="no"
for xkb_rules_dir in /usr/share/X11/xkb/rules /usr/lib/X11/xkb/rules /usr/X11R6/lib/X11/xkb/rules
do
if test -d $xkb_rules_dir ; then
X_CFLAGS="$X_CFLAGS -DXKB_PATH=\\\"$xkb_rules_dir/\\\""
xkb_rules_dir_found="yes"
break
fi
done
if test "x$xkb_rules_dir_found" = "xno" ; then
AC_MSG_ERROR([[Could not find xkb path.]])
fi,
AC_MSG_RESULT(no)
)
LIBS=$TMP_SAVE_LIBS
CFLAGS=$TMP_SAVE_CFLAGS
dnl See if we can at least compile SHM support
if [[ "x$no_x" != "xyes" -a "x$ac_cv_header_sys_ipc_h" = "xyes" -a "x$ac_cv_header_sys_shm_h" = "xyes" ]]; then
AC_MSG_CHECKING(whether the X11 MIT-SHM extension can be compiled in)
TMP_SAVE_CFLAGS=$CFLAGS
TMP_SAVE_LIBS=$LIBS
CFLAGS="$CFLAGS $X_CFLAGS"
LIBS="$X_LIBS $LIBS $X_PRE_LIBS -lX11 -lXext $X_EXTRA_LIBS"
AC_TRY_LINK([
#include "confdefs.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/cursorfont.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>],[
static XShmSegmentInfo shminfo;
static Display *display;
XShmAttach(display, &shminfo);
XSync(display,0);
shmctl(shminfo.shmid, IPC_RMID, 0);
],
SHM_SUPPORT_LINKS=1
AC_MSG_RESULT(yes),
SHM_SUPPORT_LINKS=0
AC_MSG_RESULT(no))
fi
CFLAGS=$TMP_SAVE_CFLAGS
LIBS=$TMP_SAVE_LIBS
GFX_CFLAGS="$X_CFLAGS"
GFX_CPPFLAGS="-DSHM_SUPPORT_LINKS=$SHM_SUPPORT_LINKS"
GFX_LIBS="$X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS"
fi
dnl
dnl Check which sound target to use
dnl
AC_MSG_CHECKING([for sound target to build])
if [[ "x$WANT_AUDIO" != "xno" ]]; then
if [[ "x$SND_NAME" = "xnone" ]]; then
if [[ "x$ac_cv_header_sys_audioio_h" = "xyes" -o "x$ac_cv_header_sun_audioio_h" = "xyes" ]]; then
SND_DEP=sd-solaris
SND_NAME=Solaris/NetBSD
USE_SOUND=yes
else if [[ "x$WANT_ALSA" = "xyes" ]]; then
SND_DEP=sd-alsa
SND_LIBS="-lasound"
SND_NAME=ALSA