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.9 by gbeauche, 2004-11-22T22:51:54Z vs.
Revision 1.33 by gbeauche, 2005-07-03T13:39:06Z

# Line 14 | Line 14 | dnl Some systems do not put corefiles in
14   dnl cores for the configure tests since some are intended to dump core.
15   ulimit -c 0
16  
17 + dnl Invite Cygwin users to build within the Windows/ directory
18 + case $target_os in
19 + *cygwin* | *mingw32*)
20 +  AC_MSG_ERROR([You can only build the Windows version from its directory, Cygwin/X11 is not supported.])
21 +  ;;
22 + esac
23 +
24   dnl Options.
25   AC_ARG_ENABLE(jit,          [  --enable-jit            enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
26   AC_ARG_ENABLE(ppc-emulator, [  --enable-ppc-emulator   use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
27 + 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])
28   AC_ARG_ENABLE(xf86-dga,     [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
29 < AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no])
29 > AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
30   AC_ARG_ENABLE(vosf,         [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
31   AC_ARG_WITH(esd,            [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
32 < AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
32 > AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]],
33 >  [case "$withval" in
34 >   gtk1)      WANT_GTK="gtk";;
35 >   gtk|gtk2)  WANT_GTK="$withval";;
36 >   yes)       WANT_GTK="gtk2 gtk";;
37 >   *)         WANT_GTK="no";;
38 >   esac],
39 >  [WANT_GTK="gtk2 gtk"])
40   AC_ARG_WITH(mon,            [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
41   AC_ARG_WITH(dgcc,           [  --with-dgcc=COMPILER    use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval])
42  
# Line 31 | Line 46 | AC_ARG_ENABLE(addressing,
46    [case "$enableval" in
47     real)        WANT_ADDRESSING_MODE="real";;
48     direct)      WANT_ADDRESSING_MODE="direct";;
49 <   direct,0x*)  WANT_ADDRESSING_MODE="direct"; NATMEM_OFFSET=`echo "$enableval" | sed -n '/direct,\(0[[xX]][[0-9A-Fa-f]]*\)/s//\1/p'`;;
49 >   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'`;;
50     esac],
51    [WANT_ADDRESSING_MODE="real"]
52   )
# Line 48 | Line 63 | AC_PROG_CXX
63   AC_PROG_MAKE_SET
64   AC_PROG_INSTALL
65   AC_PROG_EGREP
66 < AC_CHECK_PROGS(FILE, [file false])
66 > AC_PATH_PROGS(FILE, [file false])
67 > AC_PATH_PROG(PERL, [perl])
68  
69   dnl Check for PowerPC target CPU.
70   HAVE_PPC=no
# Line 105 | Line 121 | if [[ "x$WANT_MON" = "xyes" ]]; then
121      WANT_MON=no
122    fi
123   fi
124 + AC_SUBST(MONSRCS)
125  
126   dnl Checks for libraries.
127   AC_CHECK_LIB(posix4, sem_init)
# Line 125 | Line 142 | fi
142   if [[ "x$WANT_SDL" = "xyes" ]]; then
143    AC_PATH_PROG(sdl_config, "sdl-config")
144    if [[ -n "$sdl_config" ]]; then
145 <    case $target_os in
146 <    # Special treatment for Cygwin so that we can still use the POSIX layer
147 <    *cygwin*)
148 <      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
149 <      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
150 <      ;;
134 <    *)
135 <      sdl_cflags=`$sdl_config --cflags`
136 <      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
137 <        sdl_libs=`$sdl_config --static-libs`
138 <      else
139 <        sdl_libs=`$sdl_config --libs`
140 <      fi
141 <      ;;
142 <    esac
145 >    sdl_cflags=`$sdl_config --cflags`
146 >    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
147 >      sdl_libs=`$sdl_config --static-libs`
148 >    else
149 >      sdl_libs=`$sdl_config --libs`
150 >    fi
151      CFLAGS="$CFLAGS $sdl_cflags"
152      CXXFLAGS="$CXXFLAGS $sdl_cflags"
153      LIBS="$LIBS $sdl_libs"
154    else
155      WANT_SDL=no
156 +    WANT_SDL_VIDEO=no
157 +    WANT_SDL_AUDIO=no
158    fi
159    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
160   else
# Line 152 | Line 162 | else
162   fi
163  
164   dnl We need X11, if not using SDL.
165 < if [[ "x$WANT_SDL" = "xno" ]]; then
165 > if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; then
166    AC_PATH_XTRA
167    if [[ "x$no_x" = "xyes" ]]; then
168      AC_MSG_ERROR([You need X11 to run SheepShaver.])
# Line 165 | Line 175 | fi
175   dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
176   HAVE_PTHREADS=yes
177   case $EMULATED_PPC:$target_os in
178 < no:linux*)
178 > no:linux*|no:netbsd*)
179    dnl We do have our own pthread_cancel() implementation
180    AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.])
181    ;;
# Line 173 | Line 183 | no:linux*)
183    AC_CHECK_LIB(pthread, pthread_create, , [
184      AC_CHECK_LIB(c_r, pthread_create, , [
185        AC_CHECK_LIB(PTL, pthread_create, , [
186 <        AC_MSG_ERROR([You need pthreads to run Basilisk II.])
186 >        dnl XXX remove when no pthreads case is merged
187 >        AC_MSG_ERROR([You need pthreads to run SheepShaver.])
188 >        HAVE_PTHREADS=no
189        ])
190      ])
191    ])
192    AC_CHECK_FUNCS(pthread_cancel)
193 +  AC_CHECK_FUNCS(pthread_cond_init)
194    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
195    AC_CHECK_FUNCS(pthread_mutexattr_settype)
196    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
197    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
198    SEMSRC=
199    AC_CHECK_FUNCS(sem_init, , [
# Line 193 | Line 203 | no:linux*)
203    ])
204    ;;
205   esac
206 + if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
207 +  AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
208 + fi
209 +
210 + dnl We use FBDev DGA if possible.
211 + if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
212 +  AC_CHECK_HEADER(linux/fb.h, [
213 +    AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.])
214 +  ], [
215 +    AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.])
216 +    WANT_FBDEV_DGA=no
217 +  ])
218 + fi
219  
220   dnl We use XFree86 DGA if possible.
221   if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
# Line 218 | Line 241 | fi
241  
242   dnl We use GTK+ if possible.
243   UISRCS=../dummy/prefs_editor_dummy.cpp
244 < if [[ "x$WANT_GTK" = "xyes" ]]; then
244 > case "x$WANT_GTK" in
245 > xgtk2*)
246 >  AM_PATH_GTK_2_0(1.3.15, [
247 >    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
248 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
249 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
250 >    LIBS="$LIBS $GTK_LIBS"
251 >    UISRCS=prefs_editor_gtk.cpp
252 >    WANT_GTK=gtk2
253 >  ], [
254 >    case "x${WANT_GTK}x" in
255 >    *gtkx)
256 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
257 >      WANT_GTK=gtk
258 >      ;;
259 >    *)
260 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
261 >      WANT_GTK=no
262 >      ;;
263 >    esac
264 >  ])
265 >  ;;
266 > esac
267 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
268    AM_PATH_GTK(1.2.0, [
269      AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
270      CFLAGS="$CFLAGS $GTK_CFLAGS"
# Line 250 | Line 296 | AC_SYS_LARGEFILE
296   dnl Checks for header files.
297   AC_HEADER_STDC
298   AC_HEADER_SYS_WAIT
299 < AC_CHECK_HEADERS(malloc.h)
299 > AC_CHECK_HEADERS(malloc.h stdint.h)
300   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)
301   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
302 < AC_CHECK_HEADERS(linux/if.h, [], [], [
303 < #if HAVE_SYS_SOCKET_H
304 < # include <sys/socket.h>
302 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
303 > AC_CHECK_HEADERS(sys/time.h sys/poll.h sys/select.h arpa/inet.h)
304 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
305 > #ifdef HAVE_SYS_TYPES_H
306 > #include <sys/types.h>
307 > #endif
308 > #ifdef HAVE_SYS_SOCKET_H
309 > #include <sys/socket.h>
310   #endif
311   ])
312 < AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
312 > AC_CHECK_HEADERS(AvailabilityMacros.h)
313 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
314 > AC_CHECK_HEADERS(fenv.h)
315  
316   dnl Checks for typedefs, structures, and compiler characteristics.
317   AC_C_BIGENDIAN
# Line 295 | Line 347 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
347   fi
348  
349   dnl Checks for library functions.
350 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
350 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
351   AC_CHECK_FUNCS(nanosleep)
352   AC_CHECK_FUNCS(sigaction signal)
353   AC_CHECK_FUNCS(mmap mprotect munmap)
354   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
355 < AC_CHECK_FUNCS(posix_memalign memalign valloc)
355 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
356 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
357 > AC_CHECK_FUNCS(poll inet_aton)
358  
359   dnl Darwin seems to define mach_task_self() instead of task_self().
360   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 312 | Line 366 | no:linux*)
366    ;;
367   *:*)
368    AC_SEARCH_LIBS(clock_gettime, [rt posix4])
369 <  AC_CHECK_FUNCS(clock_gettime)
369 >  AC_CHECK_FUNCS(clock_gettime clock_nanosleep)
370    ;;
371   esac
372  
# Line 391 | Line 445 | EXTFSSRC=extfs_unix.cpp
445   EXTRASYSSRCS=
446   case "$target_os" in
447   linux*)
448 <  ETHERSRC=Linux/ether_linux.cpp
448 >  ETHERSRC=ether_unix.cpp
449    AUDIOSRC=audio_oss_esd.cpp
450    SCSISRC=Linux/scsi_linux.cpp
451    if [[ "x$EMULATED_PPC" = "xno" ]]; then
452 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
452 >    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
453 >  fi
454 >  ;;
455 > freebsd*)
456 >  ETHERSRC=ether_unix.cpp
457 >  ;;
458 > netbsd*)
459 >  ETHERSRC=ether_unix.cpp
460 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
461 >    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
462    fi
463    ;;
464   darwin*)
465 +  ETHERSRC=ether_unix.cpp
466    if [[ "x$EMULATED_PPC" = "xno" ]]; then
467 <    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
467 >    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
468    fi
469    if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
470      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
# Line 409 | Line 473 | darwin*)
473      EXTFSSRC=../MacOSX/extfs_macosx.mm
474    fi
475    ;;
412 cygwin*)
413  SERIALSRC="../dummy/serial_dummy.cpp"
414  ;;
476   esac
477  
478 + dnl Is the slirp library supported?
479 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
480 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
481 +  SLIRP_SRCS="\
482 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
483 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
484 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
485 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
486 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
487 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
488 + fi
489 + AC_SUBST(SLIRP_SRCS)
490 +
491   dnl SDL overrides
492   if [[ "x$WANT_SDL" = "xyes" ]]; then
493    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 425 | Line 499 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
499    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
500      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
501    else
502 <    case "$target_os" in
429 <    cygwin*)
430 <      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
431 <      ;;
432 <    *)
433 <      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
434 <      ;;
435 <    esac
502 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
503    fi
504   else
505    VIDEOSRCS="video_x.cpp"
# Line 444 | Line 511 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
511    AUDIOSRC="../SDL/audio_sdl.cpp"
512   fi
513  
514 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
514 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
515  
516   dnl Define a macro that translates a yesno-variable into a C macro definition
517   dnl to be put into the config.h file
# Line 860 | Line 927 | fi
927  
928   dnl Check addressing mode to use
929   AC_MSG_CHECKING([for addressing mode to use])
863 case "$os_target" in
864 cygwin*)
865  WANT_ADDRESSING_MODE="direct,cygwin-hack"
866  NATMEM_OFFSET=
867  ;;
868 esac
930   if [[ "$EMULATED_PPC" != "yes" ]]; then
931    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
932      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 916 | Line 977 | int main(void)
977                  memset(m, 0, ranges[[i]].size);
978                  vm_release(m, ranges[[i]].size);
979                  if (i == n_ranges - 1) {
980 <                        printf("0x%08x\n", ofs);
980 >                        if (sizeof(void *) == 8 && ofs > 0xffffffff)
981 >                                printf("0x%lxul\n", ofs);
982 >                        else
983 >                                printf("0x%08x\n", ofs);
984                          return 0;
985                  }
986          }
# Line 944 | Line 1008 | EOF
1008   fi
1009   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1010  
1011 + dnl Utility macro used by next two tests.
1012 + dnl AC_EXAMINE_OBJECT(C source code,
1013 + dnl     commands examining object file,
1014 + dnl     [commands to run if compile failed]):
1015 + dnl
1016 + dnl Compile the source code to an object file; then convert it into a
1017 + dnl printable representation.  All unprintable characters and
1018 + dnl asterisks (*) are replaced by dots (.).  All white space is
1019 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1020 + dnl output, but runs of newlines are compressed to a single newline.
1021 + dnl Finally, line breaks are forcibly inserted so that no line is
1022 + dnl longer than 80 columns and the file ends with a newline.  The
1023 + dnl result of all this processing is in the file conftest.dmp, which
1024 + dnl may be examined by the commands in the second argument.
1025 + dnl
1026 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1027 + [AC_LANG_SAVE
1028 + AC_LANG_C
1029 + dnl Next bit cribbed from AC_TRY_COMPILE.
1030 + cat > conftest.$ac_ext <<EOF
1031 + [#line __oline__ "configure"
1032 + #include "confdefs.h"
1033 + $1
1034 + ]EOF
1035 + if AC_TRY_EVAL(ac_compile); then
1036 +  od -c conftest.o |
1037 +    sed ['s/^[0-7]*[    ]*/ /
1038 +          s/\*/./g
1039 +          s/ \\n/*/g
1040 +          s/ [0-9][0-9][0-9]/./g
1041 +          s/  \\[^ ]/./g'] |
1042 +    tr -d '
1043 + ' | tr -s '*' '
1044 + ' | fold | sed '$a\
1045 + ' > conftest.dmp
1046 +  $2
1047 + ifelse($3, , , else
1048 +  $3
1049 + )dnl
1050 + fi
1051 + rm -rf conftest*
1052 + AC_LANG_RESTORE])
1053 +
1054 + dnl Floating point format probe.
1055 + dnl The basic concept is the same as the above: grep the object
1056 + dnl file for an interesting string.  We have to watch out for
1057 + dnl rounding changing the values in the object, however; this is
1058 + dnl handled by ignoring the least significant byte of the float.
1059 + dnl
1060 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1061 + dnl It does know about PDP-10 idiosyncratic format, but this is
1062 + dnl not presently supported by GCC.  S/390 "binary floating point"
1063 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1064 + dnl as ASCII?)
1065 + dnl
1066 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1067 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1068 + [gcc_AC_EXAMINE_OBJECT(
1069 + [/* This will not work unless sizeof(double) == 8.  */
1070 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1071 +
1072 + /* This structure must have no internal padding.  */
1073 + struct possibility {
1074 +  char prefix[8];
1075 +  double candidate;
1076 +  char postfix[8];
1077 + };
1078 +
1079 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1080 + struct possibility table [] =
1081 + {
1082 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1083 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1084 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1085 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1086 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1087 + };],
1088 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1089 +    ac_cv_c_float_format='IEEE (big-endian)'
1090 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1091 +    ac_cv_c_float_format='IEEE (big-endian)'
1092 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1093 +    ac_cv_c_float_format='IEEE (little-endian)'
1094 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1095 +    ac_cv_c_float_format='IEEE (little-endian)'
1096 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1097 +    ac_cv_c_float_format='VAX D-float'
1098 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1099 +    ac_cv_c_float_format='PDP-10'
1100 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1101 +    ac_cv_c_float_format='IBM 370 hex'
1102 +  else
1103 +    AC_MSG_ERROR(Unknown floating point format)
1104 +  fi],
1105 +  [AC_MSG_ERROR(compile failed)])
1106 + ])
1107 + # IEEE is the default format.  If the float endianness isn't the same
1108 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1109 + # (which is a tristate: yes, no, default).  This is only an issue with
1110 + # IEEE; the other formats are only supported by a few machines each,
1111 + # all with the same endianness.
1112 + format=IEEE_FLOAT_FORMAT
1113 + fbigend=
1114 + case $ac_cv_c_float_format in
1115 +    'IEEE (big-endian)' )
1116 +        if test $ac_cv_c_bigendian = no; then
1117 +            fbigend=1
1118 +        fi
1119 +        ;;
1120 +    'IEEE (little-endian)' )
1121 +        if test $ac_cv_c_bigendian = yes; then
1122 +            fbigend=0
1123 +        fi
1124 +        ;;
1125 +    'VAX D-float' )
1126 +        format=VAX_FLOAT_FORMAT
1127 +        ;;
1128 +    'PDP-10' )
1129 +        format=PDP10_FLOAT_FORMAT
1130 +        ;;
1131 +    'IBM 370 hex' )
1132 +        format=IBM_FLOAT_FORMAT
1133 +        ;;
1134 + esac
1135 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1136 +  [Define to the floating point format of the host machine.])
1137 + if test -n "$fbigend"; then
1138 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1139 +  [Define to 1 if the host machine stores floating point numbers in
1140 +   memory with the word containing the sign bit at the lowest address,
1141 +   or to 0 if it does it the other way around.
1142 +
1143 +   This macro should not be defined if the ordering is the same as for
1144 +   multi-word integers.])
1145 + fi
1146 + ])
1147 +
1148 + dnl Check for host float format
1149 + gcc_AC_C_FLOAT_FORMAT
1150 +
1151   dnl Platform specific binary postprocessor
1152   AC_PATH_PROG(BLESS, "true")
1153   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 978 | Line 1182 | fi
1182   AC_MSG_RESULT($HAVE_ICC)
1183  
1184   dnl Determine the generated object format
1185 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1185 > AC_CACHE_CHECK([the format of compiler generated objects],
1186    ac_cv_object_format, [
1187    echo 'int i;' > conftest.$ac_ext
1188    ac_cv_object_format=no
# Line 987 | Line 1191 | AC_CACHE_CHECK([whether the compiler can
1191      *"ELF"*)
1192        ac_cv_object_format=elf
1193        ;;
1194 +    *"Mach-O"*)
1195 +      ac_cv_object_format=mach
1196 +      ;;
1197      *)
1198        ac_cv_object_format=unknown
1199        ;;
# Line 995 | Line 1202 | AC_CACHE_CHECK([whether the compiler can
1202    rm -rf conftest*
1203   ])
1204  
1205 + dnl Add -fno-strict-aliasing for slirp sources
1206 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1207 +  SAVED_CFLAGS="$CFLAGS"
1208 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1209 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1210 +    ac_cv_gcc_no_strict_aliasing, [
1211 +    AC_TRY_COMPILE([],[],
1212 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1213 +      [ac_cv_gcc_no_strict_aliasing=no])
1214 +  ])
1215 +  CFLAGS="$SAVED_CFLAGS"
1216 + fi
1217 +
1218 + dnl Add -mdynamic-no-pic for MacOS X
1219 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1220 +  SAVED_CFLAGS="$CFLAGS"
1221 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1222 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1223 +    ac_cv_gcc_mdynamic_no_pic, [
1224 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1225 +  ])
1226 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1227 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1228 +  else
1229 +    CFLAGS="$SAVED_CFLAGS"
1230 +  fi
1231 + fi
1232 +
1233   dnl CPU emulator sources
1234   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1235    CPUSRCS="\
1236      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1237 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1238      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1239      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1240      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 1019 | Line 1255 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1255        i?86:elf)
1256          ac_cv_use_dyngen=yes
1257          ;;
1258 +      powerpc:mach)
1259 +        ac_cv_use_dyngen=yes
1260 +        ;;
1261        *:*)
1262          ac_cv_use_dyngen=no
1263          ;;
# Line 1036 | Line 1275 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1275            done
1276          fi
1277        fi
1278 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1278 >      if [[ -z "$DYNGEN_CC" ]]; then
1279          ac_cv_use_dyngen=no
1280        fi
1281      ])
# Line 1044 | Line 1283 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1283        case $host_cpu in
1284        i?86)
1285          DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1047        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1048          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1049        else
1050          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1051        fi
1052        saved_CPPFLAGS=$CPPFLAGS
1053        CPPFLAGS="$CPPFLAGS -mmmx"
1054        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
1055        CPPFLAGS="$CPPFLAGS -msse"
1056        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
1057        CPPFLAGS="$CPPFLAGS -msse2"
1058        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
1059        CPPFLAGS=$saved_CPPFLAGS
1286          ;;
1287 <      x86_64)
1288 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1287 >      powerpc)
1288 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1289 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1290 >        fi
1291          ;;
1292        esac
1293 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
1293 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1294 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1295 >      else
1296 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1297 >      fi
1298 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1299        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1300          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1301        fi
# Line 1088 | Line 1321 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1321    AC_CACHE_CHECK([whether static data regions are executable],
1322      ac_cv_have_static_data_exec, [
1323      AC_TRY_RUN([int main(void) {
1324 < #if defined(__powerpc__)
1324 > #if defined(__powerpc__) || defined(__ppc__)
1325        static unsigned int p[8] = {0x4e800020,};
1326        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1327        asm volatile("sync" : : : "memory");
# Line 1104 | Line 1337 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1337      ac_cv_have_static_data_exec=no
1338      )
1339    ])
1340 + else
1341 +  ac_cv_use_dyngen=no
1342   fi
1343   AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1344    [Define if your system marks static data pages as executable.])
# Line 1113 | Line 1348 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1348   fi
1349  
1350   dnl Generate Makefile.
1351 + AC_SUBST(PERL)
1352 + AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1353   AC_SUBST(DYNGENSRCS)
1354   AC_SUBST(DYNGEN_CC)
1355   AC_SUBST(DYNGEN_OP_FLAGS)
# Line 1130 | Line 1367 | echo
1367   echo SheepShaver configuration summary:
1368   echo
1369   echo SDL support ...................... : $SDL_SUPPORT
1370 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1371   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1372   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1373   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines