--- SheepShaver/src/Unix/configure.ac 2006/05/02 05:50:38 1.51 +++ SheepShaver/src/Unix/configure.ac 2007/06/13 12:11:55 1.58 @@ -106,7 +106,7 @@ if [[ "x$WANT_MON" = "xyes" ]]; then if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then AC_MSG_RESULT(yes) AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".]) - MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_lowmem.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" + MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_lowmem.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 $mon_srcdir/disass/mips-dis.c $mon_srcdir/disass/mips-opc.c $mon_srcdir/disass/mips16-opc.c" CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" AC_CHECK_LIB(ncurses, tgetent, , AC_CHECK_LIB(termcap, tgetent, , @@ -245,6 +245,7 @@ dnl We use GTK+ if possible. UISRCS=../dummy/prefs_editor_dummy.cpp case "x$WANT_GTK" in xgtk2*) + WANT_GTK=no AM_PATH_GTK_2_0(1.3.15, [ GUI_CFLAGS="$GTK_CFLAGS" GUI_LIBS="$GTK_LIBS" @@ -258,18 +259,19 @@ xgtk2*) *) AC_MSG_WARN([Could not find GTK+, disabling user interface.]) WANT_GTK=no - ;; + ;; esac ]) ;; esac if [[ "x$WANT_GTK" = "xgtk" ]]; then + WANT_GTK=no AM_PATH_GTK(1.2.0, [ GUI_CFLAGS="$GTK_CFLAGS" GUI_LIBS="$GTK_LIBS" + WANT_GTK=gtk ], [ AC_MSG_WARN([Could not find GTK+, disabling user interface.]) - WANT_GTK=no ]) fi if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then @@ -290,14 +292,15 @@ AC_SUBST(STANDALONE_GUI, [$WANT_STANDALO dnl We use ESD if possible. if [[ "x$WANT_ESD" = "xyes" ]]; then + WANT_ESD=no AM_PATH_ESD(0.2.8, [ AC_DEFINE(ENABLE_ESD, 1, [Define is using ESD.]) CFLAGS="$CFLAGS $ESD_CFLAGS" CXXFLAGS="$CXXFLAGS $ESD_CFLAGS" LIBS="$LIBS $ESD_LIBS" + WANT_ESD=yes ], [ AC_MSG_WARN([Could not find ESD, disabling ESD support.]) - WANT_ESD=no ]) fi @@ -1347,7 +1350,8 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \ ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \ ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \ - ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp" + ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \ + ../kpx_cpu/src/utils/utils-cpuinfo.cpp" CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src" dnl Enable JIT compiler, if possible @@ -1414,7 +1418,7 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then x*) have_dyngen_gcc3=yes ;; esac if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then - DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0" + DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions" else DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" fi @@ -1440,39 +1444,14 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then CPUSRCS="\ ../kpx_cpu/src/cpu/jit/jit-cache.cpp \ ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \ - ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS" + ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \ + ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS" 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__) || defined(__ppc__) - 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 - ) - ]) -else - ac_cv_use_dyngen=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 @@ -1485,6 +1464,39 @@ if [[ "x$HAVE_IPA" = "xyes" ]]; then LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" fi +dnl Check for linker script support +case $target_os:$target_cpu in +linux*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; +linux*:x86_64) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";; +linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";; +netbsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";; +freebsd*:i?86) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";; +darwin*:*) LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";; +esac +if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then + AC_CACHE_CHECK([whether linker script is usable], + ac_cv_linker_script_works, [ + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + saved_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS" + AC_TRY_RUN( + [int main() {if ((char *)&main < (char *)0x70000000) return 1;}], + [ac_cv_linker_script_works=yes], + [ac_cv_linker_script_works=no], + dnl When cross-compiling, assume it works + [ac_cv_linker_script_works="guessing yes"] + ) + AC_LANG_RESTORE + if [[ "$ac_cv_linker_script_works" = "no" ]]; then + LDFLAGS="$saved_LDFLAGS" + LINKER_SCRIPT_FLAGS="" + fi + ]) +fi +AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works", + [Define if there is a linker script to relocate the executable above 0x70000000.]) + dnl Generate Makefile. AC_SUBST(PERL) AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])