--- BasiliskII/src/Windows/configure.ac 2005/06/20 08:43:50 1.3 +++ BasiliskII/src/Windows/configure.ac 2007/01/13 18:21:30 1.7 @@ -11,6 +11,9 @@ dnl Aliases for PACKAGE and VERSION macr AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.]) AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.]) +dnl SDL options. +AC_ARG_ENABLE(sdl-static, [ --enable-sdl-static use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no]) + dnl JIT compiler options. AC_ARG_ENABLE(jit-compiler, [ --enable-jit-compiler enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes]) AC_ARG_ENABLE(jit-debug, [ --enable-jit-debug activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no]) @@ -102,6 +105,9 @@ AC_CHECK_TYPES(loff_t) AC_CHECK_TYPES(caddr_t) AC_TYPE_SIZE_T +dnl Checks for library functions. +AC_CHECK_FUNCS(strdup strerror) + dnl Define a macro that translates a yesno-variable into a C macro definition dnl to be put into the config.h file dnl $1 -- the macro to define @@ -174,6 +180,26 @@ else AC_MSG_ERROR([Sorry, Windows exceptions don't work as expected on your system.]) fi +dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler) +AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler], + ac_cv_have_skip_instruction, [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_RUN([ + #define HAVE_SIGSEGV_SKIP_INSTRUCTION 1 + #define CONFIGURE_TEST_SIGSEGV_RECOVERY + #include "../Unix/vm_alloc.cpp" + #include "../Unix/sigsegv.cpp" + ], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no, + dnl When cross-compiling, do not assume anything. + ac_cv_have_skip_instruction=no + ) + AC_LANG_RESTORE + ] +) +AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction", + [Define if we can ignore the fault (instruction skipping in SIGSEGV handler).]) + dnl We really want VOSF (Video on SEGV Signals) screen updates acceleration AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.]) @@ -236,6 +262,19 @@ AC_EGREP_CPP(xyes, #endif ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) +dnl Add -fno-strict-aliasing for slirp sources +if [[ "x$HAVE_GCC30" = "xyes" ]]; then + SAVED_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-strict-aliasing" + AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], + ac_cv_gcc_no_strict_aliasing, [ + AC_TRY_COMPILE([],[], + [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")], + [ac_cv_gcc_no_strict_aliasing=no]) + ]) + CFLAGS="$SAVED_CFLAGS" +fi + dnl Select appropriate CPU source and REGPARAM define. ASM_OPTIMIZATIONS=none CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" @@ -262,7 +301,6 @@ elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HA DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS" CAN_JIT=yes - WANT_33BIT_ADDRESSING=yes fi fi @@ -489,7 +527,16 @@ dnl We really want SDL for now AC_CHECK_TOOL(sdl_config, sdl-config, [AC_MSG_ERROR([Sorry, you currently need SDL for this port])]) SDL_CFLAGS=`$sdl_config --cflags` AC_SUBST(SDL_CFLAGS) -SDL_LIBS=`$sdl_config --libs` +if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then + SDL_LIBS=`$sdl_config --static-libs` + sdl_prefix=`$sdl_config --exec-prefix` + if [[ -n "$sdl_prefix" ]]; then + SDL_LIBS=`echo "$SDL_LIBS" | sed -e "s,-l\(SDLmain\|SDL\),$sdl_prefix/lib/lib\1.a,g"` + fi + SDL_LIBS="$SDL_LIBS -lwinmm" +else + SDL_LIBS=`$sdl_config --libs` +fi AC_SUBST(SDL_LIBS) AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])