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.25 by gbeauche, 2005-06-14T06:35:00Z vs.
Revision 1.48 by gbeauche, 2006-01-27T23:48:08Z

# 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])
# Line 118 | 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 135 | 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 <      ;;
144 <    *)
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 <      ;;
152 <    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 185 | 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)
196  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
197    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
198  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 205 | 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
# Line 295 | 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)
300 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 325 | 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 341 | 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 407 | Line 432 | AC_CHECK_FILE([/dev/ptc],
432   )
433   dnl (end of code from openssh-3.2.2p1 configure.ac)
434  
435 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
436 + dnl doesn't work or is unimplemented. On these systems (mostly older
437 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
438 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
439 +  ac_cv_nonblocking_io, [
440 +  case "$host" in
441 +  *-*-osf*)
442 +    ac_cv_nonblocking_io=FIONBIO
443 +    ;;
444 +  *-*-sunos4*)
445 +    ac_cv_nonblocking_io=FIONBIO
446 +    ;;
447 +  *-*-ultrix*)
448 +    ac_cv_nonblocking_io=FIONBIO
449 +    ;;
450 +  *)
451 +    ac_cv_nonblocking_io=O_NONBLOCK
452 +    ;;
453 +  esac
454 + ])
455 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
456 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
457 + fi
458 +
459 + dnl Check whether compiler supports byte bit-fields
460 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
461 +  ac_cv_have_byte_bitfields, [
462 +  AC_LANG_SAVE
463 +  AC_LANG_CPLUSPLUS
464 +  AC_TRY_RUN([
465 +    struct A {
466 +      unsigned char b1:4;
467 +      unsigned char b2:4;
468 +      unsigned char c;
469 +      unsigned short s;
470 +      unsigned char a[4];
471 +    };
472 +
473 +    int main(void) {
474 +      A a;
475 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
476 +    }],
477 +    [ac_cv_have_byte_bitfields=yes],
478 +    [ac_cv_have_byte_bitfields=no],
479 +    dnl When cross-compiling, assume only GCC supports this
480 +    [if [[ "$GCC" = "yes" ]]; then
481 +      ac_cv_have_byte_bitfields="guessing yes"
482 +    else
483 +      ac_cv_have_byte_bitfields="guessing no"
484 +    fi]
485 +    )
486 +  AC_LANG_RESTORE
487 + ])
488 +
489   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
490   AC_DEFUN(AC_CHECK_FRAMEWORK, [
491    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 415 | Line 494 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
494      saved_LIBS="$LIBS"
495      LIBS="$LIBS -framework $1"
496      AC_TRY_LINK(
497 <      [$2], [int main(void) { return 0; }],
497 >      [$2], [],
498        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
499      )
500    ])
# Line 428 | Line 507 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
507   dnl Check for some MacOS X frameworks
508   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
509   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
510 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
511  
512   dnl Select system-dependant sources.
513   SERIALSRC=serial_unix.cpp
# Line 438 | Line 518 | EXTFSSRC=extfs_unix.cpp
518   EXTRASYSSRCS=
519   case "$target_os" in
520   linux*)
521 <  ETHERSRC=Linux/ether_linux.cpp
521 >  ETHERSRC=ether_unix.cpp
522    AUDIOSRC=audio_oss_esd.cpp
523    SCSISRC=Linux/scsi_linux.cpp
524    if [[ "x$EMULATED_PPC" = "xno" ]]; then
525 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
525 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
526    fi
527    ;;
528 + freebsd*)
529 +  ETHERSRC=ether_unix.cpp
530 +  ;;
531   netbsd*)
532 +  ETHERSRC=ether_unix.cpp
533    if [[ "x$EMULATED_PPC" = "xno" ]]; then
534 <    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
534 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
535    fi
536    ;;
537   darwin*)
538 +  ETHERSRC=ether_unix.cpp
539    if [[ "x$EMULATED_PPC" = "xno" ]]; then
540 <    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
540 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
541    fi
542 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
542 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
543      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
544    fi
545    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
546      EXTFSSRC=../MacOSX/extfs_macosx.mm
547    fi
548    ;;
549 < cygwin*)
550 <  SERIALSRC="../dummy/serial_dummy.cpp"
549 > irix*)
550 >  AUDIOSRC=Irix/audio_irix.cpp
551 >  LIBS="$LIBS -laudio"
552 >  WANT_ESD=no
553 >
554 >  dnl Check if our compiler supports -IPA (MIPSPro)
555 >  HAVE_IPA=no
556 >  ocflags="$CFLAGS"
557 >  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
558 >  AC_MSG_CHECKING(if "-IPA" works)
559 >  dnl Do a test compile of an empty function
560 >  AC_TRY_COMPILE([#if defined __GNUC__
561 >                  # error GCC does not support IPA yet
562 >                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
563 >  CFLAGS="$ocflags"
564 >  ;;
565 > esac
566 >
567 > dnl Is the slirp library supported?
568 > case "$ac_cv_have_byte_bitfields" in
569 > yes|"guessing yes")
570 >  CAN_SLIRP=yes
571 >  ETHERSRC=ether_unix.cpp
572    ;;
573   esac
574 + if [[ -n "$CAN_SLIRP" ]]; then
575 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
576 +  SLIRP_SRCS="\
577 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
578 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
579 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
580 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
581 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
582 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
583 + fi
584 + AC_SUBST(SLIRP_SRCS)
585  
586   dnl SDL overrides
587   if [[ "x$WANT_SDL" = "xyes" ]]; then
# Line 477 | Line 594 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
594    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
595      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
596    else
597 <    case "$target_os" in
481 <    cygwin*)
482 <      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
483 <      ;;
484 <    *)
485 <      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
486 <      ;;
487 <    esac
597 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
598    fi
599   else
600    VIDEOSRCS="video_x.cpp"
# Line 912 | Line 1022 | fi
1022  
1023   dnl Check addressing mode to use
1024   AC_MSG_CHECKING([for addressing mode to use])
915 case "$os_target" in
916 cygwin*)
917  WANT_ADDRESSING_MODE="direct,cygwin-hack"
918  NATMEM_OFFSET=
919  ;;
920 esac
1025   if [[ "$EMULATED_PPC" != "yes" ]]; then
1026    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
1027      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 999 | Line 1103 | EOF
1103   fi
1104   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1105  
1106 + dnl Utility macro used by next two tests.
1107 + dnl AC_EXAMINE_OBJECT(C source code,
1108 + dnl     commands examining object file,
1109 + dnl     [commands to run if compile failed]):
1110 + dnl
1111 + dnl Compile the source code to an object file; then convert it into a
1112 + dnl printable representation.  All unprintable characters and
1113 + dnl asterisks (*) are replaced by dots (.).  All white space is
1114 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1115 + dnl output, but runs of newlines are compressed to a single newline.
1116 + dnl Finally, line breaks are forcibly inserted so that no line is
1117 + dnl longer than 80 columns and the file ends with a newline.  The
1118 + dnl result of all this processing is in the file conftest.dmp, which
1119 + dnl may be examined by the commands in the second argument.
1120 + dnl
1121 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1122 + [AC_LANG_SAVE
1123 + AC_LANG_C
1124 + dnl Next bit cribbed from AC_TRY_COMPILE.
1125 + cat > conftest.$ac_ext <<EOF
1126 + [#line __oline__ "configure"
1127 + #include "confdefs.h"
1128 + $1
1129 + ]EOF
1130 + if AC_TRY_EVAL(ac_compile); then
1131 +  od -c conftest.o |
1132 +    sed ['s/^[0-7]*[    ]*/ /
1133 +          s/\*/./g
1134 +          s/ \\n/*/g
1135 +          s/ [0-9][0-9][0-9]/./g
1136 +          s/  \\[^ ]/./g'] |
1137 +    tr -d '
1138 + ' | tr -s '*' '
1139 + ' | fold | sed '$a\
1140 + ' > conftest.dmp
1141 +  $2
1142 + ifelse($3, , , else
1143 +  $3
1144 + )dnl
1145 + fi
1146 + rm -rf conftest*
1147 + AC_LANG_RESTORE])
1148 +
1149 + dnl Floating point format probe.
1150 + dnl The basic concept is the same as the above: grep the object
1151 + dnl file for an interesting string.  We have to watch out for
1152 + dnl rounding changing the values in the object, however; this is
1153 + dnl handled by ignoring the least significant byte of the float.
1154 + dnl
1155 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1156 + dnl It does know about PDP-10 idiosyncratic format, but this is
1157 + dnl not presently supported by GCC.  S/390 "binary floating point"
1158 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1159 + dnl as ASCII?)
1160 + dnl
1161 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1162 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1163 + [gcc_AC_EXAMINE_OBJECT(
1164 + [/* This will not work unless sizeof(double) == 8.  */
1165 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1166 +
1167 + /* This structure must have no internal padding.  */
1168 + struct possibility {
1169 +  char prefix[8];
1170 +  double candidate;
1171 +  char postfix[8];
1172 + };
1173 +
1174 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1175 + struct possibility table [] =
1176 + {
1177 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1178 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1179 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1180 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1181 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1182 + };],
1183 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1184 +    ac_cv_c_float_format='IEEE (big-endian)'
1185 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1186 +    ac_cv_c_float_format='IEEE (big-endian)'
1187 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1188 +    ac_cv_c_float_format='IEEE (little-endian)'
1189 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1190 +    ac_cv_c_float_format='IEEE (little-endian)'
1191 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1192 +    ac_cv_c_float_format='VAX D-float'
1193 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1194 +    ac_cv_c_float_format='PDP-10'
1195 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1196 +    ac_cv_c_float_format='IBM 370 hex'
1197 +  else
1198 +    AC_MSG_ERROR(Unknown floating point format)
1199 +  fi],
1200 +  [AC_MSG_ERROR(compile failed)])
1201 + ])
1202 + # IEEE is the default format.  If the float endianness isn't the same
1203 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1204 + # (which is a tristate: yes, no, default).  This is only an issue with
1205 + # IEEE; the other formats are only supported by a few machines each,
1206 + # all with the same endianness.
1207 + format=IEEE_FLOAT_FORMAT
1208 + fbigend=
1209 + case $ac_cv_c_float_format in
1210 +    'IEEE (big-endian)' )
1211 +        if test $ac_cv_c_bigendian = no; then
1212 +            fbigend=1
1213 +        fi
1214 +        ;;
1215 +    'IEEE (little-endian)' )
1216 +        if test $ac_cv_c_bigendian = yes; then
1217 +            fbigend=0
1218 +        fi
1219 +        ;;
1220 +    'VAX D-float' )
1221 +        format=VAX_FLOAT_FORMAT
1222 +        ;;
1223 +    'PDP-10' )
1224 +        format=PDP10_FLOAT_FORMAT
1225 +        ;;
1226 +    'IBM 370 hex' )
1227 +        format=IBM_FLOAT_FORMAT
1228 +        ;;
1229 + esac
1230 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1231 +  [Define to the floating point format of the host machine.])
1232 + if test -n "$fbigend"; then
1233 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1234 +  [Define to 1 if the host machine stores floating point numbers in
1235 +   memory with the word containing the sign bit at the lowest address,
1236 +   or to 0 if it does it the other way around.
1237 +
1238 +   This macro should not be defined if the ordering is the same as for
1239 +   multi-word integers.])
1240 + fi
1241 + ])
1242 +
1243 + dnl Check for host float format
1244 + gcc_AC_C_FLOAT_FORMAT
1245 +
1246   dnl Platform specific binary postprocessor
1247   AC_PATH_PROG(BLESS, "true")
1248   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 1009 | Line 1253 | fi
1253   dnl Check for GCC 2.7 or higher.
1254   HAVE_GCC27=no
1255   AC_MSG_CHECKING(for GCC 2.7 or higher)
1256 < AC_EGREP_CPP(xyes,
1257 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1258 <  xyes
1259 < #endif
1260 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1256 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1257 >                                     # error gcc < 2.7
1258 >                                     typedef syntax error;
1259 >                                     #endif
1260 >                                   ]])],
1261 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1262 >                  [AC_MSG_RESULT(no)])
1263  
1264   dnl Check for GCC 3.0 or higher.
1265   HAVE_GCC30=no
1266   AC_MSG_CHECKING(for GCC 3.0 or higher)
1267 < AC_EGREP_CPP(xyes,
1268 < [#if __GNUC__ >= 3
1269 <  xyes
1270 < #endif
1271 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1267 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1268 >                                     # error gcc < 3
1269 >                                     typedef syntax error;
1270 >                                     #endif
1271 >                                   ]])],
1272 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1273 >                  [AC_MSG_RESULT(no)])
1274  
1275   dnl Check for ICC.
1276   AC_MSG_CHECKING(for ICC)
# Line 1053 | Line 1301 | AC_CACHE_CHECK([the format of compiler g
1301    rm -rf conftest*
1302   ])
1303  
1304 + dnl Add -fno-strict-aliasing for slirp sources
1305 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1306 +  SAVED_CFLAGS="$CFLAGS"
1307 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1308 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1309 +    ac_cv_gcc_no_strict_aliasing, [
1310 +    AC_TRY_COMPILE([],[],
1311 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1312 +      [ac_cv_gcc_no_strict_aliasing=no])
1313 +  ])
1314 +  CFLAGS="$SAVED_CFLAGS"
1315 + fi
1316 +
1317 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1318 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1319 +  SAVED_CFLAGS="$CFLAGS"
1320 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1321 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1322 +    ac_cv_gcc_mdynamic_no_pic, [
1323 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1324 +  ])
1325 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1326 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1327 +  else
1328 +    CFLAGS="$SAVED_CFLAGS"
1329 +  fi
1330 + fi
1331 +
1332   dnl CPU emulator sources
1333   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1334    CPUSRCS="\
1335      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1336 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1337      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1338      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1339      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 1077 | Line 1354 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1354        i?86:elf)
1355          ac_cv_use_dyngen=yes
1356          ;;
1357 +      mips:elf)
1358 +        ac_cv_use_dyngen=yes
1359 +        ;;
1360        powerpc:mach)
1361          ac_cv_use_dyngen=yes
1362          ;;
1363 +      i?86:mach)
1364 +        ac_cv_use_dyngen=yes
1365 +        ;;
1366        *:*)
1367          ac_cv_use_dyngen=no
1368          ;;
# Line 1089 | Line 1372 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1372          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1373            DYNGEN_CC=$CXX
1374          else
1375 <          for p in /usr/bin /usr/local/bin; do
1375 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1376              gxx="$p/g++"
1377              if [[ -x "$gxx" ]]; then
1378                DYNGEN_CC="$gxx"
# Line 1097 | Line 1380 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1380            done
1381          fi
1382        fi
1383 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1383 >      if [[ -z "$DYNGEN_CC" ]]; then
1384          ac_cv_use_dyngen=no
1385        fi
1386      ])
1387      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1388        case $host_cpu in
1389        i?86)
1390 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1390 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1391 >        ;;
1392 >      mips)
1393 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1394          ;;
1395        powerpc)
1396          if [[ "x$ac_cv_object_format" = "xmach" ]]; then
# Line 1112 | Line 1398 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1398          fi
1399          ;;
1400        esac
1401 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1401 >      have_dyngen_gcc3=no
1402 >      case "x`$DYNGEN_CC -dumpversion`" in
1403 >      x[12].*) ;;
1404 >      x*) have_dyngen_gcc3=yes ;;
1405 >      esac
1406 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1407          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1408        else
1409          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1410        fi
1411 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1412 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1411 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1412 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1413          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1414        fi
1415 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1416 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1417 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1418 +      else
1419 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1420 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1421 +      fi
1422      else
1423        WANT_JIT=no
1424      fi
# Line 1169 | Line 1467 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1467    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1468   fi
1469  
1470 + dnl Higher level optimizations with MIPSPro compilers are possible
1471 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1472 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1473 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1474 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1475 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1476 + fi
1477 +
1478   dnl Generate Makefile.
1479   AC_SUBST(PERL)
1480   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1481   AC_SUBST(DYNGENSRCS)
1482   AC_SUBST(DYNGEN_CC)
1483 + AC_SUBST(DYNGEN_CFLAGS)
1484 + AC_SUBST(DYNGEN_CXXFLAGS)
1485   AC_SUBST(DYNGEN_OP_FLAGS)
1486   AC_SUBST(SYSSRCS)
1487   AC_SUBST(CPUSRCS)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines