--- SheepShaver/src/Unix/configure.ac 2005/11/30 00:02:25 1.40 +++ SheepShaver/src/Unix/configure.ac 2005/12/12 21:22:40 1.44 @@ -125,6 +125,7 @@ AC_SUBST(MONSRCS) dnl Checks for libraries. AC_CHECK_LIB(posix4, sem_init) +AC_CHECK_LIB(m, cos) dnl Do we need SDL? WANT_SDL=no @@ -491,6 +492,23 @@ darwin*) EXTFSSRC=../MacOSX/extfs_macosx.mm fi ;; +irix*) + ETHERSRC=ether_unix.cpp + AUDIOSRC=Irix/audio_irix.cpp + LIBS="$LIBS -laudio" + WANT_ESD=no + + dnl Check if our compiler supports -IPA (MIPSPro) + HAVE_IPA=no + ocflags="$CFLAGS" + CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"` + AC_MSG_CHECKING(if "-IPA" works) + dnl Do a test compile of an empty function + AC_TRY_COMPILE([#if defined __GNUC__ + # error GCC does not support IPA yet + #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) + CFLAGS="$ocflags" + ;; esac dnl Is the slirp library supported? @@ -1178,6 +1196,7 @@ HAVE_GCC27=no AC_MSG_CHECKING(for GCC 2.7 or higher) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5) # error gcc < 2.7 + typedef syntax error; #endif ]])], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], @@ -1188,6 +1207,7 @@ HAVE_GCC30=no AC_MSG_CHECKING(for GCC 3.0 or higher) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3) # error gcc < 3 + typedef syntax error; #endif ]])], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], @@ -1275,9 +1295,15 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then i?86:elf) ac_cv_use_dyngen=yes ;; + mips:elf) + ac_cv_use_dyngen=yes + ;; powerpc:mach) ac_cv_use_dyngen=yes ;; + i?86:mach) + ac_cv_use_dyngen=yes + ;; *:*) ac_cv_use_dyngen=no ;; @@ -1287,7 +1313,7 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then DYNGEN_CC=$CXX else - for p in /usr/bin /usr/local/bin; do + for p in /usr/bin /usr/local/bin /usr/freeware/bin; do gxx="$p/g++" if [[ -x "$gxx" ]]; then DYNGEN_CC="$gxx" @@ -1304,21 +1330,36 @@ if [[ "x$EMULATED_PPC" = "xyes" ]]; then i?86) DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2" ;; + mips) + DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls" + ;; powerpc) if [[ "x$ac_cv_object_format" = "xmach" ]]; then DYNGEN_OP_FLAGS="-mdynamic-no-pic" fi ;; esac - if [[ "x$HAVE_GCC30" = "xyes" ]]; then + have_dyngen_gcc3=no + case "x`$DYNGEN_CC -dumpversion`" in + x[12].*) ;; + x*) have_dyngen_gcc3=yes ;; + esac + if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0" else DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" fi DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0" - if [[ "x$HAVE_GCC30" = "xyes" ]]; then + if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls" fi + if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then + DYNGEN_CFLAGS="-O2 $CFLAGS" + DYNGEN_CXXFLAGS="-O2 $CXXFLAGS" + else + DYNGEN_CFLAGS="\$(CFLAGS)" + DYNGEN_CXXFLAGS="\$(CXXFLAGS)" + fi else WANT_JIT=no fi @@ -1367,11 +1408,21 @@ if [[ "x$WANT_JIT" = "xyes" ]]; then CPPFLAGS="$CPPFLAGS -DUSE_JIT" fi +dnl Higher level optimizations with MIPSPro compilers are possible +if [[ "x$HAVE_IPA" = "xyes" ]]; then + CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" + CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA" + CXXFLAGS="-LANG:std $CXXFLAGS" + LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA" +fi + dnl Generate Makefile. AC_SUBST(PERL) AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen]) AC_SUBST(DYNGENSRCS) AC_SUBST(DYNGEN_CC) +AC_SUBST(DYNGEN_CFLAGS) +AC_SUBST(DYNGEN_CXXFLAGS) AC_SUBST(DYNGEN_OP_FLAGS) AC_SUBST(SYSSRCS) AC_SUBST(CPUSRCS)