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 Aliases for PACKAGE and VERSION macros. |
10 |
> |
AC_DEFINE(PACKAGE, PACKAGE_NAME, [Alias to PACKAGE for i18n.]) |
11 |
> |
AC_DEFINE(VERSION, PACKAGE_VERSION, [Alias to VERSION for i18n.]) |
12 |
> |
|
13 |
> |
dnl Video options. |
14 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
15 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
16 |
|
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]) |
17 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
18 |
|
|
19 |
+ |
dnl JIT compiler options. |
20 |
+ |
AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no]) |
21 |
+ |
AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no]) |
22 |
+ |
|
23 |
|
dnl FPU emulation core. |
24 |
|
AC_ARG_ENABLE(fpe, |
25 |
|
[ --enable-fpe=FPE specify which fpu emulator to use [default=auto]], |
74 |
|
HAVE_M68K=no |
75 |
|
HAVE_SPARC=no |
76 |
|
HAVE_POWERPC=no |
77 |
+ |
HAVE_X86_64=no |
78 |
|
case "$target_cpu" in |
79 |
< |
i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;; |
80 |
< |
m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;; |
81 |
< |
sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;; |
82 |
< |
powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;; |
83 |
< |
*) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;; |
79 |
> |
i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;; |
80 |
> |
m68k* ) HAVE_M68K=yes;; |
81 |
> |
sparc* ) HAVE_SPARC=yes;; |
82 |
> |
powerpc* ) HAVE_POWERPC=yes;; |
83 |
> |
x86_64* ) HAVE_X86_64=yes;; |
84 |
|
esac |
75 |
– |
DEFINES="$DEFINES -DCPU_$CPU_TYPE" |
85 |
|
|
86 |
|
dnl Checks for programs. |
87 |
|
AC_PROG_CC |
108 |
|
AC_CHECK_LIB(Hcurses, tgetent, , |
109 |
|
AC_CHECK_LIB(curses, tgetent)))))) |
110 |
|
AC_CHECK_LIB(readline, readline) |
102 |
– |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
111 |
|
else |
112 |
|
AC_MSG_RESULT(no) |
113 |
|
AC_MSG_WARN([Could not find mon, ignoring --with-mon.]) |
143 |
|
AC_CHECK_FUNCS(pthread_cancel) |
144 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
145 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
146 |
+ |
AC_CHECK_FUNCS(pthread_mutexattr_setpshared) |
147 |
|
|
148 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
149 |
|
SEMSRC= |
190 |
|
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
191 |
|
LIBS="$LIBS $GTK_LIBS" |
192 |
|
UISRCS=prefs_editor_gtk.cpp |
193 |
+ |
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
194 |
+ |
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
195 |
+ |
dnl includes <libintl.h> |
196 |
+ |
AM_GNU_GETTEXT |
197 |
|
B2_PATH_GNOMEUI([ |
198 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
199 |
|
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
224 |
|
dnl Checks for header files. |
225 |
|
AC_HEADER_STDC |
226 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
227 |
+ |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
228 |
|
|
229 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
230 |
|
AC_C_BIGENDIAN |
369 |
|
LIBS="$LIBS -laudio" |
370 |
|
WANT_ESD=no |
371 |
|
|
372 |
< |
dnl Check if our compiler supports -Ofast (MIPSPro) |
373 |
< |
HAVE_OFAST=no |
372 |
> |
dnl Check if our compiler supports -IPA (MIPSPro) |
373 |
> |
HAVE_IPA=no |
374 |
|
ocflags="$CFLAGS" |
375 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'` |
376 |
< |
AC_MSG_CHECKING(if "-Ofast" works) |
375 |
> |
CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"` |
376 |
> |
AC_MSG_CHECKING(if "-IPA" works) |
377 |
|
dnl Do a test compile of an empty function |
378 |
< |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no)) |
378 |
> |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
379 |
|
CFLAGS="$ocflags" |
380 |
|
|
381 |
|
;; |
562 |
|
AC_TRY_RUN([ |
563 |
|
#include "vm_alloc.cpp" |
564 |
|
int main(void) { /* returns 0 if we could map the lowmem globals */ |
565 |
< |
volatile char * lm; |
565 |
> |
volatile char * lm = 0; |
566 |
|
if (vm_init() < 0) exit(1); |
567 |
< |
if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1); |
567 |
> |
if (vm_acquire_fixed(0, 0x2000) < 0) exit(1); |
568 |
|
lm[0] = 'z'; |
569 |
|
if (vm_release((char *)lm, 0x2000) < 0) exit(1); |
570 |
|
vm_exit(); exit(0); |
753 |
|
fi |
754 |
|
fi |
755 |
|
|
756 |
+ |
dnl Banked Memory Addressing mode is not supported by the JIT compiler |
757 |
+ |
if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then |
758 |
+ |
AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least]) |
759 |
+ |
fi |
760 |
+ |
|
761 |
|
dnl Enable VOSF screen updates with this feature is requested and feasible |
762 |
|
if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then |
763 |
|
AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.]) |
778 |
|
dnl Check for GCC 2.7 or higher. |
779 |
|
HAVE_GCC27=no |
780 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
781 |
< |
AC_EGREP_CPP(yes, |
781 |
> |
AC_EGREP_CPP(xyes, |
782 |
|
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
783 |
< |
yes |
783 |
> |
xyes |
784 |
|
#endif |
785 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
786 |
|
|
787 |
|
dnl Check for GCC 3.0 or higher. |
788 |
|
HAVE_GCC30=no |
789 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
790 |
< |
AC_EGREP_CPP(yes, |
790 |
> |
AC_EGREP_CPP(xyes, |
791 |
|
[#if __GNUC__ >= 3 |
792 |
< |
yes |
792 |
> |
xyes |
793 |
|
#endif |
794 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
795 |
|
|
823 |
|
dnl Select appropriate CPU source and REGPARAM define. |
824 |
|
ASM_OPTIMIZATIONS=none |
825 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
826 |
< |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then |
826 |
> |
|
827 |
> |
dnl (gb) JITSRCS will be emptied later if the JIT is not available |
828 |
> |
dnl Other platforms should define their own set of noflags file variants |
829 |
> |
CAN_JIT=no |
830 |
> |
JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp" |
831 |
> |
|
832 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
833 |
|
dnl i386 CPU |
834 |
< |
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
834 |
> |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\"" |
835 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
836 |
|
ASM_OPTIMIZATIONS=i386 |
837 |
< |
DEFINES="$DEFINES -DX86_ASSEMBLY -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS" |
838 |
< |
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
837 |
> |
DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE" |
838 |
> |
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" |
839 |
> |
CAN_JIT=yes |
840 |
> |
fi |
841 |
> |
elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then |
842 |
> |
dnl x86-64 CPU |
843 |
> |
DEFINES="$DEFINES -DUNALIGNED_PROFITABLE" |
844 |
> |
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
845 |
> |
ASM_OPTIMIZATIONS="x86-64" |
846 |
> |
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
847 |
|
fi |
848 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
849 |
|
dnl SPARC CPU |
874 |
|
CPUSRCS="asm_support.s" |
875 |
|
fi |
876 |
|
|
877 |
+ |
dnl Enable JIT compiler, if possible. |
878 |
+ |
if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then |
879 |
+ |
JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o" |
880 |
+ |
DEFINES="$DEFINES -DUSE_JIT -DUSE_JIT_FPU" |
881 |
+ |
|
882 |
+ |
if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then |
883 |
+ |
if [[ "x$WANT_MON" = "xyes" ]]; then |
884 |
+ |
DEFINES="$DEFINES -DJIT_DEBUG=1" |
885 |
+ |
else |
886 |
+ |
AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug]) |
887 |
+ |
WANT_JIT_DEBUG=no |
888 |
+ |
fi |
889 |
+ |
fi |
890 |
+ |
|
891 |
+ |
dnl IEEE core is the only FPU emulator to use with the JIT compiler |
892 |
+ |
case $FPE_CORE_TEST_ORDER in |
893 |
+ |
ieee*) ;; |
894 |
+ |
*) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;; |
895 |
+ |
esac |
896 |
+ |
FPE_CORE_TEST_ORDER="ieee" |
897 |
+ |
else |
898 |
+ |
WANT_JIT=no |
899 |
+ |
WANT_JIT_DEBUG=no |
900 |
+ |
JITSRCS="" |
901 |
+ |
fi |
902 |
+ |
|
903 |
|
dnl Utility macro used by next two tests. |
904 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
905 |
|
dnl commands examining object file, |
1044 |
|
for fpe in $FPE_CORE_TEST_ORDER; do |
1045 |
|
case $fpe in |
1046 |
|
ieee) |
1047 |
< |
if echo "$ac_cv_c_float_format" | grep -q IEEE; then |
1047 |
> |
case $ac_cv_c_float_format in |
1048 |
> |
IEEE*) |
1049 |
|
FPE_CORE="IEEE fpu core" |
1050 |
|
DEFINES="$DEFINES -DFPU_IEEE" |
1051 |
|
FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp" |
1052 |
+ |
dnl Math functions not mandated by C99 standard |
1053 |
+ |
AC_CHECK_FUNCS(isnanl isinfl) |
1054 |
+ |
dnl Math functions required by C99 standard, but probably not |
1055 |
+ |
dnl implemented everywhere. In that case, we fall back to the |
1056 |
+ |
dnl regular variant for doubles. |
1057 |
+ |
AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl) |
1058 |
+ |
AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl) |
1059 |
+ |
AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl) |
1060 |
+ |
AC_CHECK_FUNCS(floorl ceill) |
1061 |
|
break |
1062 |
< |
fi |
1062 |
> |
;; |
1063 |
> |
esac |
1064 |
|
;; |
1065 |
|
x86) |
1066 |
|
if [[ ":$HAVE_GCC27:$HAVE_I386:$HAVE_GAS:" = ":yes:yes:yes:" ]]; then |
1087 |
|
|
1088 |
|
dnl Check for certain math functions |
1089 |
|
AC_CHECK_FUNCS(atanh) |
1090 |
< |
AC_CHECK_FUNCS(isnan isinf) dnl C99 |
1021 |
< |
AC_CHECK_FUNCS(isnanl isinfl) dnl IEEE ? |
1090 |
> |
AC_CHECK_FUNCS(isnan isinf finite isnormal signbit) |
1091 |
|
|
1092 |
|
dnl UAE CPU sources for all non-m68k-native architectures. |
1093 |
|
if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then |
1094 |
|
CPUINCLUDES="-I../uae_cpu" |
1095 |
< |
CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS" |
1095 |
> |
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" |
1096 |
|
fi |
1097 |
|
|
1098 |
|
dnl Remove the "-g" option if set for GCC. |
1101 |
|
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1102 |
|
fi |
1103 |
|
|
1104 |
< |
dnl Or if we have -Ofast |
1105 |
< |
if [[ "x$HAVE_OFAST" = "xyes" ]]; then |
1106 |
< |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast" |
1107 |
< |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast" |
1104 |
> |
dnl Or if we have -IPA (MIPSPro compilers) |
1105 |
> |
if [[ "x$HAVE_IPA" = "xyes" ]]; then |
1106 |
> |
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1107 |
> |
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" |
1108 |
|
CXXFLAGS="-LANG:std $CXXFLAGS" |
1109 |
< |
LDFLAGS="$LDFLAGS -ipa" |
1109 |
> |
LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" |
1110 |
|
fi |
1111 |
|
|
1112 |
|
dnl Generate Makefile. |
1114 |
|
AC_SUBST(SYSSRCS) |
1115 |
|
AC_SUBST(CPUINCLUDES) |
1116 |
|
AC_SUBST(CPUSRCS) |
1117 |
< |
AC_OUTPUT(Makefile) |
1117 |
> |
AC_CONFIG_FILES([Makefile]) |
1118 |
> |
AC_OUTPUT |
1119 |
|
|
1120 |
|
dnl Print summary. |
1121 |
|
echo |
1129 |
|
echo GTK user interface ..................... : $WANT_GTK |
1130 |
|
echo mon debugger support ................... : $WANT_MON |
1131 |
|
echo Running m68k code natively ............. : $WANT_NATIVE_M68K |
1132 |
+ |
echo Use JIT compiler ....................... : $WANT_JIT |
1133 |
+ |
echo JIT debug mode ......................... : $WANT_JIT_DEBUG |
1134 |
|
echo Floating-Point emulation core .......... : $FPE_CORE |
1135 |
|
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS |
1136 |
|
echo Addressing mode ........................ : $ADDRESSING_MODE |