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]], |
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 |
265 |
|
;; |
266 |
|
esac |
267 |
|
|
268 |
+ |
dnl Use 68k CPU natively? |
269 |
+ |
WANT_NATIVE_M68K=no |
270 |
+ |
if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then |
271 |
+ |
AC_DEFINE(ENABLE_NATIVE_M68K) |
272 |
+ |
WANT_NATIVE_M68K=yes |
273 |
+ |
fi |
274 |
+ |
|
275 |
|
if [[ "x$HAVE_PTHREADS" = "xno" ]]; then |
276 |
|
dnl Serial, ethernet and audio support needs pthreads |
277 |
|
AC_MSG_WARN([You don't have pthreads, disabling serial, ethernet and audio support.]) |
325 |
|
AC_LANG_CPLUSPLUS |
326 |
|
AC_TRY_RUN([ |
327 |
|
#include <unistd.h> |
328 |
+ |
#include <stdlib.h> |
329 |
|
#include <signal.h> |
330 |
|
#include <fcntl.h> |
331 |
|
#include <sys/mman.h> |
340 |
|
int main() |
341 |
|
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
342 |
|
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
343 |
< |
struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = 0; |
343 |
> |
struct sigaction sa; sa.sa_sigaction = segfault_handler; sa.sa_flags = SA_SIGINFO; |
344 |
|
sigaction(SIGSEGV, &sa, 0); |
345 |
|
mem[0] = 0; |
346 |
|
exit(1); // should not be reached |
380 |
|
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
381 |
|
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
382 |
|
struct sigaction sa; sa.sa_flags = 0; |
383 |
< |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
383 |
> |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
384 |
|
sigaction(SIGSEGV, &sa, 0); |
385 |
|
mem[0] = 0; |
386 |
|
exit(1); // should not be reached |
391 |
|
) |
392 |
|
AC_LANG_RESTORE |
393 |
|
]) |
394 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
394 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
395 |
> |
fi |
396 |
> |
;; |
397 |
> |
netbsd*) |
398 |
> |
if [[ "x$HAVE_M68K" = "xyes" ]]; then |
399 |
> |
AC_CACHE_CHECK("whether we then have a subterfuge for your system", |
400 |
> |
ac_cv_have_sigcontext_hack, [ |
401 |
> |
AC_LANG_SAVE |
402 |
> |
AC_LANG_CPLUSPLUS |
403 |
> |
AC_TRY_RUN([ |
404 |
> |
#include <unistd.h> |
405 |
> |
#include <signal.h> |
406 |
> |
#include <fcntl.h> |
407 |
> |
#include <sys/mman.h> |
408 |
> |
|
409 |
> |
static volatile caddr_t mem = 0; |
410 |
> |
static int zero_fd = -1; |
411 |
> |
|
412 |
> |
static RETSIGTYPE segfault_handler(int, int code) |
413 |
> |
{ if ((caddr_t)code != mem) exit(1); |
414 |
> |
munmap(mem, getpagesize()); close(zero_fd); exit(0); } |
415 |
> |
|
416 |
> |
int main() |
417 |
> |
{ if ((zero_fd = open("/dev/zero", O_RDWR)) < 0) exit(1); |
418 |
> |
if ((mem = (caddr_t)mmap(0, getpagesize(), PROT_READ, MAP_PRIVATE, zero_fd, 0)) == (caddr_t)MAP_FAILED) exit(1); |
419 |
> |
struct sigaction sa; sa.sa_flags = 0; |
420 |
> |
sa.sa_handler = (RETSIGTYPE (*)(int))segfault_handler; |
421 |
> |
sigaction(SIGSEGV, &sa, 0); |
422 |
> |
mem[0] = 0; |
423 |
> |
exit(1); // should not be reached |
424 |
> |
} |
425 |
> |
], |
426 |
> |
[ac_cv_have_sigcontext_hack=yes], |
427 |
> |
[ac_cv_have_sigcontext_hack=no] |
428 |
> |
) |
429 |
> |
AC_LANG_RESTORE |
430 |
> |
]) |
431 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, $ac_cv_have_sigcontext_hack) |
432 |
|
fi |
433 |
|
;; |
434 |
|
esac |
441 |
|
fi |
442 |
|
|
443 |
|
dnl Determine the addressing mode to use |
444 |
< |
ADDRESSING_MODE="" |
445 |
< |
AC_MSG_CHECKING([for the addressing mode to use]) |
446 |
< |
for am in $ADDRESSING_TEST_ORDER; do |
447 |
< |
case $am in |
448 |
< |
real) |
449 |
< |
dnl Requires ability to mmap Low Memory globals. |
450 |
< |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
451 |
< |
continue |
452 |
< |
fi |
453 |
< |
if [[ "x$ac_cv_c_bigendian" = "xyes" ]]; then |
454 |
< |
dnl Requires only VOSF if 16-bit vidmode enable |
455 |
< |
if [[ "x$WANT_16BIT_VIDMODE" = "xyes" ]]; then |
444 |
> |
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
445 |
> |
ADDRESSING_MODE="real" |
446 |
> |
else |
447 |
> |
ADDRESSING_MODE="" |
448 |
> |
AC_MSG_CHECKING([for the addressing mode to use]) |
449 |
> |
for am in $ADDRESSING_TEST_ORDER; do |
450 |
> |
case $am in |
451 |
> |
real) |
452 |
> |
dnl Requires ability to mmap Low Memory globals. |
453 |
> |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
454 |
> |
continue |
455 |
> |
fi |
456 |
> |
if [[ "x$ac_cv_c_bigendian" = "xyes" ]]; then |
457 |
> |
dnl Requires only VOSF if 16-bit vidmode enable |
458 |
> |
if [[ "x$WANT_16BIT_VIDMODE" = "xyes" ]]; then |
459 |
> |
if [[ "x$CAN_VOSF" = "xno" ]]; then |
460 |
> |
continue |
461 |
> |
fi |
462 |
> |
else |
463 |
> |
DEFINES="$DEFINES -DDISABLE_16BIT_VIDMODE" |
464 |
> |
fi |
465 |
> |
else |
466 |
> |
dnl Requires VOSF |
467 |
|
if [[ "x$CAN_VOSF" = "xno" ]]; then |
468 |
|
continue |
469 |
|
fi |
414 |
– |
else |
415 |
– |
DEFINES="$DEFINES -DDISABLE_16BIT_VIDMODE" |
470 |
|
fi |
471 |
< |
else |
471 |
> |
dnl Real addressing will probably work |
472 |
> |
ADDRESSING_MODE="real" |
473 |
> |
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
474 |
> |
DEFINES="$DEFINES -DREAL_ADDRESSING" |
475 |
> |
break |
476 |
> |
;; |
477 |
> |
direct) |
478 |
|
dnl Requires VOSF |
479 |
< |
if [[ "x$CAN_VOSF" = "xno" ]]; then |
480 |
< |
continue |
479 |
> |
if [[ "x$CAN_VOSF" = "xyes" ]]; then |
480 |
> |
ADDRESSING_MODE="direct" |
481 |
> |
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
482 |
> |
DEFINES="$DEFINES -DDIRECT_ADDRESSING" |
483 |
> |
break |
484 |
|
fi |
485 |
< |
fi |
486 |
< |
dnl Real addressing will probably work |
487 |
< |
ADDRESSING_MODE="real" |
488 |
< |
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" |
485 |
> |
;; |
486 |
> |
banks) |
487 |
> |
dnl Default addressing mode |
488 |
> |
ADDRESSING_MODE="memory banks" |
489 |
|
break |
490 |
< |
fi |
491 |
< |
;; |
492 |
< |
banks) |
493 |
< |
dnl Default addressing mode |
490 |
> |
;; |
491 |
> |
*) |
492 |
> |
AC_MSG_ERROR([Internal configure.in script error for $am addressing mode]) |
493 |
> |
esac |
494 |
> |
done |
495 |
> |
AC_MSG_RESULT($ADDRESSING_MODE) |
496 |
> |
if [[ "x$ADDRESSING_MODE" = "x" ]]; then |
497 |
> |
AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER]) |
498 |
|
ADDRESSING_MODE="memory banks" |
499 |
< |
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" |
499 |
> |
fi |
500 |
|
fi |
501 |
|
|
502 |
|
dnl Since real and direct addressing modes automatically activate VOSF, |
537 |
|
|
538 |
|
dnl Select appropriate CPU source and REGPARAM define. |
539 |
|
ASM_OPTIMIZATIONS=none |
491 |
– |
WANT_NATIVE_M68K=no |
540 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
541 |
|
FPUSRCS="../uae_cpu/fpp.cpp" |
542 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
557 |
|
AC_MSG_RESULT($SPARC_TYPE) |
558 |
|
case "$SPARC_TYPE" in |
559 |
|
SPARC_V8) |
560 |
< |
ASM_OPTIMIZATIONS="SPARC V8 architecture" |
560 |
> |
ASM_OPTIMIZATIONS="SPARC V8 architecture" |
561 |
|
DEFINES="$DEFINES -DSPARC_V8_ASSEMBLY" dnl -DOPTFLAGS" |
562 |
|
CFLAGS="$CFLAGS -Wa,-Av8" |
563 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av8" |
564 |
|
;; |
565 |
|
SPARC_V9) |
566 |
< |
ASM_OPTIMIZATIONS="SPARC V9 architecture" |
566 |
> |
ASM_OPTIMIZATIONS="SPARC V9 architecture" |
567 |
|
DEFINES="$DEFINES -DSPARC_V9_ASSEMBLY" dnl -DOPTFLAGS" |
568 |
|
CFLAGS="$CFLAGS -Wa,-Av9" |
569 |
|
CXXFLAGS="$CXXFLAGS -Wa,-Av9" |
571 |
|
esac |
572 |
|
;; |
573 |
|
esac |
574 |
< |
elif [[ "x$HAVE_M68K" = "xyes" -a "x$SUPPORTS_NATIVE_M68K" = "xyes" ]]; then |
574 |
> |
elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
575 |
|
dnl Native m68k, no emulation |
576 |
< |
CPUSRCS="" |
577 |
< |
AC_DEFINE(ENABLE_NATIVE_M68K) |
530 |
< |
WANT_NATIVE_M68K=yes |
576 |
> |
CPUINCLUDES="-I../native_cpu" |
577 |
> |
CPUSRCS="asm_support.s" |
578 |
|
fi |
579 |
|
|
580 |
|
dnl UAE CPU sources for all non-m68k-native architectures. |
581 |
|
if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then |
582 |
|
CPUINCLUDES="-I../uae_cpu" |
583 |
|
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" |
584 |
|
fi |
585 |
|
|
586 |
|
dnl Remove the "-g" option if set for GCC. |
587 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
588 |
< |
dnl gb-- Probably not the cleanest way to take |
589 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
590 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
588 |
> |
dnl gb-- Probably not the cleanest way to take |
589 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
590 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ -g / /;s/^-g / /;s/ -g$/ /;s/^-g$//'` |
591 |
|
fi |
592 |
|
|
593 |
|
dnl Generate Makefile. |