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=no]) |
13 |
< |
AC_ARG_ENABLE(16bit-vidmode, [ --enable-16bit-vidmode enable 16-bit video if possible [default=yes]], [WANT_16BIT_VIDMODE=$enableval], [WANT_16BIT_VIDMODE=yes]) |
12 |
> |
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
13 |
> |
|
14 |
> |
dnl FPU emulation core. |
15 |
> |
AC_ARG_ENABLE(fpe, |
16 |
> |
[ --enable-fpe=which specify which fpu emulator to use [default=opt]], |
17 |
> |
[ case "$enableval" in |
18 |
> |
default) FPE_CORE="default";; dnl fpu_x86.cpp if i386 architecture, fpu_uae.cpp otherwise |
19 |
> |
uae) FPE_CORE="uae";; |
20 |
> |
*) AC_MSG_ERROR([--enable-fpe takes only one of the following values: default, uae]);; |
21 |
> |
esac |
22 |
> |
], |
23 |
> |
[ FPE_CORE="default" |
24 |
> |
]) |
25 |
> |
|
26 |
> |
dnl Addressing modes. |
27 |
|
AC_ARG_ENABLE(addressing, |
28 |
< |
[ --enable-addressing=mode specify the addressing mode to use [default=fastest]], |
28 |
> |
[ --enable-addressing=AM specify the addressing mode to use [default=fastest]], |
29 |
|
[ case "$enableval" in |
30 |
|
real) ADDRESSING_TEST_ORDER="real";; |
31 |
|
direct) ADDRESSING_TEST_ORDER="direct";; |
32 |
|
banks) ADDRESSING_TEST_ORDER="banks";; |
33 |
< |
dnl fastest) ADDRESSING_TEST_ORDER="real direct banks";; gb-- will enable later... |
34 |
< |
fastest) ADDRESSING_TEST_ORDER="direct banks";; |
22 |
< |
*) AC_MSG_ERROR([--enable-mem-addressing takes only one of the following values: fastest, real, direct, banks]);; |
33 |
> |
fastest)ADDRESSING_TEST_ORDER="direct banks";; |
34 |
> |
*) AC_MSG_ERROR([--enable-addressing takes only one of the following values: fastest, real, direct, banks]);; |
35 |
|
esac |
36 |
|
], |
25 |
– |
dnl [ ADDRESSING_TEST_ORDER="real direct banks" gb-- will probably reactivate later |
37 |
|
[ ADDRESSING_TEST_ORDER="direct banks" |
38 |
|
]) |
39 |
+ |
|
40 |
+ |
dnl External packages. |
41 |
|
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
42 |
|
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
43 |
|
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
52 |
|
netbsd*) OS_TYPE=netbsd;; |
53 |
|
freebsd*) OS_TYPE=freebsd;; |
54 |
|
solaris*) OS_TYPE=solaris;; |
55 |
< |
*) OS_TYPE=`echo $target_os | sed -e 's/-/_/'`;; |
55 |
> |
*) OS_TYPE=`echo $target_os | sed -e 's/-/_/' | sed -e 's/\./_/'`;; |
56 |
|
esac |
57 |
|
DEFINES="$DEFINES -DOS_$OS_TYPE" |
58 |
|
|
60 |
|
HAVE_I386=no |
61 |
|
HAVE_M68K=no |
62 |
|
HAVE_SPARC=no |
63 |
+ |
HAVE_POWERPC=no |
64 |
|
case "$target_cpu" in |
65 |
|
i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;; |
66 |
|
m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;; |
67 |
|
sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;; |
68 |
+ |
powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;; |
69 |
|
*) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/'`;; |
70 |
|
esac |
71 |
|
DEFINES="$DEFINES -DCPU_$CPU_TYPE" |
86 |
|
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then |
87 |
|
AC_MSG_RESULT(yes) |
88 |
|
AC_DEFINE(ENABLE_MON) |
89 |
< |
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_8080.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c" |
89 |
> |
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c" |
90 |
|
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" |
91 |
|
AC_CHECK_LIB(readline, readline) |
92 |
|
AC_CHECK_LIB(termcap, tputs) |
127 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
128 |
|
SEMSRC= |
129 |
|
AC_CHECK_FUNCS(sem_init, , [ |
130 |
< |
if [ "x$HAVE_PTHREADS" = "xyes" ]; then |
130 |
> |
if test "x$HAVE_PTHREADS" = "xyes"; then |
131 |
|
SEMSRC=posix_sem.cpp |
132 |
|
fi |
133 |
|
]) |
212 |
|
dnl Checks for library functions. |
213 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
214 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
215 |
+ |
AC_CHECK_FUNCS(sigaction signal) |
216 |
|
|
217 |
|
dnl Select system-dependant source files. |
218 |
|
SERIALSRC=serial_unix.cpp |
220 |
|
SCSISRC=../dummy/scsi_dummy.cpp |
221 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
222 |
|
EXTRASYSSRCS= |
223 |
< |
SUPPORTS_NATIVE_M68K=no |
223 |
> |
CAN_NATIVE_M68K=no |
224 |
|
case "$target_os" in |
225 |
|
linux*) |
226 |
< |
ETHERSRC=Linux/ether_linux.cpp |
211 |
< |
SCSISRC=Linux/scsi_linux.cpp |
226 |
> |
ETHERSRC=ether_unix.cpp |
227 |
|
AUDIOSRC=audio_oss_esd.cpp |
228 |
+ |
SCSISRC=Linux/scsi_linux.cpp |
229 |
|
;; |
230 |
< |
freebsd*3.*) |
230 |
> |
freebsd*) |
231 |
> |
ETHERSRC=ether_unix.cpp |
232 |
|
AUDIOSRC=audio_oss_esd.cpp |
233 |
|
DEFINES="$DEFINES -DBSD_COMP" |
234 |
+ |
CXXFLAGS="$CXXFLAGS -fpermissive" |
235 |
|
dnl Check for the CAM library |
236 |
|
AC_CHECK_LIB(cam, cam_open_btl, HAVE_LIBCAM=yes, HAVE_LIBCAM=no) |
237 |
|
if [[ "x$HAVE_LIBCAM" = "xno" ]]; then |
238 |
|
AC_MSG_WARN([Cannot find libcam for SCSI management, disabling SCSI support.]) |
239 |
|
else |
240 |
|
dnl Check for the sys kernel includes |
241 |
< |
AC_CHECK_HEADER(/sys/cam/cam.h) |
242 |
< |
if [[ "x$ac_cv_header__sys_cam_cam_h" = "xno" ]]; then |
241 |
> |
AC_CHECK_HEADER(camlib.h) |
242 |
> |
if [[ "x$ac_cv_header_camlib_h" = "xno" ]]; then |
243 |
|
dnl In this case I should fix this thing including a "patch" |
244 |
|
dnl to access directly to the functions in the kernel :) --Orlando |
245 |
< |
AC_MSG_WARN([Cannot find kernel includes for CAM library, disabling SCSI support.]) |
245 |
> |
AC_MSG_WARN([Cannot find includes for CAM library, disabling SCSI support.]) |
246 |
|
else |
247 |
|
SCSISRC=FreeBSD/scsi_freebsd.cpp |
230 |
– |
CXXFLAGS="$CXXFLAGS -I/sys" |
231 |
– |
CFLAGS="$CFLAGS -I/sys" |
248 |
|
LIBS="$LIBS -lcam" |
249 |
|
DEFINES="$DEFINES -DCAM" |
250 |
|
fi |
251 |
|
fi |
252 |
|
;; |
237 |
– |
freebsd*) |
238 |
– |
DEFINES="$DEFINES -DBSD_COMP" |
239 |
– |
dnl Check for the SCSI library |
240 |
– |
AC_CHECK_LIB(scsi, scsi_open, HAVE_LIBSCSI=yes, HAVE_LIBSCSI=no) |
241 |
– |
if [[ "x$HAVE_LIBSCSI" = "xno" ]]; then |
242 |
– |
AC_MSG_WARN([Cannot find libscsi for SCSI management, disabling SCSI support.]) |
243 |
– |
else |
244 |
– |
dnl Check for the sys kernel includes |
245 |
– |
AC_CHECK_HEADER(scsi.h sys/scsiio.h) |
246 |
– |
if [[ "x$ac_cv_header_scsi_h" = "xno" ]]; then |
247 |
– |
AC_MSG_WARN([Cannot find includes for the SCSI library, disabling SCSI support.]) |
248 |
– |
else |
249 |
– |
SCSISRC=FreeBSD/scsi_freebsd.cpp |
250 |
– |
LIBS="$LIBS -lscsi" |
251 |
– |
fi |
252 |
– |
fi |
253 |
– |
;; |
253 |
|
netbsd*) |
254 |
< |
SUPPORTS_NATIVE_M68K=yes |
254 |
> |
CAN_NATIVE_M68K=yes |
255 |
|
;; |
256 |
|
solaris*) |
257 |
|
AUDIOSRC=Solaris/audio_solaris.cpp |
258 |
|
DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS" |
259 |
|
;; |
260 |
|
irix*) |
261 |
+ |
AUDIOSRC=Irix/audio_irix.cpp |
262 |
|
EXTRASYSSRCS=Irix/unaligned.c |
263 |
< |
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200" |
264 |
< |
LIBS="$LIBS -lm" |
263 |
> |
dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS" |
264 |
> |
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS" |
265 |
> |
LIBS="$LIBS -laudio" |
266 |
> |
|
267 |
> |
dnl Check if our compiler supports -Ofast (MIPSPro) |
268 |
> |
HAVE_OFAST=no |
269 |
> |
ocflags="$CFLAGS" |
270 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'` |
271 |
> |
AC_MSG_CHECKING(if "-Ofast" works) |
272 |
> |
dnl Do a test compile of an empty function |
273 |
> |
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no)) |
274 |
> |
CFLAGS="$ocflags" |
275 |
> |
|
276 |
|
;; |
277 |
|
esac |
278 |
|
|
279 |
+ |
dnl Use 68k CPU natively? |
280 |
+ |
WANT_NATIVE_M68K=no |
281 |
+ |
if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then |
282 |
+ |
AC_DEFINE(ENABLE_NATIVE_M68K) |
283 |
+ |
WANT_NATIVE_M68K=yes |
284 |
+ |
fi |
285 |
+ |
|
286 |
|
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
287 |
|
dnl Serial, ethernet and audio support needs pthreads |
288 |
|
AC_MSG_WARN([You don't have pthreads, disabling serial, ethernet and audio support.]) |
329 |
|
] |
330 |
|
) |
331 |
|
|
332 |
< |
dnl Check if extended signals are supported. |
333 |
< |
AC_CACHE_CHECK("whether your system supports extended signal handlers", |
334 |
< |
ac_cv_have_extended_signals, [ |
332 |
> |
dnl Check signal handlers need to be reinstalled |
333 |
> |
AC_CACHE_CHECK("whether signal handlers need to be reinstalled", |
334 |
> |
ac_cv_signal_need_reinstall, [ |
335 |
> |
AC_LANG_SAVE |
336 |
> |
AC_LANG_CPLUSPLUS |
337 |
> |
AC_TRY_RUN([ |
338 |
> |
#include <stdlib.h> |
339 |
> |
#ifdef HAVE_UNISTD_H |
340 |
> |
#include <unistd.h> |
341 |
> |
#endif |
342 |
> |
#include <signal.h> |
343 |
> |
static int handled_signal = 0; |
344 |
> |
RETSIGTYPE sigusr1_handler(int) { handled_signal++; } |
345 |
> |
int main(void) { /* returns 0 if signals need not to be reinstalled */ |
346 |
> |
signal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1); |
347 |
> |
exit(handled_signal == 2); |
348 |
> |
} |
349 |
> |
], |
350 |
> |
[ac_cv_signal_need_reinstall=yes], |
351 |
> |
[ac_cv_signal_need_reinstall=no] |
352 |
> |
) |
353 |
> |
AC_LANG_RESTORE |
354 |
> |
] |
355 |
> |
) |
356 |
> |
AC_TRANSLATE_DEFINE(SIGNAL_NEED_REINSTALL, "$ac_cv_signal_need_reinstall") |
357 |
> |
|
358 |
> |
dnl Check if sigaction handlers need to be reinstalled |
359 |
> |
AC_CACHE_CHECK("whether sigaction handlers need to be reinstalled", |
360 |
> |
ac_cv_sigaction_need_reinstall, [ |
361 |
|
AC_LANG_SAVE |
362 |
|
AC_LANG_CPLUSPLUS |
363 |
|
AC_TRY_RUN([ |
364 |
+ |
#include <stdlib.h> |
365 |
+ |
#ifdef HAVE_UNISTD_H |
366 |
|
#include <unistd.h> |
367 |
+ |
#endif |
368 |
|
#include <signal.h> |
369 |
< |
#include <fcntl.h> |
370 |
< |
#include <sys/mman.h> |
371 |
< |
|
372 |
< |
static volatile caddr_t mem = 0; |
373 |
< |
static int zero_fd = -1; |
374 |
< |
|
375 |
< |
static RETSIGTYPE segfault_handler(int, siginfo_t * sip, void *) |
376 |
< |
{ if ((caddr_t)(sip->si_addr) != mem) exit(1); |
377 |
< |
munmap(mem, getpagesize()); close(zero_fd); exit(0); } |
378 |
< |
|
379 |
< |
int main() |
380 |
< |
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
334 |
< |
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
335 |
< |
struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = 0; |
336 |
< |
sigaction(SIGSEGV, &sa, 0); |
337 |
< |
mem[0] = 0; |
338 |
< |
exit(1); // should not be reached |
369 |
> |
static int handled_signal = 0; |
370 |
> |
RETSIGTYPE sigusr1_handler(int) { handled_signal++; } |
371 |
> |
typedef RETSIGTYPE (*signal_handler)(int); |
372 |
> |
static signal_handler mysignal(int sig, signal_handler handler) { |
373 |
> |
struct sigaction old_sa; |
374 |
> |
struct sigaction new_sa; |
375 |
> |
new_sa.sa_handler = handler; |
376 |
> |
return ((sigaction(sig,&new_sa,&old_sa) < 0) ? SIG_IGN : old_sa.sa_handler); |
377 |
> |
} |
378 |
> |
int main(void) { /* returns 0 if signals need not to be reinstalled */ |
379 |
> |
mysignal(SIGUSR1, sigusr1_handler); raise(SIGUSR1); raise(SIGUSR1); |
380 |
> |
exit(handled_signal == 2); |
381 |
|
} |
382 |
|
], |
383 |
+ |
[ac_cv_sigaction_need_reinstall=yes], |
384 |
+ |
[ac_cv_sigaction_need_reinstall=no] |
385 |
+ |
) |
386 |
+ |
AC_LANG_RESTORE |
387 |
+ |
] |
388 |
+ |
) |
389 |
+ |
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall") |
390 |
+ |
|
391 |
+ |
dnl Check if extended signals are supported. |
392 |
+ |
AC_CACHE_CHECK("whether your system supports extended signal handlers", |
393 |
+ |
ac_cv_have_extended_signals, [ |
394 |
+ |
AC_LANG_SAVE |
395 |
+ |
AC_LANG_CPLUSPLUS |
396 |
+ |
AC_TRY_RUN([ |
397 |
+ |
#define HAVE_SIGINFO_T 1 |
398 |
+ |
#define CONFIGURE_TEST |
399 |
+ |
#include "sigsegv.cpp" |
400 |
+ |
], |
401 |
|
[ac_cv_have_extended_signals=yes], |
402 |
|
[ac_cv_have_extended_signals=no] |
403 |
|
) |
408 |
|
|
409 |
|
dnl Otherwise, check for subterfuges. |
410 |
|
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
411 |
< |
case "$target_os" in |
412 |
< |
linux*) |
413 |
< |
if [[ "x$HAVE_I386" = "xyes" ]]; then |
414 |
< |
AC_CACHE_CHECK("whether we then have a subterfuge for your system", |
415 |
< |
ac_cv_have_sigcontext_hack, [ |
416 |
< |
AC_LANG_SAVE |
417 |
< |
AC_LANG_CPLUSPLUS |
418 |
< |
AC_TRY_RUN([ |
419 |
< |
#include <unistd.h> |
420 |
< |
#include <signal.h> |
421 |
< |
#include <fcntl.h> |
422 |
< |
#include <sys/mman.h> |
423 |
< |
|
424 |
< |
static volatile caddr_t mem = 0; |
425 |
< |
static int zero_fd = -1; |
366 |
< |
|
367 |
< |
static RETSIGTYPE segfault_handler(int, struct sigcontext scs) |
368 |
< |
{ if ((caddr_t)(scs.cr2) != mem) exit(1); |
369 |
< |
munmap(mem, getpagesize()); close(zero_fd); exit(0); } |
370 |
< |
|
371 |
< |
int main() |
372 |
< |
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
373 |
< |
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
374 |
< |
struct sigaction sa; sa.sa_flags = 0; |
375 |
< |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
376 |
< |
sigaction(SIGSEGV, &sa, 0); |
377 |
< |
mem[0] = 0; |
378 |
< |
exit(1); // should not be reached |
379 |
< |
} |
380 |
< |
], |
381 |
< |
[ac_cv_have_sigcontext_hack=yes], |
382 |
< |
[ac_cv_have_sigcontext_hack=no] |
383 |
< |
) |
384 |
< |
AC_LANG_RESTORE |
385 |
< |
]) |
386 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
387 |
< |
fi |
388 |
< |
;; |
389 |
< |
esac |
411 |
> |
AC_CACHE_CHECK("whether we then have a subterfuge for your system", |
412 |
> |
ac_cv_have_sigcontext_hack, [ |
413 |
> |
AC_LANG_SAVE |
414 |
> |
AC_LANG_CPLUSPLUS |
415 |
> |
AC_TRY_RUN([ |
416 |
> |
#define HAVE_SIGCONTEXT_SUBTERFUGE 1 |
417 |
> |
#define CONFIGURE_TEST |
418 |
> |
#include "sigsegv.cpp" |
419 |
> |
], |
420 |
> |
[ac_cv_have_sigcontext_hack=yes], |
421 |
> |
[ac_cv_have_sigcontext_hack=no] |
422 |
> |
) |
423 |
> |
AC_LANG_RESTORE |
424 |
> |
]) |
425 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack") |
426 |
|
fi |
427 |
|
|
428 |
|
dnl Can we do Video on SEGV Signals ? |
432 |
|
fi |
433 |
|
|
434 |
|
dnl Determine the addressing mode to use |
435 |
< |
ADDRESSING_MODE="" |
436 |
< |
AC_MSG_CHECKING([for the addressing mode to use]) |
437 |
< |
for am in $ADDRESSING_TEST_ORDER; do |
438 |
< |
case $am in |
439 |
< |
real) |
440 |
< |
dnl Requires ability to mmap Low Memory globals. |
441 |
< |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
442 |
< |
continue |
443 |
< |
fi |
444 |
< |
if [[ "x$ac_cv_c_bigendian" = "xyes" ]]; then |
445 |
< |
dnl Requires only VOSF if 16-bit vidmode enable |
410 |
< |
if [[ "x$WANT_16BIT_VIDMODE" = "xyes" ]]; then |
411 |
< |
if [[ "x$CAN_VOSF" = "xno" ]]; then |
412 |
< |
continue |
413 |
< |
fi |
414 |
< |
else |
415 |
< |
DEFINES="$DEFINES -DDISABLE_16BIT_VIDMODE" |
435 |
> |
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
436 |
> |
ADDRESSING_MODE="real" |
437 |
> |
else |
438 |
> |
ADDRESSING_MODE="" |
439 |
> |
AC_MSG_CHECKING([for the addressing mode to use]) |
440 |
> |
for am in $ADDRESSING_TEST_ORDER; do |
441 |
> |
case $am in |
442 |
> |
real) |
443 |
> |
dnl Requires ability to mmap() Low Memory globals |
444 |
> |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
445 |
> |
continue |
446 |
|
fi |
447 |
< |
else |
418 |
< |
dnl Requires VOSF |
447 |
> |
dnl Requires VOSF screen updates |
448 |
|
if [[ "x$CAN_VOSF" = "xno" ]]; then |
449 |
|
continue |
450 |
|
fi |
451 |
< |
fi |
452 |
< |
dnl Real addressing will probably work |
424 |
< |
ADDRESSING_MODE="real" |
425 |
< |
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
426 |
< |
DEFINES="$DEFINES -DREAL_ADDRESSING" |
427 |
< |
break |
428 |
< |
;; |
429 |
< |
direct) |
430 |
< |
dnl Requires VOSF |
431 |
< |
if [[ "x$CAN_VOSF" = "xyes" ]]; then |
432 |
< |
ADDRESSING_MODE="direct" |
451 |
> |
dnl Real addressing will probably work. |
452 |
> |
ADDRESSING_MODE="real" |
453 |
|
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
454 |
< |
DEFINES="$DEFINES -DDIRECT_ADDRESSING" |
454 |
> |
DEFINES="$DEFINES -DREAL_ADDRESSING" |
455 |
|
break |
456 |
< |
fi |
457 |
< |
;; |
458 |
< |
banks) |
459 |
< |
dnl Default addressing mode |
456 |
> |
;; |
457 |
> |
direct) |
458 |
> |
dnl Requires VOSF screen updates |
459 |
> |
if [[ "x$CAN_VOSF" = "xyes" ]]; then |
460 |
> |
ADDRESSING_MODE="direct" |
461 |
> |
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
462 |
> |
DEFINES="$DEFINES -DDIRECT_ADDRESSING" |
463 |
> |
break |
464 |
> |
fi |
465 |
> |
;; |
466 |
> |
banks) |
467 |
> |
dnl Default addressing mode |
468 |
> |
ADDRESSING_MODE="memory banks" |
469 |
> |
break |
470 |
> |
;; |
471 |
> |
*) |
472 |
> |
AC_MSG_ERROR([Internal configure.in script error for $am addressing mode]) |
473 |
> |
esac |
474 |
> |
done |
475 |
> |
AC_MSG_RESULT($ADDRESSING_MODE) |
476 |
> |
if [[ "x$ADDRESSING_MODE" = "x" ]]; then |
477 |
> |
AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER]) |
478 |
|
ADDRESSING_MODE="memory banks" |
479 |
< |
break |
442 |
< |
;; |
443 |
< |
*) |
444 |
< |
AC_MSG_ERROR([Internal configure.in script error for $am addressing mode]) |
445 |
< |
esac |
446 |
< |
done |
447 |
< |
AC_MSG_RESULT($ADDRESSING_MODE) |
448 |
< |
if [[ "x$ADDRESSING_MODE" = "x" ]]; then |
449 |
< |
AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER]) |
450 |
< |
ADDRESSING_MODE="memory banks" |
479 |
> |
fi |
480 |
|
fi |
481 |
|
|
482 |
< |
dnl Since real and direct addressing modes automatically activate VOSF, |
483 |
< |
dnl I put this test here. |
455 |
< |
if [[ "x$WANT_VOSF" = "xyes" ]]; then |
456 |
< |
if [[ "x$CAN_VOSF" = "xno" ]]; then |
457 |
< |
AC_MSG_WARN([Sorry, your system does not support Video on SEGV signals]) |
458 |
< |
WANT_VOSF=no |
459 |
< |
else |
482 |
> |
dnl Enable VOSF screen updates with this feature is requested and feasible |
483 |
> |
if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then |
484 |
|
AC_DEFINE(ENABLE_VOSF) |
485 |
< |
fi |
485 |
> |
else |
486 |
> |
WANT_VOSF=no |
487 |
|
fi |
488 |
|
|
489 |
|
dnl Check for GAS. |
513 |
|
|
514 |
|
dnl Select appropriate CPU source and REGPARAM define. |
515 |
|
ASM_OPTIMIZATIONS=none |
491 |
– |
WANT_NATIVE_M68K=no |
516 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
517 |
< |
FPUSRCS="../uae_cpu/fpp.cpp" |
518 |
< |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
517 |
> |
FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp" |
518 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then |
519 |
|
dnl i386 CPU |
520 |
|
DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\"" |
521 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
522 |
|
ASM_OPTIMIZATIONS=i386 |
523 |
< |
DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTFLAGS" |
524 |
< |
CPUSRCS="../uae_cpu/compiler.cpp cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
523 |
> |
DEFINES="$DEFINES -DX86_ASSEMBLY -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS" |
524 |
> |
CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s" |
525 |
|
FPUSRCS="../uae_cpu/fpu_x86.cpp" |
526 |
|
fi |
527 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
533 |
|
AC_MSG_RESULT($SPARC_TYPE) |
534 |
|
case "$SPARC_TYPE" in |
535 |
|
SPARC_V8) |
536 |
< |
ASM_OPTIMIZATIONS="SPARC V8 architecture" |
537 |
< |
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTFLAGS" |
536 |
> |
ASM_OPTIMIZATIONS="SPARC V8 architecture" |
537 |
> |
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTIMIZED_FLAGS" |
538 |
|
CFLAGS="$CFLAGS -Wa,-Av8" |
539 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av8" |
540 |
|
;; |
541 |
|
SPARC_V9) |
542 |
< |
ASM_OPTIMIZATIONS="SPARC V9 architecture" |
543 |
< |
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTFLAGS" |
542 |
> |
ASM_OPTIMIZATIONS="SPARC V9 architecture" |
543 |
> |
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTIMIZED_FLAGS" |
544 |
|
CFLAGS="$CFLAGS -Wa,-Av9" |
545 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av9" |
546 |
|
;; |
547 |
|
esac |
548 |
|
;; |
549 |
|
esac |
550 |
< |
elif [[ "x$HAVE_M68K" = "xyes" -a "x$SUPPORTS_NATIVE_M68K" = "xyes" ]]; then |
550 |
> |
elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
551 |
|
dnl Native m68k, no emulation |
552 |
< |
CPUSRCS="" |
553 |
< |
AC_DEFINE(ENABLE_NATIVE_M68K) |
554 |
< |
WANT_NATIVE_M68K=yes |
552 |
> |
CPUINCLUDES="-I../native_cpu" |
553 |
> |
CPUSRCS="asm_support.s" |
554 |
> |
fi |
555 |
> |
|
556 |
> |
dnl Select appropriate FPU source. |
557 |
> |
dnl 1. Optimized X86 assembly core if target is i386 architecture |
558 |
> |
SAVED_DEFINES=$DEFINES |
559 |
> |
if [[ "x$FPE_CORE" = "xdefault" ]]; then |
560 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
561 |
> |
DEFINES="$DEFINES -DFPU_X86" |
562 |
> |
FPE_CORE_STR="i386 optimized core" |
563 |
> |
FPUSRCS="../uae_cpu/fpu/fpu_x86.cpp" |
564 |
> |
else |
565 |
> |
FPE_CORE="uae" |
566 |
> |
fi |
567 |
|
fi |
568 |
|
|
569 |
+ |
dnl 2. JIT-FPU only supports IEEE-based implementation. |
570 |
+ |
if [[ "x$WANT_JIT_FPU" = "xyes" -a "x$FPE_CORE" != "xieee" ]]; then |
571 |
+ |
AC_MSG_WARN([Sorry, JIT-FPU supports only the "ieee" FPE implementation]) |
572 |
+ |
FPE_CORE="ieee" |
573 |
+ |
dnl Restore previous variables. FPE_CORE_STR and FPUSRCS are overwritten |
574 |
+ |
DEFINES=$SAVED_DEFINES |
575 |
+ |
fi |
576 |
+ |
|
577 |
+ |
dnl 3. Choose either IEEE-based implementation or the old UAE core |
578 |
+ |
if [[ "x$FPE_CORE" = "xieee" ]]; then |
579 |
+ |
AC_CHECK_HEADERS(fenv.h) |
580 |
+ |
AC_CHECK_FUNCS(feclearexcept fegetexceptflag feraiseexcept fesetexceptflag fetestexcept) |
581 |
+ |
AC_CHECK_FUNCS(fegetround fesetround) |
582 |
+ |
DEFINES="$DEFINES -DFPU_IEEE" |
583 |
+ |
FPE_CORE_STR="ieee-based fpu core" |
584 |
+ |
FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp" |
585 |
+ |
elif [[ "x$FPE_CORE" = "xuae" ]]; then |
586 |
+ |
DEFINES="$DEFINES -DFPU_UAE" |
587 |
+ |
FPE_CORE_STR="original uae core" |
588 |
+ |
FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp" |
589 |
+ |
fi |
590 |
+ |
|
591 |
+ |
dnl Check for certain math functions |
592 |
+ |
AC_CHECK_FUNCS(atanh) |
593 |
+ |
AC_CHECK_FUNCS(isnan isinf) dnl C99 |
594 |
+ |
AC_CHECK_FUNCS(isnanl isinfl) dnl IEEE ? |
595 |
+ |
|
596 |
|
dnl UAE CPU sources for all non-m68k-native architectures. |
597 |
|
if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then |
598 |
|
CPUINCLUDES="-I../uae_cpu" |
599 |
|
CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS" |
537 |
– |
else |
538 |
– |
CPUINCLUDES="-I../native_cpu" |
539 |
– |
CPUSRCS="asm_support.s" |
600 |
|
fi |
601 |
|
|
602 |
|
dnl Remove the "-g" option if set for GCC. |
603 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
604 |
< |
dnl gb-- Probably not the cleanest way to take |
605 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
606 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
604 |
> |
dnl gb-- Probably not the cleanest way to take |
605 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
606 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
607 |
> |
fi |
608 |
> |
|
609 |
> |
dnl Or if we have -Ofast |
610 |
> |
if [[ "x$HAVE_OFAST" = "xyes" ]]; then |
611 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'` |
612 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/ -g$/ -Ofast/;s/^-g$/-Ofast/'` |
613 |
> |
CXXFLAGS="-LANG:std $CXXFLAGS" |
614 |
> |
LDFLAGS="$LDFLAGS -Ofast" |
615 |
|
fi |
616 |
|
|
617 |
|
dnl Generate Makefile. |
633 |
|
echo GTK user interface ............... : $WANT_GTK |
634 |
|
echo mon debugger support ............. : $WANT_MON |
635 |
|
echo Running m68k code natively ....... : $WANT_NATIVE_M68K |
636 |
+ |
echo Floating-Point emulation core .... : $FPE_CORE_STR |
637 |
|
echo Assembly optimizations ........... : $ASM_OPTIMIZATIONS |
638 |
|
echo Addressing mode .................. : $ADDRESSING_MODE |
639 |
|
echo |