17 |
|
dnl Options. |
18 |
|
AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes]) |
19 |
|
AC_ARG_ENABLE(ppc-emulator, [ --enable-ppc-emulator use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto]) |
20 |
+ |
AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb0 [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes]) |
21 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
22 |
< |
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no]) |
22 |
> |
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
23 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
24 |
|
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
25 |
|
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], |
185 |
|
AC_CHECK_LIB(pthread, pthread_create, , [ |
186 |
|
AC_CHECK_LIB(c_r, pthread_create, , [ |
187 |
|
AC_CHECK_LIB(PTL, pthread_create, , [ |
188 |
< |
AC_MSG_ERROR([You need pthreads to run Basilisk II.]) |
188 |
> |
dnl XXX remove when no pthreads case is merged |
189 |
> |
AC_MSG_ERROR([You need pthreads to run SheepShaver.]) |
190 |
> |
HAVE_PTHREADS=no |
191 |
|
]) |
192 |
|
]) |
193 |
|
]) |
194 |
|
AC_CHECK_FUNCS(pthread_cancel) |
195 |
+ |
AC_CHECK_FUNCS(pthread_cond_init) |
196 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
197 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
198 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setpshared) |
195 |
– |
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
196 |
– |
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
197 |
– |
fi |
199 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
200 |
|
SEMSRC= |
201 |
|
AC_CHECK_FUNCS(sem_init, , [ |
205 |
|
]) |
206 |
|
;; |
207 |
|
esac |
208 |
+ |
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
209 |
+ |
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
210 |
+ |
fi |
211 |
+ |
|
212 |
+ |
dnl We use FBDev DGA if possible. |
213 |
+ |
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
214 |
+ |
AC_CHECK_HEADER(linux/fb.h, [ |
215 |
+ |
AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.]) |
216 |
+ |
], [ |
217 |
+ |
AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.]) |
218 |
+ |
WANT_FBDEV_DGA=no |
219 |
+ |
]) |
220 |
+ |
fi |
221 |
|
|
222 |
|
dnl We use XFree86 DGA if possible. |
223 |
|
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then |
298 |
|
dnl Checks for header files. |
299 |
|
AC_HEADER_STDC |
300 |
|
AC_HEADER_SYS_WAIT |
301 |
< |
AC_CHECK_HEADERS(malloc.h) |
301 |
> |
AC_CHECK_HEADERS(malloc.h stdint.h) |
302 |
|
AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h) |
303 |
|
AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h) |
304 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h) |
349 |
|
AC_CHECK_FUNCS(sigaction signal) |
350 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
351 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
352 |
< |
AC_CHECK_FUNCS(posix_memalign memalign valloc) |
353 |
< |
AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc) |
352 |
> |
AC_CHECK_FUNCS(exp2f log2f exp2 log2) |
353 |
> |
AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc) |
354 |
|
|
355 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
356 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
1002 |
|
fi |
1003 |
|
AC_MSG_RESULT($WANT_ADDRESSING_MODE) |
1004 |
|
|
1005 |
+ |
dnl Utility macro used by next two tests. |
1006 |
+ |
dnl AC_EXAMINE_OBJECT(C source code, |
1007 |
+ |
dnl commands examining object file, |
1008 |
+ |
dnl [commands to run if compile failed]): |
1009 |
+ |
dnl |
1010 |
+ |
dnl Compile the source code to an object file; then convert it into a |
1011 |
+ |
dnl printable representation. All unprintable characters and |
1012 |
+ |
dnl asterisks (*) are replaced by dots (.). All white space is |
1013 |
+ |
dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the |
1014 |
+ |
dnl output, but runs of newlines are compressed to a single newline. |
1015 |
+ |
dnl Finally, line breaks are forcibly inserted so that no line is |
1016 |
+ |
dnl longer than 80 columns and the file ends with a newline. The |
1017 |
+ |
dnl result of all this processing is in the file conftest.dmp, which |
1018 |
+ |
dnl may be examined by the commands in the second argument. |
1019 |
+ |
dnl |
1020 |
+ |
AC_DEFUN([gcc_AC_EXAMINE_OBJECT], |
1021 |
+ |
[AC_LANG_SAVE |
1022 |
+ |
AC_LANG_C |
1023 |
+ |
dnl Next bit cribbed from AC_TRY_COMPILE. |
1024 |
+ |
cat > conftest.$ac_ext <<EOF |
1025 |
+ |
[#line __oline__ "configure" |
1026 |
+ |
#include "confdefs.h" |
1027 |
+ |
$1 |
1028 |
+ |
]EOF |
1029 |
+ |
if AC_TRY_EVAL(ac_compile); then |
1030 |
+ |
od -c conftest.o | |
1031 |
+ |
sed ['s/^[0-7]*[ ]*/ / |
1032 |
+ |
s/\*/./g |
1033 |
+ |
s/ \\n/*/g |
1034 |
+ |
s/ [0-9][0-9][0-9]/./g |
1035 |
+ |
s/ \\[^ ]/./g'] | |
1036 |
+ |
tr -d ' |
1037 |
+ |
' | tr -s '*' ' |
1038 |
+ |
' | fold | sed '$a\ |
1039 |
+ |
' > conftest.dmp |
1040 |
+ |
$2 |
1041 |
+ |
ifelse($3, , , else |
1042 |
+ |
$3 |
1043 |
+ |
)dnl |
1044 |
+ |
fi |
1045 |
+ |
rm -rf conftest* |
1046 |
+ |
AC_LANG_RESTORE]) |
1047 |
+ |
|
1048 |
+ |
dnl Floating point format probe. |
1049 |
+ |
dnl The basic concept is the same as the above: grep the object |
1050 |
+ |
dnl file for an interesting string. We have to watch out for |
1051 |
+ |
dnl rounding changing the values in the object, however; this is |
1052 |
+ |
dnl handled by ignoring the least significant byte of the float. |
1053 |
+ |
dnl |
1054 |
+ |
dnl Does not know about VAX G-float or C4x idiosyncratic format. |
1055 |
+ |
dnl It does know about PDP-10 idiosyncratic format, but this is |
1056 |
+ |
dnl not presently supported by GCC. S/390 "binary floating point" |
1057 |
+ |
dnl is in fact IEEE (but maybe we should have that in EBCDIC as well |
1058 |
+ |
dnl as ASCII?) |
1059 |
+ |
dnl |
1060 |
+ |
AC_DEFUN([gcc_AC_C_FLOAT_FORMAT], |
1061 |
+ |
[AC_CACHE_CHECK(floating point format, ac_cv_c_float_format, |
1062 |
+ |
[gcc_AC_EXAMINE_OBJECT( |
1063 |
+ |
[/* This will not work unless sizeof(double) == 8. */ |
1064 |
+ |
extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1]; |
1065 |
+ |
|
1066 |
+ |
/* This structure must have no internal padding. */ |
1067 |
+ |
struct possibility { |
1068 |
+ |
char prefix[8]; |
1069 |
+ |
double candidate; |
1070 |
+ |
char postfix[8]; |
1071 |
+ |
}; |
1072 |
+ |
|
1073 |
+ |
#define C(cand) { "\nformat:", cand, ":tamrof\n" } |
1074 |
+ |
struct possibility table [] = |
1075 |
+ |
{ |
1076 |
+ |
C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */ |
1077 |
+ |
C( 3.53802595280598432000e+18), /* D__float - VAX */ |
1078 |
+ |
C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */ |
1079 |
+ |
C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */ |
1080 |
+ |
C(-5.22995989424860458374e+10) /* IBMHEXFP - s/390 format, EBCDIC */ |
1081 |
+ |
};], |
1082 |
+ |
[if grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1083 |
+ |
ac_cv_c_float_format='IEEE (big-endian)' |
1084 |
+ |
elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1085 |
+ |
ac_cv_c_float_format='IEEE (big-endian)' |
1086 |
+ |
elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1087 |
+ |
ac_cv_c_float_format='IEEE (little-endian)' |
1088 |
+ |
elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1089 |
+ |
ac_cv_c_float_format='IEEE (little-endian)' |
1090 |
+ |
elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1091 |
+ |
ac_cv_c_float_format='VAX D-float' |
1092 |
+ |
elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1093 |
+ |
ac_cv_c_float_format='PDP-10' |
1094 |
+ |
elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1095 |
+ |
ac_cv_c_float_format='IBM 370 hex' |
1096 |
+ |
else |
1097 |
+ |
AC_MSG_ERROR(Unknown floating point format) |
1098 |
+ |
fi], |
1099 |
+ |
[AC_MSG_ERROR(compile failed)]) |
1100 |
+ |
]) |
1101 |
+ |
# IEEE is the default format. If the float endianness isn't the same |
1102 |
+ |
# as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN |
1103 |
+ |
# (which is a tristate: yes, no, default). This is only an issue with |
1104 |
+ |
# IEEE; the other formats are only supported by a few machines each, |
1105 |
+ |
# all with the same endianness. |
1106 |
+ |
format=IEEE_FLOAT_FORMAT |
1107 |
+ |
fbigend= |
1108 |
+ |
case $ac_cv_c_float_format in |
1109 |
+ |
'IEEE (big-endian)' ) |
1110 |
+ |
if test $ac_cv_c_bigendian = no; then |
1111 |
+ |
fbigend=1 |
1112 |
+ |
fi |
1113 |
+ |
;; |
1114 |
+ |
'IEEE (little-endian)' ) |
1115 |
+ |
if test $ac_cv_c_bigendian = yes; then |
1116 |
+ |
fbigend=0 |
1117 |
+ |
fi |
1118 |
+ |
;; |
1119 |
+ |
'VAX D-float' ) |
1120 |
+ |
format=VAX_FLOAT_FORMAT |
1121 |
+ |
;; |
1122 |
+ |
'PDP-10' ) |
1123 |
+ |
format=PDP10_FLOAT_FORMAT |
1124 |
+ |
;; |
1125 |
+ |
'IBM 370 hex' ) |
1126 |
+ |
format=IBM_FLOAT_FORMAT |
1127 |
+ |
;; |
1128 |
+ |
esac |
1129 |
+ |
AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format, |
1130 |
+ |
[Define to the floating point format of the host machine.]) |
1131 |
+ |
if test -n "$fbigend"; then |
1132 |
+ |
AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend, |
1133 |
+ |
[Define to 1 if the host machine stores floating point numbers in |
1134 |
+ |
memory with the word containing the sign bit at the lowest address, |
1135 |
+ |
or to 0 if it does it the other way around. |
1136 |
+ |
|
1137 |
+ |
This macro should not be defined if the ordering is the same as for |
1138 |
+ |
multi-word integers.]) |
1139 |
+ |
fi |
1140 |
+ |
]) |
1141 |
+ |
|
1142 |
+ |
dnl Check for host float format |
1143 |
+ |
gcc_AC_C_FLOAT_FORMAT |
1144 |
+ |
|
1145 |
|
dnl Platform specific binary postprocessor |
1146 |
|
AC_PATH_PROG(BLESS, "true") |
1147 |
|
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
1176 |
|
AC_MSG_RESULT($HAVE_ICC) |
1177 |
|
|
1178 |
|
dnl Determine the generated object format |
1179 |
< |
AC_CACHE_CHECK([whether the compiler can generate ELF objects], |
1179 |
> |
AC_CACHE_CHECK([the format of compiler generated objects], |
1180 |
|
ac_cv_object_format, [ |
1181 |
|
echo 'int i;' > conftest.$ac_ext |
1182 |
|
ac_cv_object_format=no |
1185 |
|
*"ELF"*) |
1186 |
|
ac_cv_object_format=elf |
1187 |
|
;; |
1188 |
+ |
*"Mach-O"*) |
1189 |
+ |
ac_cv_object_format=mach |
1190 |
+ |
;; |
1191 |
|
*) |
1192 |
|
ac_cv_object_format=unknown |
1193 |
|
;; |
1196 |
|
rm -rf conftest* |
1197 |
|
]) |
1198 |
|
|
1199 |
+ |
dnl Add -mdynamic-no-pic for MacOS X |
1200 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1201 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1202 |
+ |
CFLAGS="$CFLAGS -mdynamic-no-pic" |
1203 |
+ |
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic], |
1204 |
+ |
ac_cv_gcc_mdynamic_no_pic, [ |
1205 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no]) |
1206 |
+ |
]) |
1207 |
+ |
if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then |
1208 |
+ |
CXXFLAGS="$CXXFLAGS -mdynamic-no-pic" |
1209 |
+ |
else |
1210 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1211 |
+ |
fi |
1212 |
+ |
fi |
1213 |
+ |
|
1214 |
|
dnl CPU emulator sources |
1215 |
|
if [[ "x$EMULATED_PPC" = "xyes" ]]; then |
1216 |
|
CPUSRCS="\ |
1217 |
|
../kpx_cpu/src/mathlib/ieeefp.cpp \ |
1218 |
+ |
../kpx_cpu/src/mathlib/mathlib.cpp \ |
1219 |
|
../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \ |
1220 |
|
../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \ |
1221 |
|
../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \ |
1236 |
|
i?86:elf) |
1237 |
|
ac_cv_use_dyngen=yes |
1238 |
|
;; |
1239 |
+ |
powerpc:mach) |
1240 |
+ |
ac_cv_use_dyngen=yes |
1241 |
+ |
;; |
1242 |
|
*:*) |
1243 |
|
ac_cv_use_dyngen=no |
1244 |
|
;; |
1256 |
|
done |
1257 |
|
fi |
1258 |
|
fi |
1259 |
< |
if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then |
1259 |
> |
if [[ -z "$DYNGEN_CC" ]]; then |
1260 |
|
ac_cv_use_dyngen=no |
1261 |
|
fi |
1262 |
|
]) |
1264 |
|
case $host_cpu in |
1265 |
|
i?86) |
1266 |
|
DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2" |
1267 |
< |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1268 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0" |
1269 |
< |
else |
1270 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" |
1267 |
> |
;; |
1268 |
> |
powerpc) |
1269 |
> |
if [[ "x$ac_cv_object_format" = "xmach" ]]; then |
1270 |
> |
DYNGEN_OP_FLAGS="-mdynamic-no-pic" |
1271 |
|
fi |
1272 |
|
;; |
1273 |
|
esac |
1274 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0" |
1274 |
> |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1275 |
> |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0" |
1276 |
> |
else |
1277 |
> |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" |
1278 |
> |
fi |
1279 |
> |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0" |
1280 |
|
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1281 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls" |
1282 |
|
fi |
1302 |
|
AC_CACHE_CHECK([whether static data regions are executable], |
1303 |
|
ac_cv_have_static_data_exec, [ |
1304 |
|
AC_TRY_RUN([int main(void) { |
1305 |
< |
#if defined(__powerpc__) |
1305 |
> |
#if defined(__powerpc__) || defined(__ppc__) |
1306 |
|
static unsigned int p[8] = {0x4e800020,}; |
1307 |
|
asm volatile("dcbst 0,%0" : : "r" (p) : "memory"); |
1308 |
|
asm volatile("sync" : : : "memory"); |
1348 |
|
echo SheepShaver configuration summary: |
1349 |
|
echo |
1350 |
|
echo SDL support ...................... : $SDL_SUPPORT |
1351 |
+ |
echo FBDev DGA support ................ : $WANT_FBDEV_DGA |
1352 |
|
echo XFree86 DGA support .............. : $WANT_XF86_DGA |
1353 |
|
echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE |
1354 |
|
echo Using PowerPC emulator ........... : $EMULATED_PPC |