1 |
|
dnl Process this file with autoconf to produce a configure script. |
2 |
|
dnl Written in 2002 by Christian Bauer et al. |
3 |
|
|
4 |
< |
AC_INIT(main_unix.cpp) |
4 |
> |
AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII) |
5 |
> |
AC_CONFIG_SRCDIR(main_unix.cpp) |
6 |
|
AC_PREREQ(2.52) |
7 |
|
AC_CONFIG_HEADER(config.h) |
8 |
|
|
9 |
< |
dnl Options. |
9 |
> |
dnl Video options. |
10 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
11 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
12 |
|
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]) |
13 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
14 |
|
|
15 |
+ |
dnl JIT compiler options. |
16 |
+ |
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no]) |
17 |
+ |
AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no]) |
18 |
+ |
|
19 |
|
dnl FPU emulation core. |
20 |
|
AC_ARG_ENABLE(fpe, |
21 |
|
[ --enable-fpe=FPE specify which fpu emulator to use [default=auto]], |
70 |
|
HAVE_M68K=no |
71 |
|
HAVE_SPARC=no |
72 |
|
HAVE_POWERPC=no |
73 |
+ |
HAVE_X86_64=no |
74 |
|
case "$target_cpu" in |
75 |
< |
i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;; |
76 |
< |
m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;; |
77 |
< |
sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;; |
78 |
< |
powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;; |
79 |
< |
*) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;; |
75 |
> |
i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;; |
76 |
> |
m68k* ) HAVE_M68K=yes;; |
77 |
> |
sparc* ) HAVE_SPARC=yes;; |
78 |
> |
powerpc* ) HAVE_POWERPC=yes;; |
79 |
> |
x86_64* ) HAVE_X86_64=yes;; |
80 |
|
esac |
75 |
– |
DEFINES="$DEFINES -DCPU_$CPU_TYPE" |
81 |
|
|
82 |
|
dnl Checks for programs. |
83 |
|
AC_PROG_CC |
361 |
|
LIBS="$LIBS -laudio" |
362 |
|
WANT_ESD=no |
363 |
|
|
364 |
< |
dnl Check if our compiler supports -Ofast (MIPSPro) |
365 |
< |
HAVE_OFAST=no |
364 |
> |
dnl Check if our compiler supports -IPA (MIPSPro) |
365 |
> |
HAVE_IPA=no |
366 |
|
ocflags="$CFLAGS" |
367 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'` |
368 |
< |
AC_MSG_CHECKING(if "-Ofast" works) |
367 |
> |
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
368 |
> |
AC_MSG_CHECKING(if "-IPA" works) |
369 |
|
dnl Do a test compile of an empty function |
370 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no)) |
370 |
> |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
371 |
|
CFLAGS="$ocflags" |
372 |
|
|
373 |
|
;; |
554 |
|
AC_TRY_RUN([ |
555 |
|
#include "vm_alloc.cpp" |
556 |
|
int main(void) { /* returns 0 if we could map the lowmem globals */ |
557 |
< |
volatile char * lm; |
557 |
> |
volatile char * lm = 0; |
558 |
|
if (vm_init() < 0) exit(1); |
559 |
< |
if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1); |
559 |
> |
if (vm_acquire_fixed(0, 0x2000) < 0) exit(1); |
560 |
|
lm[0] = 'z'; |
561 |
|
if (vm_release((char *)lm, 0x2000) < 0) exit(1); |
562 |
|
vm_exit(); exit(0); |
745 |
|
fi |
746 |
|
fi |
747 |
|
|
748 |
+ |
dnl Banked Memory Addressing mode is not supported by the JIT compiler |
749 |
+ |
if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then |
750 |
+ |
AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least]) |
751 |
+ |
fi |
752 |
+ |
|
753 |
|
dnl Enable VOSF screen updates with this feature is requested and feasible |
754 |
|
if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then |
755 |
|
AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.]) |
770 |
|
dnl Check for GCC 2.7 or higher. |
771 |
|
HAVE_GCC27=no |
772 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
773 |
< |
AC_EGREP_CPP(yes, |
773 |
> |
AC_EGREP_CPP(xyes, |
774 |
|
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
775 |
< |
yes |
775 |
> |
xyes |
776 |
|
#endif |
777 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
778 |
|
|
779 |
|
dnl Check for GCC 3.0 or higher. |
780 |
|
HAVE_GCC30=no |
781 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
782 |
< |
AC_EGREP_CPP(yes, |
782 |
> |
AC_EGREP_CPP(xyes, |
783 |
|
[#if __GNUC__ >= 3 |
784 |
< |
yes |
784 |
> |
xyes |
785 |
|
#endif |
786 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
787 |
|
|
815 |
|
dnl Select appropriate CPU source and REGPARAM define. |
816 |
|
ASM_OPTIMIZATIONS=none |
817 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
818 |
< |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then |
818 |
> |
|
819 |
> |
dnl (gb) JITSRCS will be emptied later if the JIT is not available |
820 |
> |
dnl Other platforms should define their own set of noflags file variants |
821 |
> |
CAN_JIT=no |
822 |
> |
JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp" |
823 |
> |
|
824 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
825 |
|
dnl i386 CPU |
826 |
< |
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
826 |
> |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\"" |
827 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
828 |
|
ASM_OPTIMIZATIONS=i386 |
829 |
< |
DEFINES="$DEFINES -DX86_ASSEMBLY -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS" |
830 |
< |
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
829 |
> |
DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE" |
830 |
> |
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" |
831 |
> |
CAN_JIT=yes |
832 |
> |
fi |
833 |
> |
elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then |
834 |
> |
dnl x86-64 CPU |
835 |
> |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE" |
836 |
> |
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
837 |
> |
ASM_OPTIMIZATIONS="x86-64" |
838 |
> |
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
839 |
|
fi |
840 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
841 |
|
dnl SPARC CPU |
866 |
|
CPUSRCS="asm_support.s" |
867 |
|
fi |
868 |
|
|
869 |
+ |
dnl Enable JIT compiler, if possible. |
870 |
+ |
if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then |
871 |
+ |
JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o" |
872 |
+ |
DEFINES="$DEFINES -DUSE_JIT -DUSE_JIT_FPU" |
873 |
+ |
|
874 |
+ |
if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then |
875 |
+ |
if [[ "x$WANT_MON" = "xyes" ]]; then |
876 |
+ |
DEFINES="$DEFINES -DJIT_DEBUG=1" |
877 |
+ |
else |
878 |
+ |
AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug]) |
879 |
+ |
WANT_JIT_DEBUG=no |
880 |
+ |
fi |
881 |
+ |
fi |
882 |
+ |
|
883 |
+ |
dnl IEEE core is the only FPU emulator to use with the JIT compiler |
884 |
+ |
case $FPE_CORE_TEST_ORDER in |
885 |
+ |
ieee*) ;; |
886 |
+ |
*) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;; |
887 |
+ |
esac |
888 |
+ |
FPE_CORE_TEST_ORDER="ieee" |
889 |
+ |
else |
890 |
+ |
WANT_JIT=no |
891 |
+ |
WANT_JIT_DEBUG=no |
892 |
+ |
JITSRCS="" |
893 |
+ |
fi |
894 |
+ |
|
895 |
|
dnl Utility macro used by next two tests. |
896 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
897 |
|
dnl commands examining object file, |
1041 |
|
FPE_CORE="IEEE fpu core" |
1042 |
|
DEFINES="$DEFINES -DFPU_IEEE" |
1043 |
|
FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp" |
1044 |
+ |
dnl Math functions not mandated by C99 standard |
1045 |
+ |
AC_CHECK_FUNCS(isnanl isinfl) |
1046 |
+ |
dnl Math functions required by C99 standard, but probably not |
1047 |
+ |
dnl implemented everywhere. In that case, we fall back to the |
1048 |
+ |
dnl regular variant for doubles. |
1049 |
+ |
AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl) |
1050 |
+ |
AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl) |
1051 |
+ |
AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl) |
1052 |
+ |
AC_CHECK_FUNCS(floorl ceill) |
1053 |
|
break |
1054 |
|
;; |
1055 |
|
esac |
1079 |
|
|
1080 |
|
dnl Check for certain math functions |
1081 |
|
AC_CHECK_FUNCS(atanh) |
1082 |
< |
AC_CHECK_FUNCS(isnan isinf) dnl C99 |
1024 |
< |
AC_CHECK_FUNCS(isnanl isinfl) dnl IEEE ? |
1082 |
> |
AC_CHECK_FUNCS(isnan isinf finite isnormal signbit) |
1083 |
|
|
1084 |
|
dnl UAE CPU sources for all non-m68k-native architectures. |
1085 |
|
if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then |
1086 |
|
CPUINCLUDES="-I../uae_cpu" |
1087 |
< |
CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS" |
1087 |
> |
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" |
1088 |
|
fi |
1089 |
|
|
1090 |
|
dnl Remove the "-g" option if set for GCC. |
1093 |
|
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1094 |
|
fi |
1095 |
|
|
1096 |
< |
dnl Or if we have -Ofast |
1097 |
< |
if [[ "x$HAVE_OFAST" = "xyes" ]]; then |
1098 |
< |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast" |
1099 |
< |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast" |
1096 |
> |
dnl Or if we have -IPA (MIPSPro compilers) |
1097 |
> |
if [[ "x$HAVE_IPA" = "xyes" ]]; then |
1098 |
> |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1099 |
> |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1100 |
|
CXXFLAGS="-LANG:std $CXXFLAGS" |
1101 |
< |
LDFLAGS="$LDFLAGS -ipa" |
1101 |
> |
LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" |
1102 |
|
fi |
1103 |
|
|
1104 |
|
dnl Generate Makefile. |
1106 |
|
AC_SUBST(SYSSRCS) |
1107 |
|
AC_SUBST(CPUINCLUDES) |
1108 |
|
AC_SUBST(CPUSRCS) |
1109 |
< |
AC_OUTPUT(Makefile) |
1109 |
> |
AC_CONFIG_FILES([Makefile]) |
1110 |
> |
AC_OUTPUT |
1111 |
|
|
1112 |
|
dnl Print summary. |
1113 |
|
echo |
1121 |
|
echo GTK user interface ..................... : $WANT_GTK |
1122 |
|
echo mon debugger support ................... : $WANT_MON |
1123 |
|
echo Running m68k code natively ............. : $WANT_NATIVE_M68K |
1124 |
+ |
echo Use JIT compiler ....................... : $WANT_JIT |
1125 |
+ |
echo JIT debug mode ......................... : $WANT_JIT_DEBUG |
1126 |
|
echo Floating-Point emulation core .......... : $FPE_CORE |
1127 |
|
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS |
1128 |
|
echo Addressing mode ........................ : $ADDRESSING_MODE |