ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/configure.ac
(Generate patch)

Comparing SheepShaver/src/Unix/configure.ac (file contents):
Revision 1.18 by gbeauche, 2005-03-05T19:07:35Z vs.
Revision 1.27 by gbeauche, 2005-06-22T15:37:25Z

# Line 17 | Line 17 | ulimit -c 0
17   dnl Options.
18   AC_ARG_ENABLE(jit,          [  --enable-jit            enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
19   AC_ARG_ENABLE(ppc-emulator, [  --enable-ppc-emulator   use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
20 + AC_ARG_ENABLE(fbdev-dga,    [  --enable-fbdev-dga      use direct frame buffer access via /dev/fb0 [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes])
21   AC_ARG_ENABLE(xf86-dga,     [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
22 < AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no])
22 > AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
23   AC_ARG_ENABLE(vosf,         [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
24   AC_ARG_WITH(esd,            [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
25 < AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
25 > AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]],
26 >  [case "$withval" in
27 >   gtk1)      WANT_GTK="gtk";;
28 >   gtk|gtk2)  WANT_GTK="$withval";;
29 >   yes)       WANT_GTK="gtk2 gtk";;
30 >   *)         WANT_GTK="no";;
31 >   esac],
32 >  [WANT_GTK="gtk2 gtk"])
33   AC_ARG_WITH(mon,            [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
34   AC_ARG_WITH(dgcc,           [  --with-dgcc=COMPILER    use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval])
35  
# Line 198 | Line 206 | no:linux*|no:netbsd*)
206    ;;
207   esac
208  
209 + dnl We use FBDev DGA if possible.
210 + if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
211 +  AC_CHECK_HEADER(linux/fb.h, [
212 +    AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.])
213 +  ], [
214 +    AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.])
215 +    WANT_FBDEV_DGA=no
216 +  ])
217 + fi
218 +
219   dnl We use XFree86 DGA if possible.
220   if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
221    AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [
# Line 222 | Line 240 | fi
240  
241   dnl We use GTK+ if possible.
242   UISRCS=../dummy/prefs_editor_dummy.cpp
243 < if [[ "x$WANT_GTK" = "xyes" ]]; then
243 > case "x$WANT_GTK" in
244 > xgtk2*)
245 >  AM_PATH_GTK_2_0(1.3.15, [
246 >    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
247 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
248 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
249 >    LIBS="$LIBS $GTK_LIBS"
250 >    UISRCS=prefs_editor_gtk.cpp
251 >    WANT_GTK=gtk2
252 >  ], [
253 >    case "x${WANT_GTK}x" in
254 >    *gtkx)
255 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
256 >      WANT_GTK=gtk
257 >      ;;
258 >    *)
259 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
260 >      WANT_GTK=no
261 >      ;;
262 >    esac
263 >  ])
264 >  ;;
265 > esac
266 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
267    AM_PATH_GTK(1.2.0, [
268      AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
269      CFLAGS="$CFLAGS $GTK_CFLAGS"
# Line 306 | Line 347 | AC_CHECK_FUNCS(sigaction signal)
347   AC_CHECK_FUNCS(mmap mprotect munmap)
348   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
349   AC_CHECK_FUNCS(posix_memalign memalign valloc)
350 < AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc)
350 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
351 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
352  
353   dnl Darwin seems to define mach_task_self() instead of task_self().
354   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 958 | Line 1000 | EOF
1000   fi
1001   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1002  
1003 + dnl Utility macro used by next two tests.
1004 + dnl AC_EXAMINE_OBJECT(C source code,
1005 + dnl     commands examining object file,
1006 + dnl     [commands to run if compile failed]):
1007 + dnl
1008 + dnl Compile the source code to an object file; then convert it into a
1009 + dnl printable representation.  All unprintable characters and
1010 + dnl asterisks (*) are replaced by dots (.).  All white space is
1011 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1012 + dnl output, but runs of newlines are compressed to a single newline.
1013 + dnl Finally, line breaks are forcibly inserted so that no line is
1014 + dnl longer than 80 columns and the file ends with a newline.  The
1015 + dnl result of all this processing is in the file conftest.dmp, which
1016 + dnl may be examined by the commands in the second argument.
1017 + dnl
1018 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1019 + [AC_LANG_SAVE
1020 + AC_LANG_C
1021 + dnl Next bit cribbed from AC_TRY_COMPILE.
1022 + cat > conftest.$ac_ext <<EOF
1023 + [#line __oline__ "configure"
1024 + #include "confdefs.h"
1025 + $1
1026 + ]EOF
1027 + if AC_TRY_EVAL(ac_compile); then
1028 +  od -c conftest.o |
1029 +    sed ['s/^[0-7]*[    ]*/ /
1030 +          s/\*/./g
1031 +          s/ \\n/*/g
1032 +          s/ [0-9][0-9][0-9]/./g
1033 +          s/  \\[^ ]/./g'] |
1034 +    tr -d '
1035 + ' | tr -s '*' '
1036 + ' | fold | sed '$a\
1037 + ' > conftest.dmp
1038 +  $2
1039 + ifelse($3, , , else
1040 +  $3
1041 + )dnl
1042 + fi
1043 + rm -rf conftest*
1044 + AC_LANG_RESTORE])
1045 +
1046 + dnl Floating point format probe.
1047 + dnl The basic concept is the same as the above: grep the object
1048 + dnl file for an interesting string.  We have to watch out for
1049 + dnl rounding changing the values in the object, however; this is
1050 + dnl handled by ignoring the least significant byte of the float.
1051 + dnl
1052 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1053 + dnl It does know about PDP-10 idiosyncratic format, but this is
1054 + dnl not presently supported by GCC.  S/390 "binary floating point"
1055 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1056 + dnl as ASCII?)
1057 + dnl
1058 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1059 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1060 + [gcc_AC_EXAMINE_OBJECT(
1061 + [/* This will not work unless sizeof(double) == 8.  */
1062 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1063 +
1064 + /* This structure must have no internal padding.  */
1065 + struct possibility {
1066 +  char prefix[8];
1067 +  double candidate;
1068 +  char postfix[8];
1069 + };
1070 +
1071 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1072 + struct possibility table [] =
1073 + {
1074 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1075 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1076 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1077 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1078 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1079 + };],
1080 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1081 +    ac_cv_c_float_format='IEEE (big-endian)'
1082 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1083 +    ac_cv_c_float_format='IEEE (big-endian)'
1084 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1085 +    ac_cv_c_float_format='IEEE (little-endian)'
1086 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1087 +    ac_cv_c_float_format='IEEE (little-endian)'
1088 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1089 +    ac_cv_c_float_format='VAX D-float'
1090 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1091 +    ac_cv_c_float_format='PDP-10'
1092 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1093 +    ac_cv_c_float_format='IBM 370 hex'
1094 +  else
1095 +    AC_MSG_ERROR(Unknown floating point format)
1096 +  fi],
1097 +  [AC_MSG_ERROR(compile failed)])
1098 + ])
1099 + # IEEE is the default format.  If the float endianness isn't the same
1100 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1101 + # (which is a tristate: yes, no, default).  This is only an issue with
1102 + # IEEE; the other formats are only supported by a few machines each,
1103 + # all with the same endianness.
1104 + format=IEEE_FLOAT_FORMAT
1105 + fbigend=
1106 + case $ac_cv_c_float_format in
1107 +    'IEEE (big-endian)' )
1108 +        if test $ac_cv_c_bigendian = no; then
1109 +            fbigend=1
1110 +        fi
1111 +        ;;
1112 +    'IEEE (little-endian)' )
1113 +        if test $ac_cv_c_bigendian = yes; then
1114 +            fbigend=0
1115 +        fi
1116 +        ;;
1117 +    'VAX D-float' )
1118 +        format=VAX_FLOAT_FORMAT
1119 +        ;;
1120 +    'PDP-10' )
1121 +        format=PDP10_FLOAT_FORMAT
1122 +        ;;
1123 +    'IBM 370 hex' )
1124 +        format=IBM_FLOAT_FORMAT
1125 +        ;;
1126 + esac
1127 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1128 +  [Define to the floating point format of the host machine.])
1129 + if test -n "$fbigend"; then
1130 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1131 +  [Define to 1 if the host machine stores floating point numbers in
1132 +   memory with the word containing the sign bit at the lowest address,
1133 +   or to 0 if it does it the other way around.
1134 +
1135 +   This macro should not be defined if the ordering is the same as for
1136 +   multi-word integers.])
1137 + fi
1138 + ])
1139 +
1140 + dnl Check for host float format
1141 + gcc_AC_C_FLOAT_FORMAT
1142 +
1143   dnl Platform specific binary postprocessor
1144   AC_PATH_PROG(BLESS, "true")
1145   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 992 | Line 1174 | fi
1174   AC_MSG_RESULT($HAVE_ICC)
1175  
1176   dnl Determine the generated object format
1177 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1177 > AC_CACHE_CHECK([the format of compiler generated objects],
1178    ac_cv_object_format, [
1179    echo 'int i;' > conftest.$ac_ext
1180    ac_cv_object_format=no
# Line 1001 | Line 1183 | AC_CACHE_CHECK([whether the compiler can
1183      *"ELF"*)
1184        ac_cv_object_format=elf
1185        ;;
1186 +    *"Mach-O"*)
1187 +      ac_cv_object_format=mach
1188 +      ;;
1189      *)
1190        ac_cv_object_format=unknown
1191        ;;
# Line 1013 | Line 1198 | dnl CPU emulator sources
1198   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1199    CPUSRCS="\
1200      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1201 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1202      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1203      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1204      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 1033 | Line 1219 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1219        i?86:elf)
1220          ac_cv_use_dyngen=yes
1221          ;;
1222 +      powerpc:mach)
1223 +        ac_cv_use_dyngen=yes
1224 +        ;;
1225        *:*)
1226          ac_cv_use_dyngen=no
1227          ;;
# Line 1050 | Line 1239 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1239            done
1240          fi
1241        fi
1242 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1242 >      if [[ -z "$DYNGEN_CC" ]]; then
1243          ac_cv_use_dyngen=no
1244        fi
1245      ])
# Line 1058 | Line 1247 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1247        case $host_cpu in
1248        i?86)
1249          DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1061        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1062          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1063        else
1064          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1065        fi
1066        saved_CPPFLAGS=$CPPFLAGS
1067        CPPFLAGS="$CPPFLAGS -mmmx"
1068        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
1069        CPPFLAGS="$CPPFLAGS -msse"
1070        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
1071        CPPFLAGS="$CPPFLAGS -msse2"
1072        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
1073        CPPFLAGS=$saved_CPPFLAGS
1250          ;;
1251 <      x86_64)
1252 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1251 >      powerpc)
1252 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1253 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1254 >        fi
1255          ;;
1256        esac
1257 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0"
1257 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1258 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1259 >      else
1260 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1261 >      fi
1262 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1263        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1264          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1265        fi
# Line 1102 | Line 1285 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1285    AC_CACHE_CHECK([whether static data regions are executable],
1286      ac_cv_have_static_data_exec, [
1287      AC_TRY_RUN([int main(void) {
1288 < #if defined(__powerpc__)
1288 > #if defined(__powerpc__) || defined(__ppc__)
1289        static unsigned int p[8] = {0x4e800020,};
1290        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1291        asm volatile("sync" : : : "memory");
# Line 1148 | Line 1331 | echo
1331   echo SheepShaver configuration summary:
1332   echo
1333   echo SDL support ...................... : $SDL_SUPPORT
1334 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1335   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1336   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1337   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines