--- SheepShaver/src/Unix/configure.in 2003/11/24 23:39:35 1.9 +++ SheepShaver/src/Unix/configure.in 2004/01/04 18:38:00 1.15 @@ -48,9 +48,17 @@ fi dnl We use mon if possible. MONSRCS= +case "x$WANT_MON" in +x/* | x.*) + mon_srcdir=$WANT_MON + WANT_MON=yes + ;; +xyes) + mon_srcdir=../../../mon/src + ;; +esac if [[ "x$WANT_MON" = "xyes" ]]; then AC_MSG_CHECKING(for mon) - mon_srcdir=../../../mon/src if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then AC_MSG_RESULT(yes) AC_DEFINE(ENABLE_MON) @@ -97,6 +105,9 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) fi +else + dnl We do have our own pthread_cancel() implementation + AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.]) fi dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. @@ -544,9 +555,6 @@ AC_CACHE_CHECK([whether the compiler can ]) ELF_OBJECTS=$ac_cv_elf_objects -dnl FIXME: forcibly disable JIT for now -WANT_JIT=no - dnl CPU emulator sources if [[ "x$EMULATED_PPC" = "xyes" ]]; then CPUSRCS="\ @@ -577,7 +585,7 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then ]) if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then case $host_cpu in - i?86:yes) + i?86) DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2" if [[ "x$HAVE_GCC30" = "xyes" ]]; then DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0" @@ -586,7 +594,7 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then fi ;; esac - DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=2000" + DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000" if [[ "x$HAVE_GCC30" = "xyes" ]]; then DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls" fi @@ -605,6 +613,35 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then fi fi CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp" +else + WANT_JIT=no +fi +if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then + AC_CACHE_CHECK([whether static data regions are executable], + ac_cv_have_static_data_exec, [ + AC_TRY_RUN([int main(void) { +#if defined(__powerpc__) + static unsigned int p[8] = {0x4e800020,}; + asm volatile("dcbst 0,%0" : : "r" (p) : "memory"); + asm volatile("sync" : : : "memory"); + asm volatile("icbi 0,%0" : : "r" (p) : "memory"); + asm volatile("sync" : : : "memory"); + asm volatile("isync" : : : "memory"); + ((void (*)(void))p)(); + return 0; +#endif + return 1; + }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no, + dnl When cross-compiling, do not assume anything. + ac_cv_have_static_data_exec=no + ) + ]) +fi +AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec", + [Define if your system marks static data pages as executable.]) + +if [[ "x$WANT_JIT" = "xyes" ]]; then + CPPFLAGS="$CPPFLAGS -DUSE_JIT" fi dnl Generate Makefile.