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.40 by gbeauche, 2005-11-30T00:02:25Z

# 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 127 | 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 <      ;;
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
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"
# Line 177 | Line 183 | no:linux*|no:netbsd*)
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 pthread_testcancel)
194    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
195    AC_CHECK_FUNCS(pthread_mutexattr_settype)
196    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
197    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
198    SEMSRC=
199    AC_CHECK_FUNCS(sem_init, , [
# Line 197 | Line 203 | no:linux*|no:netbsd*)
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 222 | 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 254 | 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)
259 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.
# Line 284 | Line 331 | AC_TYPE_SIGNAL
331   AC_HEADER_TIME
332   AC_STRUCT_TM
333  
334 + dnl Check whether sys/socket.h defines type socklen_t.
335 + dnl (extracted from ac-archive/Miscellaneous)
336 + AC_CACHE_CHECK([for socklen_t],
337 +  ac_cv_type_socklen_t, [
338 +  AC_TRY_COMPILE([
339 +    #include <sys/types.h>
340 +    #include <sys/socket.h>
341 +  ], [socklen_t len = 42; return 0;],
342 +  ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
343 +  dnl When cross-compiling, do not assume anything.
344 +  ac_cv_type_socklen_t="guessing no"
345 +  )
346 + ])
347 + if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
348 +  AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
349 + fi
350 +
351   dnl Check whether struct sigaction has sa_restorer member.
352   AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
353    ac_cv_signal_sa_restorer, [
# Line 300 | Line 364 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
364   fi
365  
366   dnl Checks for library functions.
367 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
367 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
368   AC_CHECK_FUNCS(nanosleep)
369   AC_CHECK_FUNCS(sigaction signal)
370   AC_CHECK_FUNCS(mmap mprotect munmap)
371   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
372 < AC_CHECK_FUNCS(posix_memalign memalign valloc)
373 < AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc)
372 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
373 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
374 > AC_CHECK_FUNCS(poll inet_aton)
375  
376   dnl Darwin seems to define mach_task_self() instead of task_self().
377   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 387 | Line 452 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
452   dnl Check for some MacOS X frameworks
453   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
454   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
455 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
456  
457   dnl Select system-dependant sources.
458   SERIALSRC=serial_unix.cpp
# Line 397 | Line 463 | EXTFSSRC=extfs_unix.cpp
463   EXTRASYSSRCS=
464   case "$target_os" in
465   linux*)
466 <  ETHERSRC=Linux/ether_linux.cpp
466 >  ETHERSRC=ether_unix.cpp
467    AUDIOSRC=audio_oss_esd.cpp
468    SCSISRC=Linux/scsi_linux.cpp
469    if [[ "x$EMULATED_PPC" = "xno" ]]; then
470 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
470 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
471    fi
472    ;;
473 + freebsd*)
474 +  ETHERSRC=ether_unix.cpp
475 +  ;;
476   netbsd*)
477 +  ETHERSRC=ether_unix.cpp
478    if [[ "x$EMULATED_PPC" = "xno" ]]; then
479 <    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
479 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
480    fi
481    ;;
482   darwin*)
483 +  ETHERSRC=ether_unix.cpp
484    if [[ "x$EMULATED_PPC" = "xno" ]]; then
485 <    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
485 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
486    fi
487 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
487 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
488      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
489    fi
490    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
491      EXTFSSRC=../MacOSX/extfs_macosx.mm
492    fi
493    ;;
423 cygwin*)
424  SERIALSRC="../dummy/serial_dummy.cpp"
425  ;;
494   esac
495  
496 + dnl Is the slirp library supported?
497 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
498 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
499 +  SLIRP_SRCS="\
500 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
501 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
502 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
503 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
504 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
505 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
506 + fi
507 + AC_SUBST(SLIRP_SRCS)
508 +
509   dnl SDL overrides
510   if [[ "x$WANT_SDL" = "xyes" ]]; then
511    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 436 | Line 517 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
517    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
518      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
519    else
520 <    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
520 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
521    fi
522   else
523    VIDEOSRCS="video_x.cpp"
# Line 871 | Line 945 | fi
945  
946   dnl Check addressing mode to use
947   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
948   if [[ "$EMULATED_PPC" != "yes" ]]; then
949    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
950      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 958 | 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 968 | Line 1176 | fi
1176   dnl Check for GCC 2.7 or higher.
1177   HAVE_GCC27=no
1178   AC_MSG_CHECKING(for GCC 2.7 or higher)
1179 < AC_EGREP_CPP(xyes,
1180 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1181 <  xyes
1182 < #endif
1183 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1179 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1180 >                                     # error gcc < 2.7
1181 >                                     #endif
1182 >                                   ]])],
1183 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1184 >                  [AC_MSG_RESULT(no)])
1185  
1186   dnl Check for GCC 3.0 or higher.
1187   HAVE_GCC30=no
1188   AC_MSG_CHECKING(for GCC 3.0 or higher)
1189 < AC_EGREP_CPP(xyes,
1190 < [#if __GNUC__ >= 3
1191 <  xyes
1192 < #endif
1193 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1189 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1190 >                                     # error gcc < 3
1191 >                                     #endif
1192 >                                   ]])],
1193 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1194 >                  [AC_MSG_RESULT(no)])
1195  
1196   dnl Check for ICC.
1197   AC_MSG_CHECKING(for ICC)
# Line 992 | Line 1202 | fi
1202   AC_MSG_RESULT($HAVE_ICC)
1203  
1204   dnl Determine the generated object format
1205 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1205 > AC_CACHE_CHECK([the format of compiler generated objects],
1206    ac_cv_object_format, [
1207    echo 'int i;' > conftest.$ac_ext
1208    ac_cv_object_format=no
# Line 1001 | Line 1211 | AC_CACHE_CHECK([whether the compiler can
1211      *"ELF"*)
1212        ac_cv_object_format=elf
1213        ;;
1214 +    *"Mach-O"*)
1215 +      ac_cv_object_format=mach
1216 +      ;;
1217      *)
1218        ac_cv_object_format=unknown
1219        ;;
# Line 1009 | Line 1222 | AC_CACHE_CHECK([whether the compiler can
1222    rm -rf conftest*
1223   ])
1224  
1225 + dnl Add -fno-strict-aliasing for slirp sources
1226 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1227 +  SAVED_CFLAGS="$CFLAGS"
1228 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1229 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1230 +    ac_cv_gcc_no_strict_aliasing, [
1231 +    AC_TRY_COMPILE([],[],
1232 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1233 +      [ac_cv_gcc_no_strict_aliasing=no])
1234 +  ])
1235 +  CFLAGS="$SAVED_CFLAGS"
1236 + fi
1237 +
1238 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1239 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1240 +  SAVED_CFLAGS="$CFLAGS"
1241 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1242 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1243 +    ac_cv_gcc_mdynamic_no_pic, [
1244 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1245 +  ])
1246 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1247 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1248 +  else
1249 +    CFLAGS="$SAVED_CFLAGS"
1250 +  fi
1251 + fi
1252 +
1253   dnl CPU emulator sources
1254   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1255    CPUSRCS="\
1256      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1257 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1258      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1259      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1260      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 1033 | Line 1275 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1275        i?86:elf)
1276          ac_cv_use_dyngen=yes
1277          ;;
1278 +      powerpc:mach)
1279 +        ac_cv_use_dyngen=yes
1280 +        ;;
1281        *:*)
1282          ac_cv_use_dyngen=no
1283          ;;
# Line 1050 | Line 1295 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1295            done
1296          fi
1297        fi
1298 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1298 >      if [[ -z "$DYNGEN_CC" ]]; then
1299          ac_cv_use_dyngen=no
1300        fi
1301      ])
# Line 1058 | Line 1303 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1303        case $host_cpu in
1304        i?86)
1305          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
1306          ;;
1307 <      x86_64)
1308 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1307 >      powerpc)
1308 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1309 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1310 >        fi
1311          ;;
1312        esac
1313 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0"
1313 >      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1314 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1315 >      else
1316 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1317 >      fi
1318 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1319        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1320          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1321        fi
# Line 1102 | Line 1341 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1341    AC_CACHE_CHECK([whether static data regions are executable],
1342      ac_cv_have_static_data_exec, [
1343      AC_TRY_RUN([int main(void) {
1344 < #if defined(__powerpc__)
1344 > #if defined(__powerpc__) || defined(__ppc__)
1345        static unsigned int p[8] = {0x4e800020,};
1346        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1347        asm volatile("sync" : : : "memory");
# Line 1148 | Line 1387 | echo
1387   echo SheepShaver configuration summary:
1388   echo
1389   echo SDL support ...................... : $SDL_SUPPORT
1390 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1391   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1392   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1393   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines