13 |
|
AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes]) |
14 |
|
AC_ARG_ENABLE(ppc-emulator, [ --enable-ppc-emulator use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto]) |
15 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
16 |
< |
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
16 |
> |
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no]) |
17 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
18 |
|
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
19 |
|
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
183 |
|
AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h) |
184 |
|
AC_CHECK_HEADERS(sys/time.h sys/times.h) |
185 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h) |
186 |
< |
AC_CHECK_HEADERS(mmintrin.h, [have_mmintrin_h=yes]) |
187 |
< |
AC_CHECK_HEADERS(xmmintrin.h, [have_xmmintrin_h=yes]) |
188 |
< |
AC_CHECK_HEADERS(emmintrin.h, [have_emmintrin_h=yes]) |
186 |
> |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h) |
187 |
|
|
188 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
189 |
|
AC_C_BIGENDIAN |
224 |
|
AC_CHECK_FUNCS(sigaction signal) |
225 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
226 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
227 |
+ |
AC_CHECK_FUNCS(posix_memalign memalign valloc) |
228 |
|
|
229 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
230 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
274 |
|
fi |
275 |
|
]) |
276 |
|
|
277 |
+ |
dnl Check that the host supports TUN/TAP devices |
278 |
+ |
AC_CACHE_CHECK([whether TUN/TAP is supported], |
279 |
+ |
ac_cv_tun_tap_support, [ |
280 |
+ |
AC_TRY_COMPILE([ |
281 |
+ |
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) |
282 |
+ |
#include <linux/if.h> |
283 |
+ |
#include <linux/if_tun.h> |
284 |
+ |
#endif |
285 |
+ |
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H) |
286 |
+ |
#include <net/if.h> |
287 |
+ |
#include <net/if_tun.h> |
288 |
+ |
#endif |
289 |
+ |
], [ |
290 |
+ |
struct ifreq ifr; |
291 |
+ |
memset(&ifr, 0, sizeof(ifr)); |
292 |
+ |
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
293 |
+ |
], |
294 |
+ |
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no |
295 |
+ |
) |
296 |
+ |
]) |
297 |
+ |
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support", |
298 |
+ |
[Define if your system supports TUN/TAP devices.]) |
299 |
+ |
|
300 |
|
dnl Various checks if the system supports vm_allocate() and the like functions. |
301 |
|
have_mach_vm=no |
302 |
|
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \ |
550 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
551 |
|
#include "vm_alloc.cpp" |
552 |
|
#include "sigsegv.cpp" |
531 |
– |
], [ |
532 |
– |
sigsegv_recovery=mach |
533 |
– |
ac_cv_have_mach_exceptions=yes |
553 |
|
], |
554 |
+ |
ac_cv_have_mach_exceptions=yes, |
555 |
|
ac_cv_have_mach_exceptions=no, |
556 |
|
dnl When cross-compiling, do not assume anything. |
557 |
|
ac_cv_have_mach_exceptions=no |
559 |
|
AC_LANG_RESTORE |
560 |
|
] |
561 |
|
) |
562 |
+ |
if [[ "$ac_cv_have_mach_exceptions" = "yes" ]]; then |
563 |
+ |
sigsegv_recovery=mach |
564 |
+ |
fi |
565 |
|
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
566 |
|
[Define if your system supports Mach exceptions.]) |
567 |
|
|
576 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
577 |
|
#include "vm_alloc.cpp" |
578 |
|
#include "sigsegv.cpp" |
556 |
– |
], [ |
557 |
– |
sigsegv_recovery=siginfo |
558 |
– |
ac_cv_have_extended_signals=yes |
579 |
|
], |
580 |
+ |
ac_cv_have_extended_signals=yes, |
581 |
|
ac_cv_have_extended_signals=no, |
582 |
|
dnl When cross-compiling, do not assume anything. |
583 |
|
ac_cv_have_extended_signals=no |
585 |
|
AC_LANG_RESTORE |
586 |
|
] |
587 |
|
) |
588 |
+ |
if [[ "$ac_cv_have_extended_signals" = "yes" ]]; then |
589 |
+ |
sigsegv_recovery=siginfo |
590 |
+ |
fi |
591 |
|
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
592 |
|
[Define if your system support extended signals.]) |
593 |
|
fi |
603 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
604 |
|
#include "vm_alloc.cpp" |
605 |
|
#include "sigsegv.cpp" |
582 |
– |
], [ |
583 |
– |
sigsegv_recovery=sigcontext |
584 |
– |
ac_cv_have_sigcontext_hack=yes |
606 |
|
], |
607 |
+ |
ac_cv_have_sigcontext_hack=yes, |
608 |
|
ac_cv_have_sigcontext_hack=no, |
609 |
|
dnl When cross-compiling, do not assume anything. |
610 |
|
ac_cv_have_sigcontext_hack=no |
611 |
|
) |
612 |
|
AC_LANG_RESTORE |
613 |
|
]) |
614 |
+ |
if [[ "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
615 |
+ |
sigsegv_recovery=sigcontext |
616 |
+ |
fi |
617 |
|
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack", |
618 |
|
[Define if we know a hack to replace siginfo_t->si_addr member.]) |
619 |
|
fi |
642 |
|
CAN_VOSF=no |
643 |
|
if [[ -n "$sigsegv_recovery" ]]; then |
644 |
|
CAN_VOSF=yes |
645 |
+ |
case $target_os in |
646 |
+ |
darwin*) |
647 |
+ |
dnl Signal handlers in darwin are way too slow since the whole |
648 |
+ |
dnl machine state (GPRs, FPRs, VRs) is forcibly saved. |
649 |
+ |
dnl In other words, VOSF is slower than static window refreshes. |
650 |
+ |
CAN_VOSF=no |
651 |
+ |
;; |
652 |
+ |
esac |
653 |
|
fi |
654 |
|
|
655 |
|
dnl Enable VOSF screen updates with this feature is requested and feasible |
761 |
|
else |
762 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" |
763 |
|
fi |
764 |
< |
if [[ "x$have_mmintrin_h" = "xyes" ]]; then |
765 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx" |
766 |
< |
fi |
767 |
< |
if [[ "x$have_xmmintrin_h" = "xyes" ]]; then |
768 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse" |
769 |
< |
fi |
770 |
< |
if [[ "x$have_emmintrin_h" = "xyes" ]]; then |
771 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2" |
772 |
< |
fi |
764 |
> |
saved_CPPFLAGS=$CPPFLAGS |
765 |
> |
CPPFLAGS="$CPPFLAGS -mmmx" |
766 |
> |
AC_CHECK_HEADERS(mmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"]) |
767 |
> |
CPPFLAGS="$CPPFLAGS -msse" |
768 |
> |
AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"]) |
769 |
> |
CPPFLAGS="$CPPFLAGS -msse2" |
770 |
> |
AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"]) |
771 |
> |
CPPFLAGS=$saved_CPPFLAGS |
772 |
> |
;; |
773 |
> |
x86_64) |
774 |
> |
AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h) |
775 |
|
;; |
776 |
|
esac |
777 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000" |