1 |
|
dnl Process this file with autoconf to produce a configure script. |
2 |
|
dnl Written in 2002 by Christian Bauer |
3 |
|
|
4 |
< |
AC_INIT([SheepShaver], 2.2, [Christian.Bauer@uni-mainz.de], SheepShaver) |
4 |
> |
AC_INIT([SheepShaver], 2.3, [Christian.Bauer@uni-mainz.de], SheepShaver) |
5 |
|
AC_CONFIG_SRCDIR(main_unix.cpp) |
6 |
|
AC_PREREQ(2.52) |
7 |
|
AC_CONFIG_HEADER(config.h) |
14 |
|
dnl cores for the configure tests since some are intended to dump core. |
15 |
|
ulimit -c 0 |
16 |
|
|
17 |
+ |
dnl Invite Cygwin users to build within the Windows/ directory |
18 |
+ |
case $target_os in |
19 |
+ |
*cygwin* | *mingw32*) |
20 |
+ |
AC_MSG_ERROR([You can only build the Windows version from its directory, Cygwin/X11 is not supported.]) |
21 |
+ |
;; |
22 |
+ |
esac |
23 |
+ |
|
24 |
|
dnl Options. |
25 |
|
AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes]) |
26 |
|
AC_ARG_ENABLE(ppc-emulator, [ --enable-ppc-emulator use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto]) |
125 |
|
|
126 |
|
dnl Checks for libraries. |
127 |
|
AC_CHECK_LIB(posix4, sem_init) |
128 |
+ |
AC_CHECK_LIB(m, cos) |
129 |
|
|
130 |
|
dnl Do we need SDL? |
131 |
|
WANT_SDL=no |
143 |
|
if [[ "x$WANT_SDL" = "xyes" ]]; then |
144 |
|
AC_PATH_PROG(sdl_config, "sdl-config") |
145 |
|
if [[ -n "$sdl_config" ]]; then |
146 |
< |
case $target_os in |
147 |
< |
# Special treatment for Cygwin so that we can still use the POSIX layer |
148 |
< |
*cygwin*) |
149 |
< |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
150 |
< |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
151 |
< |
;; |
144 |
< |
*) |
145 |
< |
sdl_cflags=`$sdl_config --cflags` |
146 |
< |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
147 |
< |
sdl_libs=`$sdl_config --static-libs` |
148 |
< |
else |
149 |
< |
sdl_libs=`$sdl_config --libs` |
150 |
< |
fi |
151 |
< |
;; |
152 |
< |
esac |
146 |
> |
sdl_cflags=`$sdl_config --cflags` |
147 |
> |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
148 |
> |
sdl_libs=`$sdl_config --static-libs` |
149 |
> |
else |
150 |
> |
sdl_libs=`$sdl_config --libs` |
151 |
> |
fi |
152 |
|
CFLAGS="$CFLAGS $sdl_cflags" |
153 |
|
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
154 |
|
LIBS="$LIBS $sdl_libs" |
184 |
|
AC_CHECK_LIB(pthread, pthread_create, , [ |
185 |
|
AC_CHECK_LIB(c_r, pthread_create, , [ |
186 |
|
AC_CHECK_LIB(PTL, pthread_create, , [ |
187 |
< |
AC_MSG_ERROR([You need pthreads to run Basilisk II.]) |
187 |
> |
dnl XXX remove when no pthreads case is merged |
188 |
> |
AC_MSG_ERROR([You need pthreads to run SheepShaver.]) |
189 |
> |
HAVE_PTHREADS=no |
190 |
|
]) |
191 |
|
]) |
192 |
|
]) |
193 |
|
AC_CHECK_FUNCS(pthread_cancel) |
194 |
+ |
AC_CHECK_FUNCS(pthread_cond_init pthread_testcancel) |
195 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
196 |
|
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
197 |
|
AC_CHECK_FUNCS(pthread_mutexattr_setpshared) |
196 |
– |
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
197 |
– |
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
198 |
– |
fi |
198 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
199 |
|
SEMSRC= |
200 |
|
AC_CHECK_FUNCS(sem_init, , [ |
204 |
|
]) |
205 |
|
;; |
206 |
|
esac |
207 |
+ |
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
208 |
+ |
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
209 |
+ |
fi |
210 |
|
|
211 |
|
dnl We use FBDev DGA if possible. |
212 |
|
if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then |
297 |
|
dnl Checks for header files. |
298 |
|
AC_HEADER_STDC |
299 |
|
AC_HEADER_SYS_WAIT |
300 |
< |
AC_CHECK_HEADERS(malloc.h) |
300 |
> |
AC_CHECK_HEADERS(malloc.h stdint.h) |
301 |
|
AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h) |
300 |
– |
AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h) |
302 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h) |
303 |
< |
AC_CHECK_HEADERS(linux/if.h, [], [], [ |
304 |
< |
#if HAVE_SYS_SOCKET_H |
305 |
< |
# include <sys/socket.h> |
303 |
> |
AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h) |
304 |
> |
AC_CHECK_HEADERS(sys/time.h sys/poll.h sys/select.h arpa/inet.h) |
305 |
> |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [ |
306 |
> |
#ifdef HAVE_SYS_TYPES_H |
307 |
> |
#include <sys/types.h> |
308 |
> |
#endif |
309 |
> |
#ifdef HAVE_SYS_SOCKET_H |
310 |
> |
#include <sys/socket.h> |
311 |
|
#endif |
312 |
|
]) |
313 |
< |
AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h) |
313 |
> |
AC_CHECK_HEADERS(AvailabilityMacros.h) |
314 |
> |
AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h) |
315 |
|
AC_CHECK_HEADERS(fenv.h) |
316 |
|
|
317 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
332 |
|
AC_HEADER_TIME |
333 |
|
AC_STRUCT_TM |
334 |
|
|
335 |
+ |
dnl Check whether sys/socket.h defines type socklen_t. |
336 |
+ |
dnl (extracted from ac-archive/Miscellaneous) |
337 |
+ |
AC_CACHE_CHECK([for socklen_t], |
338 |
+ |
ac_cv_type_socklen_t, [ |
339 |
+ |
AC_TRY_COMPILE([ |
340 |
+ |
#include <sys/types.h> |
341 |
+ |
#include <sys/socket.h> |
342 |
+ |
], [socklen_t len = 42; return 0;], |
343 |
+ |
ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no, |
344 |
+ |
dnl When cross-compiling, do not assume anything. |
345 |
+ |
ac_cv_type_socklen_t="guessing no" |
346 |
+ |
) |
347 |
+ |
]) |
348 |
+ |
if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then |
349 |
+ |
AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.]) |
350 |
+ |
fi |
351 |
+ |
|
352 |
|
dnl Check whether struct sigaction has sa_restorer member. |
353 |
|
AC_CACHE_CHECK([whether struct sigaction has sa_restorer], |
354 |
|
ac_cv_signal_sa_restorer, [ |
365 |
|
fi |
366 |
|
|
367 |
|
dnl Checks for library functions. |
368 |
< |
AC_CHECK_FUNCS(strdup strlcpy cfmakeraw) |
368 |
> |
AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw) |
369 |
|
AC_CHECK_FUNCS(nanosleep) |
370 |
|
AC_CHECK_FUNCS(sigaction signal) |
371 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
372 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
373 |
< |
AC_CHECK_FUNCS(posix_memalign memalign valloc) |
374 |
< |
AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc) |
373 |
> |
AC_CHECK_FUNCS(exp2f log2f exp2 log2) |
374 |
> |
AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc) |
375 |
> |
AC_CHECK_FUNCS(poll inet_aton) |
376 |
|
|
377 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
378 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
453 |
|
dnl Check for some MacOS X frameworks |
454 |
|
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
455 |
|
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
456 |
+ |
AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>]) |
457 |
|
|
458 |
|
dnl Select system-dependant sources. |
459 |
|
SERIALSRC=serial_unix.cpp |
464 |
|
EXTRASYSSRCS= |
465 |
|
case "$target_os" in |
466 |
|
linux*) |
467 |
< |
ETHERSRC=Linux/ether_linux.cpp |
467 |
> |
ETHERSRC=ether_unix.cpp |
468 |
|
AUDIOSRC=audio_oss_esd.cpp |
469 |
|
SCSISRC=Linux/scsi_linux.cpp |
470 |
|
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
471 |
< |
EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S" |
471 |
> |
EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S" |
472 |
|
fi |
473 |
|
;; |
474 |
+ |
freebsd*) |
475 |
+ |
ETHERSRC=ether_unix.cpp |
476 |
+ |
;; |
477 |
|
netbsd*) |
478 |
+ |
ETHERSRC=ether_unix.cpp |
479 |
|
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
480 |
< |
EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S" |
480 |
> |
EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S" |
481 |
|
fi |
482 |
|
;; |
483 |
|
darwin*) |
484 |
+ |
ETHERSRC=ether_unix.cpp |
485 |
|
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
486 |
< |
EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S" |
486 |
> |
EXTRASYSSRCS="paranoia.cpp ppc_asm.S" |
487 |
|
fi |
488 |
< |
if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then |
488 |
> |
if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then |
489 |
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp" |
490 |
|
fi |
491 |
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
492 |
|
EXTFSSRC=../MacOSX/extfs_macosx.mm |
493 |
|
fi |
494 |
|
;; |
495 |
< |
cygwin*) |
496 |
< |
SERIALSRC="../dummy/serial_dummy.cpp" |
495 |
> |
irix*) |
496 |
> |
ETHERSRC=ether_unix.cpp |
497 |
> |
AUDIOSRC=Irix/audio_irix.cpp |
498 |
> |
LIBS="$LIBS -laudio" |
499 |
> |
WANT_ESD=no |
500 |
|
;; |
501 |
|
esac |
502 |
|
|
503 |
+ |
dnl Is the slirp library supported? |
504 |
+ |
if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then |
505 |
+ |
AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported]) |
506 |
+ |
SLIRP_SRCS="\ |
507 |
+ |
../slirp/bootp.c ../slirp/ip_output.c ../slirp/tcp_input.c \ |
508 |
+ |
../slirp/cksum.c ../slirp/mbuf.c ../slirp/tcp_output.c \ |
509 |
+ |
../slirp/debug.c ../slirp/misc.c ../slirp/tcp_subr.c \ |
510 |
+ |
../slirp/if.c ../slirp/sbuf.c ../slirp/tcp_timer.c \ |
511 |
+ |
../slirp/ip_icmp.c ../slirp/slirp.c ../slirp/tftp.c \ |
512 |
+ |
../slirp/ip_input.c ../slirp/socket.c ../slirp/udp.c" |
513 |
+ |
fi |
514 |
+ |
AC_SUBST(SLIRP_SRCS) |
515 |
+ |
|
516 |
|
dnl SDL overrides |
517 |
|
if [[ "x$WANT_SDL" = "xyes" ]]; then |
518 |
|
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.]) |
524 |
|
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
525 |
|
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" |
526 |
|
else |
527 |
< |
case "$target_os" in |
481 |
< |
cygwin*) |
482 |
< |
EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp" |
483 |
< |
;; |
484 |
< |
*) |
485 |
< |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
486 |
< |
;; |
487 |
< |
esac |
527 |
> |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
528 |
|
fi |
529 |
|
else |
530 |
|
VIDEOSRCS="video_x.cpp" |
952 |
|
|
953 |
|
dnl Check addressing mode to use |
954 |
|
AC_MSG_CHECKING([for addressing mode to use]) |
915 |
– |
case "$os_target" in |
916 |
– |
cygwin*) |
917 |
– |
WANT_ADDRESSING_MODE="direct,cygwin-hack" |
918 |
– |
NATMEM_OFFSET= |
919 |
– |
;; |
920 |
– |
esac |
955 |
|
if [[ "$EMULATED_PPC" != "yes" ]]; then |
956 |
|
if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then |
957 |
|
AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.]) |
1033 |
|
fi |
1034 |
|
AC_MSG_RESULT($WANT_ADDRESSING_MODE) |
1035 |
|
|
1036 |
+ |
dnl Utility macro used by next two tests. |
1037 |
+ |
dnl AC_EXAMINE_OBJECT(C source code, |
1038 |
+ |
dnl commands examining object file, |
1039 |
+ |
dnl [commands to run if compile failed]): |
1040 |
+ |
dnl |
1041 |
+ |
dnl Compile the source code to an object file; then convert it into a |
1042 |
+ |
dnl printable representation. All unprintable characters and |
1043 |
+ |
dnl asterisks (*) are replaced by dots (.). All white space is |
1044 |
+ |
dnl deleted. Newlines (ASCII 0x10) in the input are preserved in the |
1045 |
+ |
dnl output, but runs of newlines are compressed to a single newline. |
1046 |
+ |
dnl Finally, line breaks are forcibly inserted so that no line is |
1047 |
+ |
dnl longer than 80 columns and the file ends with a newline. The |
1048 |
+ |
dnl result of all this processing is in the file conftest.dmp, which |
1049 |
+ |
dnl may be examined by the commands in the second argument. |
1050 |
+ |
dnl |
1051 |
+ |
AC_DEFUN([gcc_AC_EXAMINE_OBJECT], |
1052 |
+ |
[AC_LANG_SAVE |
1053 |
+ |
AC_LANG_C |
1054 |
+ |
dnl Next bit cribbed from AC_TRY_COMPILE. |
1055 |
+ |
cat > conftest.$ac_ext <<EOF |
1056 |
+ |
[#line __oline__ "configure" |
1057 |
+ |
#include "confdefs.h" |
1058 |
+ |
$1 |
1059 |
+ |
]EOF |
1060 |
+ |
if AC_TRY_EVAL(ac_compile); then |
1061 |
+ |
od -c conftest.o | |
1062 |
+ |
sed ['s/^[0-7]*[ ]*/ / |
1063 |
+ |
s/\*/./g |
1064 |
+ |
s/ \\n/*/g |
1065 |
+ |
s/ [0-9][0-9][0-9]/./g |
1066 |
+ |
s/ \\[^ ]/./g'] | |
1067 |
+ |
tr -d ' |
1068 |
+ |
' | tr -s '*' ' |
1069 |
+ |
' | fold | sed '$a\ |
1070 |
+ |
' > conftest.dmp |
1071 |
+ |
$2 |
1072 |
+ |
ifelse($3, , , else |
1073 |
+ |
$3 |
1074 |
+ |
)dnl |
1075 |
+ |
fi |
1076 |
+ |
rm -rf conftest* |
1077 |
+ |
AC_LANG_RESTORE]) |
1078 |
+ |
|
1079 |
+ |
dnl Floating point format probe. |
1080 |
+ |
dnl The basic concept is the same as the above: grep the object |
1081 |
+ |
dnl file for an interesting string. We have to watch out for |
1082 |
+ |
dnl rounding changing the values in the object, however; this is |
1083 |
+ |
dnl handled by ignoring the least significant byte of the float. |
1084 |
+ |
dnl |
1085 |
+ |
dnl Does not know about VAX G-float or C4x idiosyncratic format. |
1086 |
+ |
dnl It does know about PDP-10 idiosyncratic format, but this is |
1087 |
+ |
dnl not presently supported by GCC. S/390 "binary floating point" |
1088 |
+ |
dnl is in fact IEEE (but maybe we should have that in EBCDIC as well |
1089 |
+ |
dnl as ASCII?) |
1090 |
+ |
dnl |
1091 |
+ |
AC_DEFUN([gcc_AC_C_FLOAT_FORMAT], |
1092 |
+ |
[AC_CACHE_CHECK(floating point format, ac_cv_c_float_format, |
1093 |
+ |
[gcc_AC_EXAMINE_OBJECT( |
1094 |
+ |
[/* This will not work unless sizeof(double) == 8. */ |
1095 |
+ |
extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1]; |
1096 |
+ |
|
1097 |
+ |
/* This structure must have no internal padding. */ |
1098 |
+ |
struct possibility { |
1099 |
+ |
char prefix[8]; |
1100 |
+ |
double candidate; |
1101 |
+ |
char postfix[8]; |
1102 |
+ |
}; |
1103 |
+ |
|
1104 |
+ |
#define C(cand) { "\nformat:", cand, ":tamrof\n" } |
1105 |
+ |
struct possibility table [] = |
1106 |
+ |
{ |
1107 |
+ |
C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */ |
1108 |
+ |
C( 3.53802595280598432000e+18), /* D__float - VAX */ |
1109 |
+ |
C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */ |
1110 |
+ |
C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */ |
1111 |
+ |
C(-5.22995989424860458374e+10) /* IBMHEXFP - s/390 format, EBCDIC */ |
1112 |
+ |
};], |
1113 |
+ |
[if grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1114 |
+ |
ac_cv_c_float_format='IEEE (big-endian)' |
1115 |
+ |
elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1116 |
+ |
ac_cv_c_float_format='IEEE (big-endian)' |
1117 |
+ |
elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1118 |
+ |
ac_cv_c_float_format='IEEE (little-endian)' |
1119 |
+ |
elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1120 |
+ |
ac_cv_c_float_format='IEEE (little-endian)' |
1121 |
+ |
elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1122 |
+ |
ac_cv_c_float_format='VAX D-float' |
1123 |
+ |
elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1124 |
+ |
ac_cv_c_float_format='PDP-10' |
1125 |
+ |
elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then |
1126 |
+ |
ac_cv_c_float_format='IBM 370 hex' |
1127 |
+ |
else |
1128 |
+ |
AC_MSG_ERROR(Unknown floating point format) |
1129 |
+ |
fi], |
1130 |
+ |
[AC_MSG_ERROR(compile failed)]) |
1131 |
+ |
]) |
1132 |
+ |
# IEEE is the default format. If the float endianness isn't the same |
1133 |
+ |
# as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN |
1134 |
+ |
# (which is a tristate: yes, no, default). This is only an issue with |
1135 |
+ |
# IEEE; the other formats are only supported by a few machines each, |
1136 |
+ |
# all with the same endianness. |
1137 |
+ |
format=IEEE_FLOAT_FORMAT |
1138 |
+ |
fbigend= |
1139 |
+ |
case $ac_cv_c_float_format in |
1140 |
+ |
'IEEE (big-endian)' ) |
1141 |
+ |
if test $ac_cv_c_bigendian = no; then |
1142 |
+ |
fbigend=1 |
1143 |
+ |
fi |
1144 |
+ |
;; |
1145 |
+ |
'IEEE (little-endian)' ) |
1146 |
+ |
if test $ac_cv_c_bigendian = yes; then |
1147 |
+ |
fbigend=0 |
1148 |
+ |
fi |
1149 |
+ |
;; |
1150 |
+ |
'VAX D-float' ) |
1151 |
+ |
format=VAX_FLOAT_FORMAT |
1152 |
+ |
;; |
1153 |
+ |
'PDP-10' ) |
1154 |
+ |
format=PDP10_FLOAT_FORMAT |
1155 |
+ |
;; |
1156 |
+ |
'IBM 370 hex' ) |
1157 |
+ |
format=IBM_FLOAT_FORMAT |
1158 |
+ |
;; |
1159 |
+ |
esac |
1160 |
+ |
AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format, |
1161 |
+ |
[Define to the floating point format of the host machine.]) |
1162 |
+ |
if test -n "$fbigend"; then |
1163 |
+ |
AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend, |
1164 |
+ |
[Define to 1 if the host machine stores floating point numbers in |
1165 |
+ |
memory with the word containing the sign bit at the lowest address, |
1166 |
+ |
or to 0 if it does it the other way around. |
1167 |
+ |
|
1168 |
+ |
This macro should not be defined if the ordering is the same as for |
1169 |
+ |
multi-word integers.]) |
1170 |
+ |
fi |
1171 |
+ |
]) |
1172 |
+ |
|
1173 |
+ |
dnl Check for host float format |
1174 |
+ |
gcc_AC_C_FLOAT_FORMAT |
1175 |
+ |
|
1176 |
|
dnl Platform specific binary postprocessor |
1177 |
|
AC_PATH_PROG(BLESS, "true") |
1178 |
|
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
1183 |
|
dnl Check for GCC 2.7 or higher. |
1184 |
|
HAVE_GCC27=no |
1185 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
1186 |
< |
AC_EGREP_CPP(xyes, |
1187 |
< |
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
1188 |
< |
xyes |
1189 |
< |
#endif |
1190 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
1186 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) |
1187 |
> |
# error gcc < 2.7 |
1188 |
> |
#endif |
1189 |
> |
]])], |
1190 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC27=yes], |
1191 |
> |
[AC_MSG_RESULT(no)]) |
1192 |
|
|
1193 |
|
dnl Check for GCC 3.0 or higher. |
1194 |
|
HAVE_GCC30=no |
1195 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
1196 |
< |
AC_EGREP_CPP(xyes, |
1197 |
< |
[#if __GNUC__ >= 3 |
1198 |
< |
xyes |
1199 |
< |
#endif |
1200 |
< |
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1196 |
> |
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) |
1197 |
> |
# error gcc < 3 |
1198 |
> |
#endif |
1199 |
> |
]])], |
1200 |
> |
[AC_MSG_RESULT(yes); HAVE_GCC30=yes], |
1201 |
> |
[AC_MSG_RESULT(no)]) |
1202 |
|
|
1203 |
|
dnl Check for ICC. |
1204 |
|
AC_MSG_CHECKING(for ICC) |
1229 |
|
rm -rf conftest* |
1230 |
|
]) |
1231 |
|
|
1232 |
+ |
dnl Add -fno-strict-aliasing for slirp sources |
1233 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1234 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1235 |
+ |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
1236 |
+ |
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], |
1237 |
+ |
ac_cv_gcc_no_strict_aliasing, [ |
1238 |
+ |
AC_TRY_COMPILE([],[], |
1239 |
+ |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")], |
1240 |
+ |
[ac_cv_gcc_no_strict_aliasing=no]) |
1241 |
+ |
]) |
1242 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1243 |
+ |
fi |
1244 |
+ |
|
1245 |
+ |
dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X) |
1246 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1247 |
+ |
SAVED_CFLAGS="$CFLAGS" |
1248 |
+ |
CFLAGS="$CFLAGS -mdynamic-no-pic" |
1249 |
+ |
AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic], |
1250 |
+ |
ac_cv_gcc_mdynamic_no_pic, [ |
1251 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no]) |
1252 |
+ |
]) |
1253 |
+ |
if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then |
1254 |
+ |
CXXFLAGS="$CXXFLAGS -mdynamic-no-pic" |
1255 |
+ |
else |
1256 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1257 |
+ |
fi |
1258 |
+ |
fi |
1259 |
+ |
|
1260 |
|
dnl CPU emulator sources |
1261 |
|
if [[ "x$EMULATED_PPC" = "xyes" ]]; then |
1262 |
|
CPUSRCS="\ |
1263 |
|
../kpx_cpu/src/mathlib/ieeefp.cpp \ |
1264 |
+ |
../kpx_cpu/src/mathlib/mathlib.cpp \ |
1265 |
|
../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \ |
1266 |
|
../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \ |
1267 |
|
../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \ |
1285 |
|
powerpc:mach) |
1286 |
|
ac_cv_use_dyngen=yes |
1287 |
|
;; |
1288 |
+ |
i?86:mach) |
1289 |
+ |
ac_cv_use_dyngen=yes |
1290 |
+ |
;; |
1291 |
|
*:*) |
1292 |
|
ac_cv_use_dyngen=no |
1293 |
|
;; |
1305 |
|
done |
1306 |
|
fi |
1307 |
|
fi |
1308 |
< |
if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then |
1308 |
> |
if [[ -z "$DYNGEN_CC" ]]; then |
1309 |
|
ac_cv_use_dyngen=no |
1310 |
|
fi |
1311 |
|
]) |
1325 |
|
else |
1326 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" |
1327 |
|
fi |
1328 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0" |
1328 |
> |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0" |
1329 |
|
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1330 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls" |
1331 |
|
fi |