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]) |
12 |
> |
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=no]], [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]) |
14 |
|
AC_ARG_ENABLE(addressing, |
15 |
|
[ --enable-addressing=mode specify the addressing mode to use [default=fastest]], |
39 |
|
netbsd*) OS_TYPE=netbsd;; |
40 |
|
freebsd*) OS_TYPE=freebsd;; |
41 |
|
solaris*) OS_TYPE=solaris;; |
42 |
< |
*) OS_TYPE=`echo $target_os | sed -e 's/-/_/'`;; |
42 |
> |
*) OS_TYPE=`echo $target_os | sed -e 's/-/_/' | sed -e 's/\./_/'`;; |
43 |
|
esac |
44 |
|
DEFINES="$DEFINES -DOS_$OS_TYPE" |
45 |
|
|
71 |
|
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then |
72 |
|
AC_MSG_RESULT(yes) |
73 |
|
AC_DEFINE(ENABLE_MON) |
74 |
< |
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" |
74 |
> |
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" |
75 |
|
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" |
76 |
|
AC_CHECK_LIB(readline, readline) |
77 |
|
AC_CHECK_LIB(termcap, tputs) |
112 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
113 |
|
SEMSRC= |
114 |
|
AC_CHECK_FUNCS(sem_init, , [ |
115 |
< |
if [ "x$HAVE_PTHREADS" = "xyes" ]; then |
115 |
> |
if test "x$HAVE_PTHREADS" = "xyes"; then |
116 |
|
SEMSRC=posix_sem.cpp |
117 |
|
fi |
118 |
|
]) |
204 |
|
SCSISRC=../dummy/scsi_dummy.cpp |
205 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
206 |
|
EXTRASYSSRCS= |
207 |
< |
SUPPORTS_NATIVE_M68K=no |
207 |
> |
CAN_NATIVE_M68K=no |
208 |
|
case "$target_os" in |
209 |
|
linux*) |
210 |
|
ETHERSRC=Linux/ether_linux.cpp |
252 |
|
fi |
253 |
|
;; |
254 |
|
netbsd*) |
255 |
< |
SUPPORTS_NATIVE_M68K=yes |
255 |
> |
CAN_NATIVE_M68K=yes |
256 |
|
;; |
257 |
|
solaris*) |
258 |
|
AUDIOSRC=Solaris/audio_solaris.cpp |
260 |
|
;; |
261 |
|
irix*) |
262 |
|
EXTRASYSSRCS=Irix/unaligned.c |
263 |
< |
DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200" |
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 -lm" |
266 |
|
;; |
267 |
|
esac |
268 |
|
|
269 |
+ |
dnl Use 68k CPU natively? |
270 |
+ |
WANT_NATIVE_M68K=no |
271 |
+ |
if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then |
272 |
+ |
AC_DEFINE(ENABLE_NATIVE_M68K) |
273 |
+ |
WANT_NATIVE_M68K=yes |
274 |
+ |
fi |
275 |
+ |
|
276 |
|
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
277 |
|
dnl Serial, ethernet and audio support needs pthreads |
278 |
|
AC_MSG_WARN([You don't have pthreads, disabling serial, ethernet and audio support.]) |
326 |
|
AC_LANG_CPLUSPLUS |
327 |
|
AC_TRY_RUN([ |
328 |
|
#include <unistd.h> |
329 |
+ |
#include <stdlib.h> |
330 |
|
#include <signal.h> |
331 |
|
#include <fcntl.h> |
332 |
|
#include <sys/mman.h> |
341 |
|
int main() |
342 |
|
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
343 |
|
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
344 |
< |
struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = 0; |
344 |
> |
struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = SA_SIGINFO; |
345 |
|
sigaction(SIGSEGV, &sa, 0); |
346 |
|
mem[0] = 0; |
347 |
|
exit(1); // should not be reached |
381 |
|
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
382 |
|
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
383 |
|
struct sigaction sa; sa.sa_flags = 0; |
384 |
< |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
384 |
> |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
385 |
|
sigaction(SIGSEGV, &sa, 0); |
386 |
|
mem[0] = 0; |
387 |
|
exit(1); // should not be reached |
392 |
|
) |
393 |
|
AC_LANG_RESTORE |
394 |
|
]) |
395 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
395 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
396 |
> |
fi |
397 |
> |
;; |
398 |
> |
netbsd*) |
399 |
> |
if [[ "x$HAVE_M68K" = "xyes" ]]; then |
400 |
> |
AC_CACHE_CHECK("whether we then have a subterfuge for your system", |
401 |
> |
ac_cv_have_sigcontext_hack, [ |
402 |
> |
AC_LANG_SAVE |
403 |
> |
AC_LANG_CPLUSPLUS |
404 |
> |
AC_TRY_RUN([ |
405 |
> |
#include <unistd.h> |
406 |
> |
#include <signal.h> |
407 |
> |
#include <fcntl.h> |
408 |
> |
#include <sys/mman.h> |
409 |
> |
|
410 |
> |
static volatile caddr_t mem = 0; |
411 |
> |
static int zero_fd = -1; |
412 |
> |
|
413 |
> |
static RETSIGTYPE segfault_handler(int, int code) |
414 |
> |
{ if ((caddr_t)code != mem) exit(1); |
415 |
> |
munmap(mem, getpagesize()); close(zero_fd); exit(0); } |
416 |
> |
|
417 |
> |
int main() |
418 |
> |
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
419 |
> |
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
420 |
> |
struct sigaction sa; sa.sa_flags = 0; |
421 |
> |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
422 |
> |
sigaction(SIGSEGV, &sa, 0); |
423 |
> |
mem[0] = 0; |
424 |
> |
exit(1); // should not be reached |
425 |
> |
} |
426 |
> |
], |
427 |
> |
[ac_cv_have_sigcontext_hack=yes], |
428 |
> |
[ac_cv_have_sigcontext_hack=no] |
429 |
> |
) |
430 |
> |
AC_LANG_RESTORE |
431 |
> |
]) |
432 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
433 |
|
fi |
434 |
|
;; |
435 |
|
esac |
442 |
|
fi |
443 |
|
|
444 |
|
dnl Determine the addressing mode to use |
445 |
< |
ADDRESSING_MODE="" |
446 |
< |
AC_MSG_CHECKING([for the addressing mode to use]) |
447 |
< |
for am in $ADDRESSING_TEST_ORDER; do |
448 |
< |
case $am in |
449 |
< |
real) |
450 |
< |
dnl Requires ability to mmap Low Memory globals. |
451 |
< |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
452 |
< |
continue |
453 |
< |
fi |
454 |
< |
if [[ "x$ac_cv_c_bigendian" = "xyes" ]]; then |
455 |
< |
dnl Requires only VOSF if 16-bit vidmode enable |
456 |
< |
if [[ "x$WANT_16BIT_VIDMODE" = "xyes" ]]; then |
445 |
> |
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
446 |
> |
ADDRESSING_MODE="real" |
447 |
> |
else |
448 |
> |
ADDRESSING_MODE="" |
449 |
> |
AC_MSG_CHECKING([for the addressing mode to use]) |
450 |
> |
for am in $ADDRESSING_TEST_ORDER; do |
451 |
> |
case $am in |
452 |
> |
real) |
453 |
> |
dnl Requires ability to mmap Low Memory globals. |
454 |
> |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
455 |
> |
continue |
456 |
> |
fi |
457 |
> |
if [[ "x$ac_cv_c_bigendian" = "xyes" ]]; then |
458 |
> |
dnl Requires only VOSF if 16-bit vidmode enable |
459 |
> |
if [[ "x$WANT_16BIT_VIDMODE" = "xyes" ]]; then |
460 |
> |
if [[ "x$CAN_VOSF" = "xno" ]]; then |
461 |
> |
continue |
462 |
> |
fi |
463 |
> |
else |
464 |
> |
DEFINES="$DEFINES -DDISABLE_16BIT_VIDMODE" |
465 |
> |
fi |
466 |
> |
else |
467 |
> |
dnl Requires VOSF |
468 |
|
if [[ "x$CAN_VOSF" = "xno" ]]; then |
469 |
|
continue |
470 |
|
fi |
414 |
– |
else |
415 |
– |
DEFINES="$DEFINES -DDISABLE_16BIT_VIDMODE" |
471 |
|
fi |
472 |
< |
else |
472 |
> |
dnl Real addressing will probably work |
473 |
> |
ADDRESSING_MODE="real" |
474 |
> |
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
475 |
> |
DEFINES="$DEFINES -DREAL_ADDRESSING" |
476 |
> |
break |
477 |
> |
;; |
478 |
> |
direct) |
479 |
|
dnl Requires VOSF |
480 |
< |
if [[ "x$CAN_VOSF" = "xno" ]]; then |
481 |
< |
continue |
480 |
> |
if [[ "x$CAN_VOSF" = "xyes" ]]; then |
481 |
> |
ADDRESSING_MODE="direct" |
482 |
> |
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
483 |
> |
DEFINES="$DEFINES -DDIRECT_ADDRESSING" |
484 |
> |
break |
485 |
|
fi |
486 |
< |
fi |
487 |
< |
dnl Real addressing will probably work |
488 |
< |
ADDRESSING_MODE="real" |
489 |
< |
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" |
433 |
< |
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
434 |
< |
DEFINES="$DEFINES -DDIRECT_ADDRESSING" |
486 |
> |
;; |
487 |
> |
banks) |
488 |
> |
dnl Default addressing mode |
489 |
> |
ADDRESSING_MODE="memory banks" |
490 |
|
break |
491 |
< |
fi |
492 |
< |
;; |
493 |
< |
banks) |
494 |
< |
dnl Default addressing mode |
491 |
> |
;; |
492 |
> |
*) |
493 |
> |
AC_MSG_ERROR([Internal configure.in script error for $am addressing mode]) |
494 |
> |
esac |
495 |
> |
done |
496 |
> |
AC_MSG_RESULT($ADDRESSING_MODE) |
497 |
> |
if [[ "x$ADDRESSING_MODE" = "x" ]]; then |
498 |
> |
AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER]) |
499 |
|
ADDRESSING_MODE="memory banks" |
500 |
< |
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" |
500 |
> |
fi |
501 |
|
fi |
502 |
|
|
503 |
|
dnl Since real and direct addressing modes automatically activate VOSF, |
538 |
|
|
539 |
|
dnl Select appropriate CPU source and REGPARAM define. |
540 |
|
ASM_OPTIMIZATIONS=none |
491 |
– |
WANT_NATIVE_M68K=no |
541 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
542 |
|
FPUSRCS="../uae_cpu/fpp.cpp" |
543 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
558 |
|
AC_MSG_RESULT($SPARC_TYPE) |
559 |
|
case "$SPARC_TYPE" in |
560 |
|
SPARC_V8) |
561 |
< |
ASM_OPTIMIZATIONS="SPARC V8 architecture" |
561 |
> |
ASM_OPTIMIZATIONS="SPARC V8 architecture" |
562 |
|
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTFLAGS" |
563 |
|
CFLAGS="$CFLAGS -Wa,-Av8" |
564 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av8" |
565 |
|
;; |
566 |
|
SPARC_V9) |
567 |
< |
ASM_OPTIMIZATIONS="SPARC V9 architecture" |
567 |
> |
ASM_OPTIMIZATIONS="SPARC V9 architecture" |
568 |
|
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTFLAGS" |
569 |
|
CFLAGS="$CFLAGS -Wa,-Av9" |
570 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av9" |
572 |
|
esac |
573 |
|
;; |
574 |
|
esac |
575 |
< |
elif [[ "x$HAVE_M68K" = "xyes" -a "x$SUPPORTS_NATIVE_M68K" = "xyes" ]]; then |
575 |
> |
elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
576 |
|
dnl Native m68k, no emulation |
577 |
< |
CPUSRCS="" |
578 |
< |
AC_DEFINE(ENABLE_NATIVE_M68K) |
530 |
< |
WANT_NATIVE_M68K=yes |
577 |
> |
CPUINCLUDES="-I../native_cpu" |
578 |
> |
CPUSRCS="asm_support.s" |
579 |
|
fi |
580 |
|
|
581 |
|
dnl UAE CPU sources for all non-m68k-native architectures. |
582 |
|
if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then |
583 |
|
CPUINCLUDES="-I../uae_cpu" |
584 |
|
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" |
585 |
|
fi |
586 |
|
|
587 |
|
dnl Remove the "-g" option if set for GCC. |
588 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
589 |
< |
dnl gb-- Probably not the cleanest way to take |
590 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
591 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
589 |
> |
dnl gb-- Probably not the cleanest way to take |
590 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
591 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
592 |
|
fi |
593 |
|
|
594 |
|
dnl Generate Makefile. |