forked from voorhees1979/PUAE
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfigure.ac
2371 lines (2111 loc) · 64.1 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 1996, 1997, 1998 Bernd Schmidt
dnl
dnl Updated, re-written and generally mauled 2003 Richard Drummond
dnl Updated and generally mauled 2008-2014 Mustafa Tufan
dnl
AC_PREREQ(2.55)
AC_INIT(PUAE, 2.8.0, [email protected], puae)
AC_CONFIG_SRCDIR([bootstrap.sh])
AC_CONFIG_HEADER([src/sysconfig.h])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(1.7 dist-bzip2 foreign subdir-objects)
dnl
dnl Checks for programs.
dnl
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_OBJC
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=
WARNING_CXXFLAGS=
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
dnl commit version
dnl
commit=`tail -1 .git/packed-refs | awk '{print $1}'`
if test -z "$commit"; then
commit="not git"
fi
AC_DEFINE_UNQUOTED(PACKAGE_COMMIT, "$commit", [cloned git commit version])
AC_SUBST(PACKAGE_COMMIT, $commit)
dnl
dnl Prefer Gtk2.x over Gtk1.x if both are available
dnl
dnl Update:
dnl Using GTK1 is a big big NO-NO! We have 2013 and
dnl the Gnome community celebrates GTK3.
AM_PATH_GTK_2_0(2.0.0,HAVE_GTK=yes,HAVE_GTK=no)
dnl if [[ "x$HAVE_GTK" = "xno" ]]; then
dnl AM_PATH_GTK(1.0.0,HAVE_GTK=yes,HAVE_GTK=no)
dnl fi
dnl
dnl Check if Qt 4 is installed
dnl
HAVE_QT=no
AC_MSG_CHECKING(QT version via qmake)
if test -z "$QMAKE"; then
AC_MSG_NOTICE([QMAKE env not set..])
QMAKE=`which qmake`
if test -z "$QMAKE"; then
AC_MSG_NOTICE([Can't find which qmake..])
dnl maybe qmake is in the path
qmake_version=`qmake -query QT_VERSION 2>&1`
if test -z "$qmake_version"; then
AC_MSG_NOTICE([Can't find qmake in PATH..])
else
QMAKE=`qmake -query QT_INSTALL_BINS 2>&1`
QMAKE="$QMAKE/qmake"
HAVE_QT=yes
AC_MSG_RESULT( $qmake_version )
fi
else
HAVE_QT=yes
qmake_version=`$QMAKE -query QT_VERSION 2>&1`
AC_MSG_RESULT( $qmake_version )
fi
else
HAVE_QT=yes
qmake_version=`$QMAKE -query QT_VERSION 2>&1`
AC_MSG_RESULT( $qmake_version )
fi
dnl
dnl if QT
dnl
if [[ "x$HAVE_QT" = "xyes" ]]; then
AC_MSG_CHECKING(QT: Meta Object Compiler)
if test -z "$QT_MOC"; then
AC_MSG_NOTICE([QT_MOC env not set..])
QT_MOC=`which moc`
if test -z "$QT_MOC"; then
AC_MSG_NOTICE([Can't find moc])
else
AC_MSG_RESULT( $QT_MOC )
fi
fi
AC_MSG_CHECKING(QT: User Interface Compiler)
if test -z "$QT_UIC"; then
dnl AC_MSG_NOTICE([QT_UIC env not set..])
QT_UIC=`which uic`
if test -z "$QT_UIC"; then
AC_MSG_NOTICE([Can't find uic])
else
AC_MSG_RESULT( $QT_UIC )
fi
fi
AC_MSG_CHECKING(QT: Resource Compiler)
if test -z "$QT_RCC"; then
dnl AC_MSG_NOTICE([QT_RCC env not set..])
QT_RCC=`which rcc`
if test -z "$QT_RCC"; then
AC_MSG_NOTICE([Can't find rcc])
else
AC_MSG_RESULT( $QT_RCC )
fi
fi
dnl
dnl
AC_MSG_CHECKING(QT HEADERS via qmake)
QT_INSTALL_HEADERS=`$QMAKE -query QT_INSTALL_HEADERS 2>&1`
AC_MSG_RESULT( $QT_INSTALL_HEADERS )
AC_MSG_CHECKING(QT LIBS via qmake)
QT_INSTALL_LIBS=`$QMAKE -query QT_INSTALL_LIBS 2>&1`
AC_MSG_RESULT( $QT_INSTALL_LIBS )
fi
dnl
dnl
dnl
if [[ "x$HAVE_QT" = "xno" ]]; then
if [[ "x$WANT_QT" = "xyes" ]]; then
WANT_QT=no
fi
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])
AC_CHECK_HEADERS([pcap.h], HAVE_PCAP=yes, HAVE_PCAP=no)
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 *)
if test "${ac_cv_c_have_long_double}" = "yes" ; then
AC_CHECK_SIZEOF(long double, 12)
fi
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 fsusage
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
;;
nacl*)
HOST_OS=nacl
OSDEP=od-linux
;;
pnacl*)
HOST_OS=nacl
OSDEP=od-linux
;;
aros)
HOST_OS=aros
OSDEP=od-amiga
;;
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
dnl quick hack for arm
have_armcpu=no
case $host_cpu in
i[[3-7]]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 | m680[246]0)
HOST_CPU=68k
MDFPP_H=fpp-ieee.h
;;
arm*)
HOST_CPU=generic
MDFPP_H=fpp-unknown.h
have_armcpu=yes
;;
esac
AC_MSG_RESULT([$HOST_CPU])
MACHDEP="md-$HOST_CPU"
dnl
dnl Find out what compiler we have
dnl
HAVE_GCC27=no
HAVE_GCC30=no
HAVE_GCC40=no
HAVE_GCC46=no
HAVE_GCC47=no
HAVE_GCC48=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))
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))
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))
AC_MSG_CHECKING([for GCC 4.6 or higher])
AC_EGREP_CPP(yes,
[#if (__GNUC__ > 3 && __GNUC_MINOR__ > 5)
yes
#endif
], [AC_MSG_RESULT(yes); HAVE_GCC46=yes], AC_MSG_RESULT(no))
AC_MSG_CHECKING([for GCC 4.7 or higher])
AC_EGREP_CPP(yes,
[#if (__GNUC__ > 3 && __GNUC_MINOR__ > 6)
yes
#endif
], [AC_MSG_RESULT(yes); HAVE_GCC47=yes], AC_MSG_RESULT(no))
AC_MSG_CHECKING([for GCC 4.8 or higher])
AC_EGREP_CPP(yes,
[#if (__GNUC__ > 3 && __GNUC_MINOR__ > 7)
yes
#endif
], [AC_MSG_RESULT(yes); HAVE_GCC48=yes], AC_MSG_RESULT(no))
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
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
dnl PIE disabled
dnl if [[ "$HOST_OS" = "darwin" ]]; then
dnl OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -mdynamic-no-pic"
dnl 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
dnl -o "$HOST_CPU" = "amd64" ]]; 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_GAYLE=no
WANT_A2065=no
WANT_A2091=no
WANT_AMAX=no
WANT_NCR=no
WANT_AGA=yes
WANT_CD32=dunno
WANT_CDTV=dunno
WANT_BSDSOCK=dunno
WANT_UI=dunno
WANT_AUDIO=dunno
WANT_MMU=yes
WANT_FPU=yes
WANT_COMPATIBLE=yes
WANT_CYCLEEXACT=yes
WANT_CAPS=no
WANT_FDI=yes
WANT_SCP=yes
WANT_ENFORCER=dunno
WANT_CATWEASEL=no
WANT_SERIAL=no
WANT_ANDROID=no
MATHLIB=-lm
dnl
dnl Override defaults for specific targets
dnl
if [[ "$HOST_OS" = "linux" ]]; then
JOY_DEP=jd-linuxold
JOY_NAME="linux"
dnl if [[ "$HOST_CPU" = "i386" ]]; then
dnl NATMEM="0x50000000"
dnl 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 [[ "$HOST_OS" = "nacl" ]]; then
WANT_JIT=no
WANT_AUTOCONFIG=no
GUI_DEP=gui-html
GUI_LIBS="-lppapi -lppapi_cpp -lppapi_gles2"
GUI_NAME="HTML"
fi
fi
fi
fi
dnl
dnl writelog is needed almost everywhere
dnl
EXTRAOBJS='writelog.$(OBJEXT)'
dnl
dnl Options
dnl
AC_ARG_ENABLE(a2065, AS_HELP_STRING([--enable-a2065], [Enable A2065 Ethernet emulation (default no)]), [WANT_A2065=$enableval],[])
AC_ARG_ENABLE(a2091, AS_HELP_STRING([--enable-a2091], [Enable A2091 SCSI emulation (default no)]), [WANT_A2091=$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(aga, AS_HELP_STRING([--enable-aga], [Enable AGA chipset emulation (default yes)]), [WANT_AGA=$enableval],[])
AC_ARG_ENABLE(amax, AS_HELP_STRING([--enable-amax], [Enable AMAX support (default no)]), [WANT_AMAX=$enableval],[])
AC_ARG_ENABLE(autoconfig, AS_HELP_STRING([--enable-autoconfig], [Enable emulation of autoconfig devices (default auto)]), [WANT_AUTOCONFIG=$enableval],[])
AC_ARG_ENABLE(audio, AS_HELP_STRING([--enable-audio], [Enable audio output (default auto)]), [WANT_AUDIO=$enableval],[])
AC_ARG_ENABLE(bsdsock, AS_HELP_STRING([--enable-bsdsock], [Enable bsdsocket.library emulation]), [WANT_BSDSOCK=$enableval],[])
AC_ARG_ENABLE(catweasel, AS_HELP_STRING([--enable-catweasel], [Enable Catweasel support (default no)]), [WANT_CATWEASEL=$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(compatible-cpu, AS_HELP_STRING([--enable-compatible-cpu], [Enable compatible CPU emulation (default yes)]), [WANT_COMPATIBLE=$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(debugger, AS_HELP_STRING([--disable-debugger], [Disable internal debugger/monitor (default no)]), [WANT_DEBUGGER=$enableval],[])
AC_ARG_ENABLE(dga, AS_HELP_STRING([--enable-dga], [X11 version: Use the DGA extension]), [WANT_DGA=$enableval],[])
AC_ARG_ENABLE(drvsnd, AS_HELP_STRING([--enable-drvsnd], [Enable Floppy Drive Sound Emulation (default no)]), [WANT_DRVSND=$enableval],[])
AC_ARG_ENABLE(enforcer, AS_HELP_STRING([--enable-enforcer], [Enable ersatz Enforcer support (default auto)]), [WANT_ENFORCER=$enableval],[])
AC_ARG_ENABLE(fdi, AS_HELP_STRING([--enable-fdi], [Enable FDI support (default yes)]), [WANT_FDI=$enableval],[])
AC_ARG_ENABLE(fpu, AS_HELP_STRING([--enable-fpu], [Enable FPU emulation (default yes)]), [WANT_FPU=$enableval],[])
AC_ARG_ENABLE(gayle, AS_HELP_STRING([--enable-gayle], [Enable GAYLE IDE emulation (default no)]), [WANT_GAYLE=$enableval],[])
AC_ARG_ENABLE(gccopt, AS_HELP_STRING([--enable-gccopt], [Enable CPU Specific Optimizations (default no)]), [WANT_OPT=$enableval],[])
AC_ARG_ENABLE(gccdebug, AS_HELP_STRING([--enable-gccdebug], [Enable gcc debugging options (default no)]), [WANT_GGDB=$enableval],[])
AC_ARG_ENABLE(jit, AS_HELP_STRING([--enable-jit], [Enable JIT compiler (currently x86 only)]), [WANT_JIT=$enableval],[])
AC_ARG_ENABLE(profiling, AS_HELP_STRING([--enable-profiling], [Build a profiling (SLOW!) version]), [DO_PROFILING=$enableval],[])
AC_ARG_ENABLE(mmu, AS_HELP_STRING([--enable-mmu], [Enable MMU emulation (default yes)]), [WANT_MMU=$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(ncr, AS_HELP_STRING([--enable-ncr], [Enable NCR SCSI emulation (default no)]), [WANT_NCR=$enableval],[])
AC_ARG_ENABLE(save-state, AS_HELP_STRING([--disable-save-state], [Disable support for saving state snapshots (default no)]), [WANT_SAVESTATE=$enableval],[])
AC_ARG_ENABLE(serial-port, AS_HELP_STRING([--enable-serial-port], [Enable serial port emulation (default no)]), [WANT_SERIAL=$enableval],[])
AC_ARG_ENABLE(scp, AS_HELP_STRING([--enable-scp], [Enable SCP support (default yes)]), [WANT_SCP=$enableval],[])
AC_ARG_ENABLE(scsi-device, AS_HELP_STRING([--enable-scsi-device], [Enable emulation of SCSI devices (default no)]), [WANT_SCSIEMU=$enableval],[])
AC_ARG_ENABLE(threads, AS_HELP_STRING([--enable-threads], [Enable thread support (default auto)]), [WANT_THREADS=$enableval],[])
AC_ARG_ENABLE(ui, AS_HELP_STRING([--enable-ui], [Use a user interface if possible (default on)]), [WANT_UI=$enableval],[])
AC_ARG_ENABLE(vidmode, AS_HELP_STRING([--enable-vidmode], [X11 version: Use the XF86VidMode extension]), [WANT_VIDMODE=$enableval],[])
AC_ARG_ENABLE(xarcade, AS_HELP_STRING([--disable-xarcade], [Disable keymaps for X-Arcade joysticks (default: enabled)]), [WANT_XARCADE=$enableval],[WANT_XARCADE=yes])
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(sdl-gui,
AS_HELP_STRING([--with-sdl-gui], [Use SDL for GUI]),
[WANT_SDL_UI=$withval], [])
AC_ARG_WITH(cocoa-gfx,
AS_HELP_STRING([--with-cocoa-gfx], [Use Cocoa library for graphics]),
[WANT_COCOAGFX=$withval], [])
AC_ARG_WITH(pepper,
AS_HELP_STRING([--with-pepper], [Use Pepper for graphics/sound/input (NaCl only)]),
[WANT_PEPPER=$withval], [])
AC_ARG_WITH(qt,
AS_HELP_STRING([--with-qt], [Use QT library for graphics/ui]),
[WANT_QT=$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(want_android,
AS_HELP_STRING([--want-android], [Force Android Build]),
[WANT_ANDROID=$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" -o "x$WANT_SDL_UI" = "xyes" ]]; then
WANT_SDL=yes
fi
if [[ "x$WANT_SDL" = "xno" ]]; then
WANT_SDLGFX=no
WANT_SDLSND=no
WANT_SDLGL=no
WANT_SDL_UI=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
dnl Check for SDL
dnl
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"
SDL2_CFLAGS="-I/Library/Frameworks/SDL2.framework/Headers -D_REENTRANT"
SDLI_CFLAGS="-I/Library/Frameworks/SDL_image.framework/Headers -D_REENTRANT"
SDLI2_CFLAGS="-I/Library/Frameworks/SDL2_image.framework/Headers -D_REENTRANT"
SDLT_CFLAGS="-I/Library/Frameworks/SDL_ttf.framework/Headers -D_REENTRANT"
SDLT2_CFLAGS="-I/Library/Frameworks/SDL2_ttf.framework/Headers -D_REENTRANT"
SDL_LIBS="-framework Cocoa -framework SDL -lobjc"
SAVE_CPPFLAGS=$CPPFLAGS
SAVE_LIBS=$LIBS
LIBS="$SDL_LIBS $LIBS"
FOOFLAGS=$CPPFLAGS
AC_MSG_CHECKING(for SDL2 framework)
CPPFLAGS="$CPPFLAGS $SDL2_CFLAGS"
AC_TRY_LINK(
[
#include "confdefs.h"
#include <SDL.h>
#undef main
],
[
SDL_Init(SDL_INIT_VIDEO);
],
AC_MSG_RESULT(yes)
HAVE_SDL2=yes
WANT_COCOA_UI=yes,
AC_MSG_RESULT(no)
HAVE_SDL2=no)
AC_MSG_CHECKING(for SDL framework)
CPPFLAGS="$FOOFLAGS $SDL_CFLAGS"
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(2.0.0,HAVE_SDL2=yes,HAVE_SDL2=no)
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
dnl -----------------------------------------------
dnl Do we want GCC-Debugging?
dnl Sven
dnl -----------------------------------------------
want_gcc_debug=
AC_MSG_CHECKING([whether to use GCC debugging information])
if [[ "x$WANT_GGDB" == "xyes" ]]; then
AC_MSG_RESULT(yes)
want_gcc_debug=yes
else
AC_MSG_RESULT(no)
want_gcc_debug=no
fi
if test $ac_cv_prog_gcc = yes; then
WARNING_CFLAGS="$WARNING_CFLAGS -fdiagnostics-show-option -Wall -Wextra -pedantic"
WARNING_CFLAGS="$WARNING_CFLAGS -Wno-unused-parameter -Wno-format"
UNUSED_WARN="-Wno-unused-parameter"
dnl --- Fixing orphans and cleaning files ---
dnl Once all files compile without warnings, the following
dnl settings can be used to control which warnings about
dnl unused functions and parameters should be shown.
dnl
dnl Note: --Wno-unused-parameter should stay, there are a lot dummy functions!
dnl
UNUSED_WARN="$UNUSED_WARN -Wno-unused-variable"
UNUSED_WARN="$UNUSED_WARN -Wno-unused-function"
if [[ "x$HAVE_GCC46" = "xyes" ]]; then
UNUSED_WARN="$UNUSED_WARN -Wno-unused-but-set-variable"
fi
# Now put them together
WARNING_CFLAGS="$WARNING_CFLAGS $UNUSED_WARN -Wno-format"
WARNING_CXXFLAGS="$WARNING_CFLAGS"
# The following two are not valid for C++
WARNING_CFLAGS="$WARNING_CFLAGS -Wmissing-prototypes -Wstrict-prototypes"
if [[ "x$want_gcc_debug" == "xyes" ]]; then
DEBUG_CFLAGS="$DEBUG_CFLAGS -ggdb"
dnl if [[ "x$HAVE_GCC48" = "xyes" ]]; then
dnl DEBUG_CFLAGS="$DEBUG_CFLAGS -Og"
dnl fi
else
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS -fomit-frame-pointer -ffast-math"
fi
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"
UAE_CXXFLAGS="$OPTIMIZE_CFLAGS $DEBUG_CFLAGS $WARNING_CXXFLAGS"
dnl -----------------------------------------------
dnl Check CPU emulation options
dnl -----------------------------------------------
dnl mtufan was here.. :}
dnl
ASMOBJS=
dnl
dnl CPUEMU_0 : generic 680x0 emulation
dnl
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_0"
CPUOBJS='cpuemu_0.$(OBJEXT)'
dnl
dnl CPUEMU_11: 68000/68010 prefetch
dnl
if [[ "x$WANT_COMPATIBLE" != "xno" ]]; then
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_11"
CPUOBJS="$CPUOBJS cpuemu_11.\$(OBJEXT)"
fi
dnl
dnl CPUEMU_13: 68000/68010 CE cpu & blitter
dnl CPUEMU_20: 68020 prefetch
dnl CPUEMU_21: 68020 CE + blitter
dnl CPUEMU_22: 68030 (040/060) CE + blitter
dnl
if [[ "x$WANT_CYCLEEXACT" != "xno" ]]; then
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_13 -DCPUEMU_20 -DCPUEMU_21 -DCPUEMU_22"
CPUOBJS="$CPUOBJS cpuemu_13.\$(OBJEXT) cpuemu_20.\$(OBJEXT) cpuemu_21.\$(OBJEXT) cpuemu_22.\$(OBJEXT)"
fi
dnl