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.42 by gbeauche, 2005-12-04T16:26:57Z

# Line 1 | Line 1
1   dnl Process this file with autoconf to produce a configure script.
2   dnl Written in 2002 by Christian Bauer
3  
4 < AC_INIT([SheepShaver], 2.2, [Christian.Bauer@uni-mainz.de], SheepShaver)
4 > AC_INIT([SheepShaver], 2.3, [Christian.Bauer@uni-mainz.de], SheepShaver)
5   AC_CONFIG_SRCDIR(main_unix.cpp)
6   AC_PREREQ(2.52)
7   AC_CONFIG_HEADER(config.h)
# 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 110 | Line 125 | AC_SUBST(MONSRCS)
125  
126   dnl Checks for libraries.
127   AC_CHECK_LIB(posix4, sem_init)
128 + AC_CHECK_LIB(m, cos)
129  
130   dnl Do we need SDL?
131   WANT_SDL=no
# Line 127 | Line 143 | fi
143   if [[ "x$WANT_SDL" = "xyes" ]]; then
144    AC_PATH_PROG(sdl_config, "sdl-config")
145    if [[ -n "$sdl_config" ]]; then
146 <    case $target_os in
147 <    # Special treatment for Cygwin so that we can still use the POSIX layer
148 <    *cygwin*)
149 <      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
150 <      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
151 <      ;;
136 <    *)
137 <      sdl_cflags=`$sdl_config --cflags`
138 <      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
139 <        sdl_libs=`$sdl_config --static-libs`
140 <      else
141 <        sdl_libs=`$sdl_config --libs`
142 <      fi
143 <      ;;
144 <    esac
146 >    sdl_cflags=`$sdl_config --cflags`
147 >    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
148 >      sdl_libs=`$sdl_config --static-libs`
149 >    else
150 >      sdl_libs=`$sdl_config --libs`
151 >    fi
152      CFLAGS="$CFLAGS $sdl_cflags"
153      CXXFLAGS="$CXXFLAGS $sdl_cflags"
154      LIBS="$LIBS $sdl_libs"
# Line 177 | Line 184 | no:linux*|no:netbsd*)
184    AC_CHECK_LIB(pthread, pthread_create, , [
185      AC_CHECK_LIB(c_r, pthread_create, , [
186        AC_CHECK_LIB(PTL, pthread_create, , [
187 <        AC_MSG_ERROR([You need pthreads to run Basilisk II.])
187 >        dnl XXX remove when no pthreads case is merged
188 >        AC_MSG_ERROR([You need pthreads to run SheepShaver.])
189 >        HAVE_PTHREADS=no
190        ])
191      ])
192    ])
193    AC_CHECK_FUNCS(pthread_cancel)
194 +  AC_CHECK_FUNCS(pthread_cond_init pthread_testcancel)
195    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
196    AC_CHECK_FUNCS(pthread_mutexattr_settype)
197    AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
188  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
189    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
190  fi
198    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
199    SEMSRC=
200    AC_CHECK_FUNCS(sem_init, , [
# Line 197 | Line 204 | no:linux*|no:netbsd*)
204    ])
205    ;;
206   esac
207 + if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
208 +  AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
209 + fi
210 +
211 + dnl We use FBDev DGA if possible.
212 + if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
213 +  AC_CHECK_HEADER(linux/fb.h, [
214 +    AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.])
215 +  ], [
216 +    AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.])
217 +    WANT_FBDEV_DGA=no
218 +  ])
219 + fi
220  
221   dnl We use XFree86 DGA if possible.
222   if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
# Line 222 | Line 242 | fi
242  
243   dnl We use GTK+ if possible.
244   UISRCS=../dummy/prefs_editor_dummy.cpp
245 < if [[ "x$WANT_GTK" = "xyes" ]]; then
245 > case "x$WANT_GTK" in
246 > xgtk2*)
247 >  AM_PATH_GTK_2_0(1.3.15, [
248 >    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
249 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
250 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
251 >    LIBS="$LIBS $GTK_LIBS"
252 >    UISRCS=prefs_editor_gtk.cpp
253 >    WANT_GTK=gtk2
254 >  ], [
255 >    case "x${WANT_GTK}x" in
256 >    *gtkx)
257 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
258 >      WANT_GTK=gtk
259 >      ;;
260 >    *)
261 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
262 >      WANT_GTK=no
263 >      ;;
264 >    esac
265 >  ])
266 >  ;;
267 > esac
268 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
269    AM_PATH_GTK(1.2.0, [
270      AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
271      CFLAGS="$CFLAGS $GTK_CFLAGS"
# Line 254 | Line 297 | AC_SYS_LARGEFILE
297   dnl Checks for header files.
298   AC_HEADER_STDC
299   AC_HEADER_SYS_WAIT
300 < AC_CHECK_HEADERS(malloc.h)
300 > AC_CHECK_HEADERS(malloc.h stdint.h)
301   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
259 AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
302   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
303 < AC_CHECK_HEADERS(linux/if.h, [], [], [
304 < #if HAVE_SYS_SOCKET_H
305 < # include <sys/socket.h>
303 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
304 > AC_CHECK_HEADERS(sys/time.h sys/poll.h sys/select.h arpa/inet.h)
305 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
306 > #ifdef HAVE_SYS_TYPES_H
307 > #include <sys/types.h>
308 > #endif
309 > #ifdef HAVE_SYS_SOCKET_H
310 > #include <sys/socket.h>
311   #endif
312   ])
313 < AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
313 > AC_CHECK_HEADERS(AvailabilityMacros.h)
314 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
315   AC_CHECK_HEADERS(fenv.h)
316  
317   dnl Checks for typedefs, structures, and compiler characteristics.
# Line 284 | Line 332 | AC_TYPE_SIGNAL
332   AC_HEADER_TIME
333   AC_STRUCT_TM
334  
335 + dnl Check whether sys/socket.h defines type socklen_t.
336 + dnl (extracted from ac-archive/Miscellaneous)
337 + AC_CACHE_CHECK([for socklen_t],
338 +  ac_cv_type_socklen_t, [
339 +  AC_TRY_COMPILE([
340 +    #include <sys/types.h>
341 +    #include <sys/socket.h>
342 +  ], [socklen_t len = 42; return 0;],
343 +  ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
344 +  dnl When cross-compiling, do not assume anything.
345 +  ac_cv_type_socklen_t="guessing no"
346 +  )
347 + ])
348 + if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
349 +  AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
350 + fi
351 +
352   dnl Check whether struct sigaction has sa_restorer member.
353   AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
354    ac_cv_signal_sa_restorer, [
# Line 300 | Line 365 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
365   fi
366  
367   dnl Checks for library functions.
368 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
368 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
369   AC_CHECK_FUNCS(nanosleep)
370   AC_CHECK_FUNCS(sigaction signal)
371   AC_CHECK_FUNCS(mmap mprotect munmap)
372   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
373 < AC_CHECK_FUNCS(posix_memalign memalign valloc)
374 < AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc)
373 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
374 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
375 > AC_CHECK_FUNCS(poll inet_aton)
376  
377   dnl Darwin seems to define mach_task_self() instead of task_self().
378   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 387 | Line 453 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
453   dnl Check for some MacOS X frameworks
454   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
455   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
456 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
457  
458   dnl Select system-dependant sources.
459   SERIALSRC=serial_unix.cpp
# Line 397 | Line 464 | EXTFSSRC=extfs_unix.cpp
464   EXTRASYSSRCS=
465   case "$target_os" in
466   linux*)
467 <  ETHERSRC=Linux/ether_linux.cpp
467 >  ETHERSRC=ether_unix.cpp
468    AUDIOSRC=audio_oss_esd.cpp
469    SCSISRC=Linux/scsi_linux.cpp
470    if [[ "x$EMULATED_PPC" = "xno" ]]; then
471 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
471 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
472    fi
473    ;;
474 + freebsd*)
475 +  ETHERSRC=ether_unix.cpp
476 +  ;;
477   netbsd*)
478 +  ETHERSRC=ether_unix.cpp
479    if [[ "x$EMULATED_PPC" = "xno" ]]; then
480 <    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
480 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
481    fi
482    ;;
483   darwin*)
484 +  ETHERSRC=ether_unix.cpp
485    if [[ "x$EMULATED_PPC" = "xno" ]]; then
486 <    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
486 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
487    fi
488 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
488 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
489      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
490    fi
491    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
492      EXTFSSRC=../MacOSX/extfs_macosx.mm
493    fi
494    ;;
495 < cygwin*)
496 <  SERIALSRC="../dummy/serial_dummy.cpp"
495 > irix*)
496 >  ETHERSRC=ether_unix.cpp
497 >  AUDIOSRC=Irix/audio_irix.cpp
498 >  LIBS="$LIBS -laudio"
499 >  WANT_ESD=no
500    ;;
501   esac
502  
503 + dnl Is the slirp library supported?
504 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
505 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
506 +  SLIRP_SRCS="\
507 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
508 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
509 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
510 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
511 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
512 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
513 + fi
514 + AC_SUBST(SLIRP_SRCS)
515 +
516   dnl SDL overrides
517   if [[ "x$WANT_SDL" = "xyes" ]]; then
518    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 436 | Line 524 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
524    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
525      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
526    else
527 <    case "$target_os" in
440 <    cygwin*)
441 <      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
442 <      ;;
443 <    *)
444 <      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
445 <      ;;
446 <    esac
527 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
528    fi
529   else
530    VIDEOSRCS="video_x.cpp"
# Line 871 | Line 952 | fi
952  
953   dnl Check addressing mode to use
954   AC_MSG_CHECKING([for addressing mode to use])
874 case "$os_target" in
875 cygwin*)
876  WANT_ADDRESSING_MODE="direct,cygwin-hack"
877  NATMEM_OFFSET=
878  ;;
879 esac
955   if [[ "$EMULATED_PPC" != "yes" ]]; then
956    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
957      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 958 | Line 1033 | EOF
1033   fi
1034   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1035  
1036 + dnl Utility macro used by next two tests.
1037 + dnl AC_EXAMINE_OBJECT(C source code,
1038 + dnl     commands examining object file,
1039 + dnl     [commands to run if compile failed]):
1040 + dnl
1041 + dnl Compile the source code to an object file; then convert it into a
1042 + dnl printable representation.  All unprintable characters and
1043 + dnl asterisks (*) are replaced by dots (.).  All white space is
1044 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1045 + dnl output, but runs of newlines are compressed to a single newline.
1046 + dnl Finally, line breaks are forcibly inserted so that no line is
1047 + dnl longer than 80 columns and the file ends with a newline.  The
1048 + dnl result of all this processing is in the file conftest.dmp, which
1049 + dnl may be examined by the commands in the second argument.
1050 + dnl
1051 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1052 + [AC_LANG_SAVE
1053 + AC_LANG_C
1054 + dnl Next bit cribbed from AC_TRY_COMPILE.
1055 + cat > conftest.$ac_ext <<EOF
1056 + [#line __oline__ "configure"
1057 + #include "confdefs.h"
1058 + $1
1059 + ]EOF
1060 + if AC_TRY_EVAL(ac_compile); then
1061 +  od -c conftest.o |
1062 +    sed ['s/^[0-7]*[    ]*/ /
1063 +          s/\*/./g
1064 +          s/ \\n/*/g
1065 +          s/ [0-9][0-9][0-9]/./g
1066 +          s/  \\[^ ]/./g'] |
1067 +    tr -d '
1068 + ' | tr -s '*' '
1069 + ' | fold | sed '$a\
1070 + ' > conftest.dmp
1071 +  $2
1072 + ifelse($3, , , else
1073 +  $3
1074 + )dnl
1075 + fi
1076 + rm -rf conftest*
1077 + AC_LANG_RESTORE])
1078 +
1079 + dnl Floating point format probe.
1080 + dnl The basic concept is the same as the above: grep the object
1081 + dnl file for an interesting string.  We have to watch out for
1082 + dnl rounding changing the values in the object, however; this is
1083 + dnl handled by ignoring the least significant byte of the float.
1084 + dnl
1085 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1086 + dnl It does know about PDP-10 idiosyncratic format, but this is
1087 + dnl not presently supported by GCC.  S/390 "binary floating point"
1088 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1089 + dnl as ASCII?)
1090 + dnl
1091 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1092 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1093 + [gcc_AC_EXAMINE_OBJECT(
1094 + [/* This will not work unless sizeof(double) == 8.  */
1095 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1096 +
1097 + /* This structure must have no internal padding.  */
1098 + struct possibility {
1099 +  char prefix[8];
1100 +  double candidate;
1101 +  char postfix[8];
1102 + };
1103 +
1104 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1105 + struct possibility table [] =
1106 + {
1107 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1108 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1109 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1110 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1111 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1112 + };],
1113 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1114 +    ac_cv_c_float_format='IEEE (big-endian)'
1115 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1116 +    ac_cv_c_float_format='IEEE (big-endian)'
1117 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1118 +    ac_cv_c_float_format='IEEE (little-endian)'
1119 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1120 +    ac_cv_c_float_format='IEEE (little-endian)'
1121 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1122 +    ac_cv_c_float_format='VAX D-float'
1123 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1124 +    ac_cv_c_float_format='PDP-10'
1125 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1126 +    ac_cv_c_float_format='IBM 370 hex'
1127 +  else
1128 +    AC_MSG_ERROR(Unknown floating point format)
1129 +  fi],
1130 +  [AC_MSG_ERROR(compile failed)])
1131 + ])
1132 + # IEEE is the default format.  If the float endianness isn't the same
1133 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1134 + # (which is a tristate: yes, no, default).  This is only an issue with
1135 + # IEEE; the other formats are only supported by a few machines each,
1136 + # all with the same endianness.
1137 + format=IEEE_FLOAT_FORMAT
1138 + fbigend=
1139 + case $ac_cv_c_float_format in
1140 +    'IEEE (big-endian)' )
1141 +        if test $ac_cv_c_bigendian = no; then
1142 +            fbigend=1
1143 +        fi
1144 +        ;;
1145 +    'IEEE (little-endian)' )
1146 +        if test $ac_cv_c_bigendian = yes; then
1147 +            fbigend=0
1148 +        fi
1149 +        ;;
1150 +    'VAX D-float' )
1151 +        format=VAX_FLOAT_FORMAT
1152 +        ;;
1153 +    'PDP-10' )
1154 +        format=PDP10_FLOAT_FORMAT
1155 +        ;;
1156 +    'IBM 370 hex' )
1157 +        format=IBM_FLOAT_FORMAT
1158 +        ;;
1159 + esac
1160 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1161 +  [Define to the floating point format of the host machine.])
1162 + if test -n "$fbigend"; then
1163 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1164 +  [Define to 1 if the host machine stores floating point numbers in
1165 +   memory with the word containing the sign bit at the lowest address,
1166 +   or to 0 if it does it the other way around.
1167 +
1168 +   This macro should not be defined if the ordering is the same as for
1169 +   multi-word integers.])
1170 + fi
1171 + ])
1172 +
1173 + dnl Check for host float format
1174 + gcc_AC_C_FLOAT_FORMAT
1175 +
1176   dnl Platform specific binary postprocessor
1177   AC_PATH_PROG(BLESS, "true")
1178   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 968 | Line 1183 | fi
1183   dnl Check for GCC 2.7 or higher.
1184   HAVE_GCC27=no
1185   AC_MSG_CHECKING(for GCC 2.7 or higher)
1186 < AC_EGREP_CPP(xyes,
1187 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1188 <  xyes
1189 < #endif
1190 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1186 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1187 >                                     # error gcc < 2.7
1188 >                                     #endif
1189 >                                   ]])],
1190 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1191 >                  [AC_MSG_RESULT(no)])
1192  
1193   dnl Check for GCC 3.0 or higher.
1194   HAVE_GCC30=no
1195   AC_MSG_CHECKING(for GCC 3.0 or higher)
1196 < AC_EGREP_CPP(xyes,
1197 < [#if __GNUC__ >= 3
1198 <  xyes
1199 < #endif
1200 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1196 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1197 >                                     # error gcc < 3
1198 >                                     #endif
1199 >                                   ]])],
1200 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1201 >                  [AC_MSG_RESULT(no)])
1202  
1203   dnl Check for ICC.
1204   AC_MSG_CHECKING(for ICC)
# Line 992 | Line 1209 | fi
1209   AC_MSG_RESULT($HAVE_ICC)
1210  
1211   dnl Determine the generated object format
1212 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1212 > AC_CACHE_CHECK([the format of compiler generated objects],
1213    ac_cv_object_format, [
1214    echo 'int i;' > conftest.$ac_ext
1215    ac_cv_object_format=no
# Line 1001 | Line 1218 | AC_CACHE_CHECK([whether the compiler can
1218      *"ELF"*)
1219        ac_cv_object_format=elf
1220        ;;
1221 +    *"Mach-O"*)
1222 +      ac_cv_object_format=mach
1223 +      ;;
1224      *)
1225        ac_cv_object_format=unknown
1226        ;;
# Line 1009 | Line 1229 | AC_CACHE_CHECK([whether the compiler can
1229    rm -rf conftest*
1230   ])
1231  
1232 + dnl Add -fno-strict-aliasing for slirp sources
1233 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1234 +  SAVED_CFLAGS="$CFLAGS"
1235 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1236 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1237 +    ac_cv_gcc_no_strict_aliasing, [
1238 +    AC_TRY_COMPILE([],[],
1239 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1240 +      [ac_cv_gcc_no_strict_aliasing=no])
1241 +  ])
1242 +  CFLAGS="$SAVED_CFLAGS"
1243 + fi
1244 +
1245 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1246 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1247 +  SAVED_CFLAGS="$CFLAGS"
1248 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1249 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1250 +    ac_cv_gcc_mdynamic_no_pic, [
1251 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1252 +  ])
1253 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1254 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1255 +  else
1256 +    CFLAGS="$SAVED_CFLAGS"
1257 +  fi
1258 + fi
1259 +
1260   dnl CPU emulator sources
1261   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1262    CPUSRCS="\
1263      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1264 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1265      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1266      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1267      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 1033 | Line 1282 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1282        i?86:elf)
1283          ac_cv_use_dyngen=yes
1284          ;;
1285 +      powerpc:mach)
1286 +        ac_cv_use_dyngen=yes
1287 +        ;;
1288 +      i?86:mach)
1289 +        ac_cv_use_dyngen=yes
1290 +        ;;
1291        *:*)
1292          ac_cv_use_dyngen=no
1293          ;;
# Line 1050 | Line 1305 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1305            done
1306          fi
1307        fi
1308 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1308 >      if [[ -z "$DYNGEN_CC" ]]; then
1309          ac_cv_use_dyngen=no
1310        fi
1311      ])
# Line 1058 | Line 1313 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1313        case $host_cpu in
1314        i?86)
1315          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
1316          ;;
1317 <      x86_64)
1318 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1317 >      powerpc)
1318 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1319 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1320 >        fi
1321          ;;
1322        esac
1323 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0"
1323 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1324 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1325 >      else
1326 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1327 >      fi
1328 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1329        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1330          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1331        fi
# Line 1102 | Line 1351 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1351    AC_CACHE_CHECK([whether static data regions are executable],
1352      ac_cv_have_static_data_exec, [
1353      AC_TRY_RUN([int main(void) {
1354 < #if defined(__powerpc__)
1354 > #if defined(__powerpc__) || defined(__ppc__)
1355        static unsigned int p[8] = {0x4e800020,};
1356        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1357        asm volatile("sync" : : : "memory");
# Line 1148 | Line 1397 | echo
1397   echo SheepShaver configuration summary:
1398   echo
1399   echo SDL support ...................... : $SDL_SUPPORT
1400 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1401   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1402   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1403   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines