5 |
|
AC_PREREQ(2.52) |
6 |
|
AC_CONFIG_HEADER(config.h) |
7 |
|
|
8 |
< |
dnl Options. |
8 |
> |
dnl Video options. |
9 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
10 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
11 |
|
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes]) |
12 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
13 |
|
|
14 |
+ |
dnl JIT compiler options. |
15 |
+ |
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no]) |
16 |
+ |
AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no]) |
17 |
+ |
|
18 |
|
dnl FPU emulation core. |
19 |
|
AC_ARG_ENABLE(fpe, |
20 |
|
[ --enable-fpe=FPE specify which fpu emulator to use [default=auto]], |
69 |
|
HAVE_M68K=no |
70 |
|
HAVE_SPARC=no |
71 |
|
HAVE_POWERPC=no |
72 |
+ |
HAVE_X86_64=no |
73 |
|
case "$target_cpu" in |
74 |
< |
i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;; |
75 |
< |
m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;; |
76 |
< |
sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;; |
77 |
< |
powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;; |
78 |
< |
*) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;; |
74 |
> |
i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;; |
75 |
> |
m68k* ) HAVE_M68K=yes;; |
76 |
> |
sparc* ) HAVE_SPARC=yes;; |
77 |
> |
powerpc* ) HAVE_POWERPC=yes;; |
78 |
> |
x86_64* ) HAVE_X86_64=yes;; |
79 |
|
esac |
75 |
– |
DEFINES="$DEFINES -DCPU_$CPU_TYPE" |
80 |
|
|
81 |
|
dnl Checks for programs. |
82 |
|
AC_PROG_CC |
139 |
|
AC_CHECK_FUNCS(pthread_cancel) |
140 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
141 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
142 |
+ |
AC_CHECK_FUNCS(pthread_mutexattr_setpshared) |
143 |
|
|
144 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
145 |
|
SEMSRC= |
360 |
|
LIBS="$LIBS -laudio" |
361 |
|
WANT_ESD=no |
362 |
|
|
363 |
< |
dnl Check if our compiler supports -Ofast (MIPSPro) |
364 |
< |
HAVE_OFAST=no |
363 |
> |
dnl Check if our compiler supports -IPA (MIPSPro) |
364 |
> |
HAVE_IPA=no |
365 |
|
ocflags="$CFLAGS" |
366 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'` |
367 |
< |
AC_MSG_CHECKING(if "-Ofast" works) |
366 |
> |
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
367 |
> |
AC_MSG_CHECKING(if "-IPA" works) |
368 |
|
dnl Do a test compile of an empty function |
369 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no)) |
369 |
> |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
370 |
|
CFLAGS="$ocflags" |
371 |
|
|
372 |
|
;; |
744 |
|
fi |
745 |
|
fi |
746 |
|
|
747 |
+ |
dnl Banked Memory Addressing mode is not supported by the JIT compiler |
748 |
+ |
if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then |
749 |
+ |
AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least]) |
750 |
+ |
fi |
751 |
+ |
|
752 |
|
dnl Enable VOSF screen updates with this feature is requested and feasible |
753 |
|
if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then |
754 |
|
AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.]) |
814 |
|
dnl Select appropriate CPU source and REGPARAM define. |
815 |
|
ASM_OPTIMIZATIONS=none |
816 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
817 |
< |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then |
817 |
> |
|
818 |
> |
dnl (gb) JITSRCS will be emptied later if the JIT is not available |
819 |
> |
dnl Other platforms should define their own set of noflags file variants |
820 |
> |
CAN_JIT=no |
821 |
> |
JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp" |
822 |
> |
|
823 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
824 |
|
dnl i386 CPU |
825 |
< |
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
825 |
> |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\"" |
826 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
827 |
|
ASM_OPTIMIZATIONS=i386 |
828 |
< |
DEFINES="$DEFINES -DX86_ASSEMBLY -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS" |
829 |
< |
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
828 |
> |
DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE" |
829 |
> |
JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS" |
830 |
> |
CAN_JIT=yes |
831 |
> |
fi |
832 |
> |
elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then |
833 |
> |
dnl x86-64 CPU |
834 |
> |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE" |
835 |
> |
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
836 |
> |
ASM_OPTIMIZATIONS="x86-64" |
837 |
> |
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
838 |
|
fi |
839 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
840 |
|
dnl SPARC CPU |
865 |
|
CPUSRCS="asm_support.s" |
866 |
|
fi |
867 |
|
|
868 |
+ |
dnl Enable JIT compiler, if possible. |
869 |
+ |
if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then |
870 |
+ |
JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o" |
871 |
+ |
DEFINES="$DEFINES -DUSE_JIT -DUSE_JIT_FPU" |
872 |
+ |
|
873 |
+ |
if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then |
874 |
+ |
if [[ "x$WANT_MON" = "xyes" ]]; then |
875 |
+ |
DEFINES="$DEFINES -DJIT_DEBUG=1" |
876 |
+ |
else |
877 |
+ |
AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug]) |
878 |
+ |
WANT_JIT_DEBUG=no |
879 |
+ |
fi |
880 |
+ |
fi |
881 |
+ |
|
882 |
+ |
dnl IEEE core is the only FPU emulator to use with the JIT compiler |
883 |
+ |
case $FPE_CORE_TEST_ORDER in |
884 |
+ |
ieee*) ;; |
885 |
+ |
*) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;; |
886 |
+ |
esac |
887 |
+ |
FPE_CORE_TEST_ORDER="ieee" |
888 |
+ |
else |
889 |
+ |
WANT_JIT=no |
890 |
+ |
WANT_JIT_DEBUG=no |
891 |
+ |
JITSRCS="" |
892 |
+ |
fi |
893 |
+ |
|
894 |
|
dnl Utility macro used by next two tests. |
895 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
896 |
|
dnl commands examining object file, |
1035 |
|
for fpe in $FPE_CORE_TEST_ORDER; do |
1036 |
|
case $fpe in |
1037 |
|
ieee) |
1038 |
< |
if echo "$ac_cv_c_float_format" | grep -q IEEE; then |
1038 |
> |
case $ac_cv_c_float_format in |
1039 |
> |
IEEE*) |
1040 |
|
FPE_CORE="IEEE fpu core" |
1041 |
|
DEFINES="$DEFINES -DFPU_IEEE" |
1042 |
|
FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp" |
1043 |
+ |
dnl Math functions not mandated by C99 standard |
1044 |
+ |
AC_CHECK_FUNCS(isnanl isinfl) |
1045 |
+ |
dnl Math functions required by C99 standard, but probably not |
1046 |
+ |
dnl implemented everywhere. In that case, we fall back to the |
1047 |
+ |
dnl regular variant for doubles. |
1048 |
+ |
AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl) |
1049 |
+ |
AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl) |
1050 |
+ |
AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl) |
1051 |
+ |
AC_CHECK_FUNCS(floorl ceill) |
1052 |
|
break |
1053 |
< |
fi |
1053 |
> |
;; |
1054 |
> |
esac |
1055 |
|
;; |
1056 |
|
x86) |
1057 |
|
if [[ ":$HAVE_GCC27:$HAVE_I386:$HAVE_GAS:" = ":yes:yes:yes:" ]]; then |
1078 |
|
|
1079 |
|
dnl Check for certain math functions |
1080 |
|
AC_CHECK_FUNCS(atanh) |
1081 |
< |
AC_CHECK_FUNCS(isnan isinf) dnl C99 |
1021 |
< |
AC_CHECK_FUNCS(isnanl isinfl) dnl IEEE ? |
1081 |
> |
AC_CHECK_FUNCS(isnan isinf finite isnormal signbit) |
1082 |
|
|
1083 |
|
dnl UAE CPU sources for all non-m68k-native architectures. |
1084 |
|
if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then |
1085 |
|
CPUINCLUDES="-I../uae_cpu" |
1086 |
< |
CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS" |
1086 |
> |
CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS $JITSRCS" |
1087 |
|
fi |
1088 |
|
|
1089 |
|
dnl Remove the "-g" option if set for GCC. |
1092 |
|
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1093 |
|
fi |
1094 |
|
|
1095 |
< |
dnl Or if we have -Ofast |
1096 |
< |
if [[ "x$HAVE_OFAST" = "xyes" ]]; then |
1097 |
< |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast" |
1098 |
< |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast" |
1095 |
> |
dnl Or if we have -IPA (MIPSPro compilers) |
1096 |
> |
if [[ "x$HAVE_IPA" = "xyes" ]]; then |
1097 |
> |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1098 |
> |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1099 |
|
CXXFLAGS="-LANG:std $CXXFLAGS" |
1100 |
< |
LDFLAGS="$LDFLAGS -ipa" |
1100 |
> |
LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" |
1101 |
|
fi |
1102 |
|
|
1103 |
|
dnl Generate Makefile. |
1119 |
|
echo GTK user interface ..................... : $WANT_GTK |
1120 |
|
echo mon debugger support ................... : $WANT_MON |
1121 |
|
echo Running m68k code natively ............. : $WANT_NATIVE_M68K |
1122 |
+ |
echo Use JIT compiler ....................... : $WANT_JIT |
1123 |
+ |
echo JIT debug mode ......................... : $WANT_JIT_DEBUG |
1124 |
|
echo Floating-Point emulation core .......... : $FPE_CORE |
1125 |
|
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS |
1126 |
|
echo Addressing mode ........................ : $ADDRESSING_MODE |