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.19 by gbeauche, 2005-03-13T12:49:30Z vs.
Revision 1.28 by gbeauche, 2005-06-22T16:38:15Z

# 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 305 | Line 346 | AC_CHECK_FUNCS(nanosleep)
346   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)
349 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
350 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
351  
352   dnl Darwin seems to define mach_task_self() instead of task_self().
353   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 958 | Line 999 | EOF
999   fi
1000   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1001  
1002 + dnl Utility macro used by next two tests.
1003 + dnl AC_EXAMINE_OBJECT(C source code,
1004 + dnl     commands examining object file,
1005 + dnl     [commands to run if compile failed]):
1006 + dnl
1007 + dnl Compile the source code to an object file; then convert it into a
1008 + dnl printable representation.  All unprintable characters and
1009 + dnl asterisks (*) are replaced by dots (.).  All white space is
1010 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1011 + dnl output, but runs of newlines are compressed to a single newline.
1012 + dnl Finally, line breaks are forcibly inserted so that no line is
1013 + dnl longer than 80 columns and the file ends with a newline.  The
1014 + dnl result of all this processing is in the file conftest.dmp, which
1015 + dnl may be examined by the commands in the second argument.
1016 + dnl
1017 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1018 + [AC_LANG_SAVE
1019 + AC_LANG_C
1020 + dnl Next bit cribbed from AC_TRY_COMPILE.
1021 + cat > conftest.$ac_ext <<EOF
1022 + [#line __oline__ "configure"
1023 + #include "confdefs.h"
1024 + $1
1025 + ]EOF
1026 + if AC_TRY_EVAL(ac_compile); then
1027 +  od -c conftest.o |
1028 +    sed ['s/^[0-7]*[    ]*/ /
1029 +          s/\*/./g
1030 +          s/ \\n/*/g
1031 +          s/ [0-9][0-9][0-9]/./g
1032 +          s/  \\[^ ]/./g'] |
1033 +    tr -d '
1034 + ' | tr -s '*' '
1035 + ' | fold | sed '$a\
1036 + ' > conftest.dmp
1037 +  $2
1038 + ifelse($3, , , else
1039 +  $3
1040 + )dnl
1041 + fi
1042 + rm -rf conftest*
1043 + AC_LANG_RESTORE])
1044 +
1045 + dnl Floating point format probe.
1046 + dnl The basic concept is the same as the above: grep the object
1047 + dnl file for an interesting string.  We have to watch out for
1048 + dnl rounding changing the values in the object, however; this is
1049 + dnl handled by ignoring the least significant byte of the float.
1050 + dnl
1051 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1052 + dnl It does know about PDP-10 idiosyncratic format, but this is
1053 + dnl not presently supported by GCC.  S/390 "binary floating point"
1054 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1055 + dnl as ASCII?)
1056 + dnl
1057 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1058 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1059 + [gcc_AC_EXAMINE_OBJECT(
1060 + [/* This will not work unless sizeof(double) == 8.  */
1061 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1062 +
1063 + /* This structure must have no internal padding.  */
1064 + struct possibility {
1065 +  char prefix[8];
1066 +  double candidate;
1067 +  char postfix[8];
1068 + };
1069 +
1070 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1071 + struct possibility table [] =
1072 + {
1073 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1074 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1075 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1076 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1077 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1078 + };],
1079 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1080 +    ac_cv_c_float_format='IEEE (big-endian)'
1081 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1082 +    ac_cv_c_float_format='IEEE (big-endian)'
1083 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1084 +    ac_cv_c_float_format='IEEE (little-endian)'
1085 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1086 +    ac_cv_c_float_format='IEEE (little-endian)'
1087 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1088 +    ac_cv_c_float_format='VAX D-float'
1089 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1090 +    ac_cv_c_float_format='PDP-10'
1091 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1092 +    ac_cv_c_float_format='IBM 370 hex'
1093 +  else
1094 +    AC_MSG_ERROR(Unknown floating point format)
1095 +  fi],
1096 +  [AC_MSG_ERROR(compile failed)])
1097 + ])
1098 + # IEEE is the default format.  If the float endianness isn't the same
1099 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1100 + # (which is a tristate: yes, no, default).  This is only an issue with
1101 + # IEEE; the other formats are only supported by a few machines each,
1102 + # all with the same endianness.
1103 + format=IEEE_FLOAT_FORMAT
1104 + fbigend=
1105 + case $ac_cv_c_float_format in
1106 +    'IEEE (big-endian)' )
1107 +        if test $ac_cv_c_bigendian = no; then
1108 +            fbigend=1
1109 +        fi
1110 +        ;;
1111 +    'IEEE (little-endian)' )
1112 +        if test $ac_cv_c_bigendian = yes; then
1113 +            fbigend=0
1114 +        fi
1115 +        ;;
1116 +    'VAX D-float' )
1117 +        format=VAX_FLOAT_FORMAT
1118 +        ;;
1119 +    'PDP-10' )
1120 +        format=PDP10_FLOAT_FORMAT
1121 +        ;;
1122 +    'IBM 370 hex' )
1123 +        format=IBM_FLOAT_FORMAT
1124 +        ;;
1125 + esac
1126 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1127 +  [Define to the floating point format of the host machine.])
1128 + if test -n "$fbigend"; then
1129 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1130 +  [Define to 1 if the host machine stores floating point numbers in
1131 +   memory with the word containing the sign bit at the lowest address,
1132 +   or to 0 if it does it the other way around.
1133 +
1134 +   This macro should not be defined if the ordering is the same as for
1135 +   multi-word integers.])
1136 + fi
1137 + ])
1138 +
1139 + dnl Check for host float format
1140 + gcc_AC_C_FLOAT_FORMAT
1141 +
1142   dnl Platform specific binary postprocessor
1143   AC_PATH_PROG(BLESS, "true")
1144   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 992 | Line 1173 | fi
1173   AC_MSG_RESULT($HAVE_ICC)
1174  
1175   dnl Determine the generated object format
1176 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1176 > AC_CACHE_CHECK([the format of compiler generated objects],
1177    ac_cv_object_format, [
1178    echo 'int i;' > conftest.$ac_ext
1179    ac_cv_object_format=no
# Line 1001 | Line 1182 | AC_CACHE_CHECK([whether the compiler can
1182      *"ELF"*)
1183        ac_cv_object_format=elf
1184        ;;
1185 +    *"Mach-O"*)
1186 +      ac_cv_object_format=mach
1187 +      ;;
1188      *)
1189        ac_cv_object_format=unknown
1190        ;;
# Line 1013 | Line 1197 | dnl CPU emulator sources
1197   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1198    CPUSRCS="\
1199      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1200 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1201      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1202      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1203      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 1033 | Line 1218 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1218        i?86:elf)
1219          ac_cv_use_dyngen=yes
1220          ;;
1221 +      powerpc:mach)
1222 +        ac_cv_use_dyngen=yes
1223 +        ;;
1224        *:*)
1225          ac_cv_use_dyngen=no
1226          ;;
# Line 1050 | Line 1238 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1238            done
1239          fi
1240        fi
1241 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1241 >      if [[ -z "$DYNGEN_CC" ]]; then
1242          ac_cv_use_dyngen=no
1243        fi
1244      ])
# Line 1058 | Line 1246 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1246        case $host_cpu in
1247        i?86)
1248          DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1249 <        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1250 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1251 <        else
1252 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1249 >        ;;
1250 >      powerpc)
1251 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1252 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1253          fi
1254          ;;
1255        esac
1256 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0"
1256 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1257 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1258 >      else
1259 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1260 >      fi
1261 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1262        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1263          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1264        fi
# Line 1091 | Line 1284 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1284    AC_CACHE_CHECK([whether static data regions are executable],
1285      ac_cv_have_static_data_exec, [
1286      AC_TRY_RUN([int main(void) {
1287 < #if defined(__powerpc__)
1287 > #if defined(__powerpc__) || defined(__ppc__)
1288        static unsigned int p[8] = {0x4e800020,};
1289        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1290        asm volatile("sync" : : : "memory");
# Line 1137 | Line 1330 | echo
1330   echo SheepShaver configuration summary:
1331   echo
1332   echo SDL support ...................... : $SDL_SUPPORT
1333 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1334   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1335   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1336   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines