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.10 by gbeauche, 2004-11-24T22:48:02Z vs.
Revision 1.32 by gbeauche, 2005-07-03T13:05:36Z

# 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 31 | Line 39 | AC_ARG_ENABLE(addressing,
39    [case "$enableval" in
40     real)        WANT_ADDRESSING_MODE="real";;
41     direct)      WANT_ADDRESSING_MODE="direct";;
42 <   direct,0x*)  WANT_ADDRESSING_MODE="direct"; NATMEM_OFFSET=`echo "$enableval" | sed -n '/direct,\(0[[xX]][[0-9A-Fa-f]]*\)/s//\1/p'`;;
42 >   direct,0x*)  WANT_ADDRESSING_MODE="direct"; NATMEM_OFFSET=`echo "$enableval" | sed -n '/direct,\(0[[xX]][[0-9A-Fa-f]]*\([[UuLl]]\{1,2\}\)\?\)$/s//\1/p'`;;
43     esac],
44    [WANT_ADDRESSING_MODE="real"]
45   )
# Line 48 | Line 56 | AC_PROG_CXX
56   AC_PROG_MAKE_SET
57   AC_PROG_INSTALL
58   AC_PROG_EGREP
59 < AC_CHECK_PROGS(FILE, [file false])
59 > AC_PATH_PROGS(FILE, [file false])
60 > AC_PATH_PROG(PERL, [perl])
61  
62   dnl Check for PowerPC target CPU.
63   HAVE_PPC=no
# Line 105 | Line 114 | if [[ "x$WANT_MON" = "xyes" ]]; then
114      WANT_MON=no
115    fi
116   fi
117 + AC_SUBST(MONSRCS)
118  
119   dnl Checks for libraries.
120   AC_CHECK_LIB(posix4, sem_init)
# Line 145 | Line 155 | if [[ "x$WANT_SDL" = "xyes" ]]; then
155      LIBS="$LIBS $sdl_libs"
156    else
157      WANT_SDL=no
158 +    WANT_SDL_VIDEO=no
159 +    WANT_SDL_AUDIO=no
160    fi
161    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
162   else
# Line 152 | Line 164 | else
164   fi
165  
166   dnl We need X11, if not using SDL.
167 < if [[ "x$WANT_SDL" = "xno" ]]; then
167 > if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; then
168    AC_PATH_XTRA
169    if [[ "x$no_x" = "xyes" ]]; then
170      AC_MSG_ERROR([You need X11 to run SheepShaver.])
# Line 165 | Line 177 | fi
177   dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
178   HAVE_PTHREADS=yes
179   case $EMULATED_PPC:$target_os in
180 < no:linux*)
180 > no:linux*|no:netbsd*)
181    dnl We do have our own pthread_cancel() implementation
182    AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.])
183    ;;
# Line 173 | Line 185 | no:linux*)
185    AC_CHECK_LIB(pthread, pthread_create, , [
186      AC_CHECK_LIB(c_r, pthread_create, , [
187        AC_CHECK_LIB(PTL, pthread_create, , [
188 <        AC_MSG_ERROR([You need pthreads to run Basilisk II.])
188 >        dnl XXX remove when no pthreads case is merged
189 >        AC_MSG_ERROR([You need pthreads to run SheepShaver.])
190 >        HAVE_PTHREADS=no
191        ])
192      ])
193    ])
194    AC_CHECK_FUNCS(pthread_cancel)
195 +  AC_CHECK_FUNCS(pthread_cond_init)
196    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
197    AC_CHECK_FUNCS(pthread_mutexattr_settype)
198    AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
184  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
185    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
186  fi
199    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
200    SEMSRC=
201    AC_CHECK_FUNCS(sem_init, , [
# Line 193 | Line 205 | no:linux*)
205    ])
206    ;;
207   esac
208 + if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
209 +  AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
210 + fi
211 +
212 + dnl We use FBDev DGA if possible.
213 + if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
214 +  AC_CHECK_HEADER(linux/fb.h, [
215 +    AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.])
216 +  ], [
217 +    AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.])
218 +    WANT_FBDEV_DGA=no
219 +  ])
220 + fi
221  
222   dnl We use XFree86 DGA if possible.
223   if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
# Line 218 | Line 243 | fi
243  
244   dnl We use GTK+ if possible.
245   UISRCS=../dummy/prefs_editor_dummy.cpp
246 < if [[ "x$WANT_GTK" = "xyes" ]]; then
246 > case "x$WANT_GTK" in
247 > xgtk2*)
248 >  AM_PATH_GTK_2_0(1.3.15, [
249 >    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
250 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
251 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
252 >    LIBS="$LIBS $GTK_LIBS"
253 >    UISRCS=prefs_editor_gtk.cpp
254 >    WANT_GTK=gtk2
255 >  ], [
256 >    case "x${WANT_GTK}x" in
257 >    *gtkx)
258 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
259 >      WANT_GTK=gtk
260 >      ;;
261 >    *)
262 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
263 >      WANT_GTK=no
264 >      ;;
265 >    esac
266 >  ])
267 >  ;;
268 > esac
269 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
270    AM_PATH_GTK(1.2.0, [
271      AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
272      CFLAGS="$CFLAGS $GTK_CFLAGS"
# Line 250 | Line 298 | AC_SYS_LARGEFILE
298   dnl Checks for header files.
299   AC_HEADER_STDC
300   AC_HEADER_SYS_WAIT
301 < AC_CHECK_HEADERS(malloc.h)
301 > AC_CHECK_HEADERS(malloc.h stdint.h)
302   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
255 AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
303   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
304 < AC_CHECK_HEADERS(linux/if.h, [], [], [
305 < #if HAVE_SYS_SOCKET_H
306 < # include <sys/socket.h>
304 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
305 > AC_CHECK_HEADERS(sys/time.h sys/poll.h sys/select.h arpa/inet.h)
306 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
307 > #ifdef HAVE_SYS_TYPES_H
308 > #include <sys/types.h>
309 > #endif
310 > #ifdef HAVE_SYS_SOCKET_H
311 > #include <sys/socket.h>
312   #endif
313   ])
314 < AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
314 > AC_CHECK_HEADERS(AvailabilityMacros.h)
315 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
316   AC_CHECK_HEADERS(fenv.h)
317  
318   dnl Checks for typedefs, structures, and compiler characteristics.
# Line 296 | Line 349 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
349   fi
350  
351   dnl Checks for library functions.
352 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
352 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
353   AC_CHECK_FUNCS(nanosleep)
354   AC_CHECK_FUNCS(sigaction signal)
355   AC_CHECK_FUNCS(mmap mprotect munmap)
356   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
357 < AC_CHECK_FUNCS(posix_memalign memalign valloc)
357 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
358 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
359 > AC_CHECK_FUNCS(poll inet_aton)
360  
361   dnl Darwin seems to define mach_task_self() instead of task_self().
362   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 313 | Line 368 | no:linux*)
368    ;;
369   *:*)
370    AC_SEARCH_LIBS(clock_gettime, [rt posix4])
371 <  AC_CHECK_FUNCS(clock_gettime)
371 >  AC_CHECK_FUNCS(clock_gettime clock_nanosleep)
372    ;;
373   esac
374  
# Line 392 | Line 447 | EXTFSSRC=extfs_unix.cpp
447   EXTRASYSSRCS=
448   case "$target_os" in
449   linux*)
450 <  ETHERSRC=Linux/ether_linux.cpp
450 >  ETHERSRC=ether_unix.cpp
451    AUDIOSRC=audio_oss_esd.cpp
452    SCSISRC=Linux/scsi_linux.cpp
453    if [[ "x$EMULATED_PPC" = "xno" ]]; then
454 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
454 >    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
455 >  fi
456 >  ;;
457 > freebsd*)
458 >  ETHERSRC=ether_unix.cpp
459 >  ;;
460 > netbsd*)
461 >  ETHERSRC=ether_unix.cpp
462 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
463 >    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
464    fi
465    ;;
466   darwin*)
467 +  ETHERSRC=ether_unix.cpp
468    if [[ "x$EMULATED_PPC" = "xno" ]]; then
469 <    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
469 >    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
470    fi
471    if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
472      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
# Line 415 | Line 480 | cygwin*)
480    ;;
481   esac
482  
483 + dnl Is the slirp library supported?
484 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
485 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
486 +  SLIRP_SRCS="\
487 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
488 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
489 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
490 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
491 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
492 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
493 + fi
494 + AC_SUBST(SLIRP_SRCS)
495 +
496   dnl SDL overrides
497   if [[ "x$WANT_SDL" = "xyes" ]]; then
498    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 445 | Line 523 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
523    AUDIOSRC="../SDL/audio_sdl.cpp"
524   fi
525  
526 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
526 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
527  
528   dnl Define a macro that translates a yesno-variable into a C macro definition
529   dnl to be put into the config.h file
# Line 917 | Line 995 | int main(void)
995                  memset(m, 0, ranges[[i]].size);
996                  vm_release(m, ranges[[i]].size);
997                  if (i == n_ranges - 1) {
998 <                        printf("0x%08x\n", ofs);
998 >                        if (sizeof(void *) == 8 && ofs > 0xffffffff)
999 >                                printf("0x%lxul\n", ofs);
1000 >                        else
1001 >                                printf("0x%08x\n", ofs);
1002                          return 0;
1003                  }
1004          }
# Line 945 | Line 1026 | EOF
1026   fi
1027   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1028  
1029 + dnl Utility macro used by next two tests.
1030 + dnl AC_EXAMINE_OBJECT(C source code,
1031 + dnl     commands examining object file,
1032 + dnl     [commands to run if compile failed]):
1033 + dnl
1034 + dnl Compile the source code to an object file; then convert it into a
1035 + dnl printable representation.  All unprintable characters and
1036 + dnl asterisks (*) are replaced by dots (.).  All white space is
1037 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1038 + dnl output, but runs of newlines are compressed to a single newline.
1039 + dnl Finally, line breaks are forcibly inserted so that no line is
1040 + dnl longer than 80 columns and the file ends with a newline.  The
1041 + dnl result of all this processing is in the file conftest.dmp, which
1042 + dnl may be examined by the commands in the second argument.
1043 + dnl
1044 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1045 + [AC_LANG_SAVE
1046 + AC_LANG_C
1047 + dnl Next bit cribbed from AC_TRY_COMPILE.
1048 + cat > conftest.$ac_ext <<EOF
1049 + [#line __oline__ "configure"
1050 + #include "confdefs.h"
1051 + $1
1052 + ]EOF
1053 + if AC_TRY_EVAL(ac_compile); then
1054 +  od -c conftest.o |
1055 +    sed ['s/^[0-7]*[    ]*/ /
1056 +          s/\*/./g
1057 +          s/ \\n/*/g
1058 +          s/ [0-9][0-9][0-9]/./g
1059 +          s/  \\[^ ]/./g'] |
1060 +    tr -d '
1061 + ' | tr -s '*' '
1062 + ' | fold | sed '$a\
1063 + ' > conftest.dmp
1064 +  $2
1065 + ifelse($3, , , else
1066 +  $3
1067 + )dnl
1068 + fi
1069 + rm -rf conftest*
1070 + AC_LANG_RESTORE])
1071 +
1072 + dnl Floating point format probe.
1073 + dnl The basic concept is the same as the above: grep the object
1074 + dnl file for an interesting string.  We have to watch out for
1075 + dnl rounding changing the values in the object, however; this is
1076 + dnl handled by ignoring the least significant byte of the float.
1077 + dnl
1078 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1079 + dnl It does know about PDP-10 idiosyncratic format, but this is
1080 + dnl not presently supported by GCC.  S/390 "binary floating point"
1081 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1082 + dnl as ASCII?)
1083 + dnl
1084 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1085 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1086 + [gcc_AC_EXAMINE_OBJECT(
1087 + [/* This will not work unless sizeof(double) == 8.  */
1088 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1089 +
1090 + /* This structure must have no internal padding.  */
1091 + struct possibility {
1092 +  char prefix[8];
1093 +  double candidate;
1094 +  char postfix[8];
1095 + };
1096 +
1097 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1098 + struct possibility table [] =
1099 + {
1100 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1101 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1102 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1103 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1104 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1105 + };],
1106 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1107 +    ac_cv_c_float_format='IEEE (big-endian)'
1108 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1109 +    ac_cv_c_float_format='IEEE (big-endian)'
1110 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1111 +    ac_cv_c_float_format='IEEE (little-endian)'
1112 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1113 +    ac_cv_c_float_format='IEEE (little-endian)'
1114 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1115 +    ac_cv_c_float_format='VAX D-float'
1116 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1117 +    ac_cv_c_float_format='PDP-10'
1118 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1119 +    ac_cv_c_float_format='IBM 370 hex'
1120 +  else
1121 +    AC_MSG_ERROR(Unknown floating point format)
1122 +  fi],
1123 +  [AC_MSG_ERROR(compile failed)])
1124 + ])
1125 + # IEEE is the default format.  If the float endianness isn't the same
1126 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1127 + # (which is a tristate: yes, no, default).  This is only an issue with
1128 + # IEEE; the other formats are only supported by a few machines each,
1129 + # all with the same endianness.
1130 + format=IEEE_FLOAT_FORMAT
1131 + fbigend=
1132 + case $ac_cv_c_float_format in
1133 +    'IEEE (big-endian)' )
1134 +        if test $ac_cv_c_bigendian = no; then
1135 +            fbigend=1
1136 +        fi
1137 +        ;;
1138 +    'IEEE (little-endian)' )
1139 +        if test $ac_cv_c_bigendian = yes; then
1140 +            fbigend=0
1141 +        fi
1142 +        ;;
1143 +    'VAX D-float' )
1144 +        format=VAX_FLOAT_FORMAT
1145 +        ;;
1146 +    'PDP-10' )
1147 +        format=PDP10_FLOAT_FORMAT
1148 +        ;;
1149 +    'IBM 370 hex' )
1150 +        format=IBM_FLOAT_FORMAT
1151 +        ;;
1152 + esac
1153 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1154 +  [Define to the floating point format of the host machine.])
1155 + if test -n "$fbigend"; then
1156 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1157 +  [Define to 1 if the host machine stores floating point numbers in
1158 +   memory with the word containing the sign bit at the lowest address,
1159 +   or to 0 if it does it the other way around.
1160 +
1161 +   This macro should not be defined if the ordering is the same as for
1162 +   multi-word integers.])
1163 + fi
1164 + ])
1165 +
1166 + dnl Check for host float format
1167 + gcc_AC_C_FLOAT_FORMAT
1168 +
1169   dnl Platform specific binary postprocessor
1170   AC_PATH_PROG(BLESS, "true")
1171   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 979 | Line 1200 | fi
1200   AC_MSG_RESULT($HAVE_ICC)
1201  
1202   dnl Determine the generated object format
1203 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1203 > AC_CACHE_CHECK([the format of compiler generated objects],
1204    ac_cv_object_format, [
1205    echo 'int i;' > conftest.$ac_ext
1206    ac_cv_object_format=no
# Line 988 | Line 1209 | AC_CACHE_CHECK([whether the compiler can
1209      *"ELF"*)
1210        ac_cv_object_format=elf
1211        ;;
1212 +    *"Mach-O"*)
1213 +      ac_cv_object_format=mach
1214 +      ;;
1215      *)
1216        ac_cv_object_format=unknown
1217        ;;
# Line 996 | Line 1220 | AC_CACHE_CHECK([whether the compiler can
1220    rm -rf conftest*
1221   ])
1222  
1223 + dnl Add -fno-strict-aliasing for slirp sources
1224 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1225 +  SAVED_CFLAGS="$CFLAGS"
1226 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1227 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1228 +    ac_cv_gcc_no_strict_aliasing, [
1229 +    AC_TRY_COMPILE([],[],
1230 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1231 +      [ac_cv_gcc_no_strict_aliasing=no])
1232 +  ])
1233 +  CFLAGS="$SAVED_CFLAGS"
1234 + fi
1235 +
1236 + dnl Add -mdynamic-no-pic for MacOS X
1237 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1238 +  SAVED_CFLAGS="$CFLAGS"
1239 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1240 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1241 +    ac_cv_gcc_mdynamic_no_pic, [
1242 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1243 +  ])
1244 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1245 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1246 +  else
1247 +    CFLAGS="$SAVED_CFLAGS"
1248 +  fi
1249 + fi
1250 +
1251   dnl CPU emulator sources
1252   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1253    CPUSRCS="\
1254      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1255 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1256      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1257      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1258      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 1020 | Line 1273 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1273        i?86:elf)
1274          ac_cv_use_dyngen=yes
1275          ;;
1276 +      powerpc:mach)
1277 +        ac_cv_use_dyngen=yes
1278 +        ;;
1279        *:*)
1280          ac_cv_use_dyngen=no
1281          ;;
# Line 1037 | Line 1293 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1293            done
1294          fi
1295        fi
1296 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1296 >      if [[ -z "$DYNGEN_CC" ]]; then
1297          ac_cv_use_dyngen=no
1298        fi
1299      ])
# Line 1045 | Line 1301 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1301        case $host_cpu in
1302        i?86)
1303          DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1048        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1049          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1050        else
1051          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1052        fi
1053        saved_CPPFLAGS=$CPPFLAGS
1054        CPPFLAGS="$CPPFLAGS -mmmx"
1055        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
1056        CPPFLAGS="$CPPFLAGS -msse"
1057        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
1058        CPPFLAGS="$CPPFLAGS -msse2"
1059        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
1060        CPPFLAGS=$saved_CPPFLAGS
1304          ;;
1305 <      x86_64)
1306 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1305 >      powerpc)
1306 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1307 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1308 >        fi
1309          ;;
1310        esac
1311 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
1311 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1312 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1313 >      else
1314 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1315 >      fi
1316 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1317        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1318          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1319        fi
# Line 1089 | Line 1339 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1339    AC_CACHE_CHECK([whether static data regions are executable],
1340      ac_cv_have_static_data_exec, [
1341      AC_TRY_RUN([int main(void) {
1342 < #if defined(__powerpc__)
1342 > #if defined(__powerpc__) || defined(__ppc__)
1343        static unsigned int p[8] = {0x4e800020,};
1344        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1345        asm volatile("sync" : : : "memory");
# Line 1105 | Line 1355 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1355      ac_cv_have_static_data_exec=no
1356      )
1357    ])
1358 + else
1359 +  ac_cv_use_dyngen=no
1360   fi
1361   AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1362    [Define if your system marks static data pages as executable.])
# Line 1114 | Line 1366 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1366   fi
1367  
1368   dnl Generate Makefile.
1369 + AC_SUBST(PERL)
1370 + AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1371   AC_SUBST(DYNGENSRCS)
1372   AC_SUBST(DYNGEN_CC)
1373   AC_SUBST(DYNGEN_OP_FLAGS)
# Line 1131 | Line 1385 | echo
1385   echo SheepShaver configuration summary:
1386   echo
1387   echo SDL support ...................... : $SDL_SUPPORT
1388 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1389   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1390   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1391   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines