ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/configure.ac
(Generate patch)

Comparing BasiliskII/src/Unix/configure.ac (file contents):
Revision 1.34 by gbeauche, 2004-11-08T21:07:07Z vs.
Revision 1.65 by gbeauche, 2006-03-25T07:08:50Z

# Line 21 | Line 21 | AC_ARG_ENABLE(fbdev-dga,     [  --enable
21   AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
22  
23   dnl SDL options.
24 + AC_ARG_ENABLE(sdl-static,    [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
25   AC_ARG_ENABLE(sdl-video,     [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
26   AC_ARG_ENABLE(sdl-audio,     [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
27  
# Line 59 | Line 60 | AC_ARG_ENABLE(addressing,
60  
61   dnl External packages.
62   AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
63 < AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
63 > AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]],
64 >  [case "$withval" in
65 >   gtk1)      WANT_GTK="gtk";;
66 >   gtk|gtk2)  WANT_GTK="$withval";;
67 >   yes)       WANT_GTK="gtk2 gtk";;
68 >   *)         WANT_GTK="no";;
69 >   esac],
70 >  [WANT_GTK="gtk2 gtk"])
71   AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
72  
73   dnl Canonical system information.
# Line 98 | Line 106 | AC_PROG_CPP
106   AC_PROG_CXX
107   AC_PROG_MAKE_SET
108   AC_PROG_INSTALL
109 + AC_PROG_EGREP
110  
111   dnl We use mon if possible.
112   MONSRCS=
# Line 127 | Line 136 | dnl Checks for libraries.
136   AC_CHECK_LIB(posix4, sem_init)
137   AC_CHECK_LIB(rt, timer_create)
138   AC_CHECK_LIB(rt, shm_open)
139 + AC_CHECK_LIB(m, cos)
140  
141   dnl Do we need SDL?
142   WANT_SDL=no
# Line 144 | Line 154 | fi
154   if [[ "x$WANT_SDL" = "xyes" ]]; then
155    AC_PATH_PROG(sdl_config, "sdl-config")
156    if [[ -n "$sdl_config" ]]; then
157 <    sdl_cflags=`$sdl_config --cflags`
158 <    sdl_libs=`$sdl_config --libs`
157 >    case $target_os in
158 >    # Special treatment for Cygwin so that we can still use the POSIX layer
159 >    *cygwin*)
160 >      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
161 >      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
162 >      ;;
163 >    *)
164 >      sdl_cflags=`$sdl_config --cflags`
165 >      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
166 >        sdl_libs=`$sdl_config --static-libs`
167 >      else
168 >        sdl_libs=`$sdl_config --libs`
169 >      fi
170 >      ;;
171 >    esac
172      CFLAGS="$CFLAGS $sdl_cflags"
173      CXXFLAGS="$CXXFLAGS $sdl_cflags"
174      LIBS="$LIBS $sdl_libs"
# Line 180 | Line 203 | AC_CHECK_LIB(pthread, pthread_create, ,
203   if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
204    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
205   fi
206 < AC_CHECK_FUNCS(pthread_cancel)
206 > AC_CHECK_FUNCS(pthread_cond_init)
207 > AC_CHECK_FUNCS(pthread_cancel pthread_testcancel)
208   AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
209   AC_CHECK_FUNCS(pthread_mutexattr_settype)
210   AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
# Line 224 | Line 248 | fi
248  
249   dnl We use GTK+ if possible.
250   UISRCS=../dummy/prefs_editor_dummy.cpp
251 < if [[ "x$WANT_GTK" = "xyes" ]]; then
251 > case "x$WANT_GTK" in
252 > xgtk2*)
253 >  AM_PATH_GTK_2_0(1.3.15, [
254 >    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
255 >    CFLAGS="$CFLAGS $GTK_CFLAGS"
256 >    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
257 >    LIBS="$LIBS $GTK_LIBS"
258 >    UISRCS=prefs_editor_gtk.cpp
259 >    WANT_GTK=gtk2
260 >  ], [
261 >    case "x${WANT_GTK}x" in
262 >    *gtkx)
263 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
264 >      WANT_GTK=gtk
265 >      ;;
266 >    *)
267 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
268 >      WANT_GTK=no
269 >      ;;
270 >    esac
271 >  ])
272 >  ;;
273 > esac
274 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
275    AM_PATH_GTK(1.2.0, [
276      AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
277      CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
# Line 263 | Line 310 | AC_SYS_LARGEFILE
310  
311   dnl Checks for header files.
312   AC_HEADER_STDC
313 + AC_CHECK_HEADERS(stdlib.h stdint.h)
314   AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
315   AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
316 < AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h)
316 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
317 > AC_CHECK_HEADERS(sys/poll.h sys/select.h)
318 > AC_CHECK_HEADERS(arpa/inet.h)
319 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
320 > #ifdef HAVE_SYS_TYPES_H
321 > #include <sys/types.h>
322 > #endif
323 > #ifdef HAVE_SYS_SOCKET_H
324 > #include <sys/socket.h>
325 > #endif
326 > ])
327   AC_CHECK_HEADERS(AvailabilityMacros.h)
328 + AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
329  
330   dnl Checks for typedefs, structures, and compiler characteristics.
331   AC_C_BIGENDIAN
# Line 306 | Line 365 | if [[ "x$ac_cv_type_socklen_t" != "xyes"
365   fi
366  
367   dnl Checks for library functions.
368 < AC_CHECK_FUNCS(strdup cfmakeraw)
368 > AC_CHECK_FUNCS(strdup strerror cfmakeraw)
369   AC_CHECK_FUNCS(clock_gettime timer_create)
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(poll inet_aton)
374  
375   dnl Darwin seems to define mach_task_self() instead of task_self().
376   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 337 | Line 397 | mips-sony-bsd|mips-sony-newsos4)
397   *-*-sco3.2v5*)
398          no_dev_ptmx=1
399          ;;
400 + *-*-cygwin*)
401 +        no_dev_ptmx=1
402 +        ;;
403   esac
404  
405   if test -z "$no_dev_ptmx" ; then
# Line 359 | Line 422 | AC_CHECK_FILE([/dev/ptc],
422   dnl (end of code from openssh-3.2.2p1 configure.ac)
423  
424  
425 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
426 + dnl doesn't work or is unimplemented. On these systems (mostly older
427 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
428 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
429 +  ac_cv_nonblocking_io, [
430 +  case "$host" in
431 +  *-*-osf*)
432 +    ac_cv_nonblocking_io=FIONBIO
433 +    ;;
434 +  *-*-sunos4*)
435 +    ac_cv_nonblocking_io=FIONBIO
436 +    ;;
437 +  *-*-ultrix*)
438 +    ac_cv_nonblocking_io=FIONBIO
439 +    ;;
440 +  *)
441 +    ac_cv_nonblocking_io=O_NONBLOCK
442 +    ;;
443 +  esac
444 + ])
445 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
446 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
447 + fi
448 +
449 + dnl Check whether compiler supports byte bit-fields
450 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
451 +  ac_cv_have_byte_bitfields, [
452 +  AC_LANG_SAVE
453 +  AC_LANG_CPLUSPLUS
454 +  AC_TRY_RUN([
455 +    struct A {
456 +      unsigned char b1:4;
457 +      unsigned char b2:4;
458 +      unsigned char c;
459 +      unsigned short s;
460 +      unsigned char a[4];
461 +    };
462 +
463 +    int main(void) {
464 +      A a;
465 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
466 +    }],
467 +    [ac_cv_have_byte_bitfields=yes],
468 +    [ac_cv_have_byte_bitfields=no],
469 +    dnl When cross-compiling, assume only GCC supports this
470 +    [if [[ "$GCC" = "yes" ]]; then
471 +      ac_cv_have_byte_bitfields="guessing yes"
472 +    else
473 +      ac_cv_have_byte_bitfields="guessing no"
474 +    fi]
475 +    )
476 +  AC_LANG_RESTORE
477 + ])
478 +
479   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
480 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
480 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
481    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
482    AC_CACHE_CHECK([whether compiler supports framework $1],
483      ac_Framework, [
484      saved_LIBS="$LIBS"
485      LIBS="$LIBS -framework $1"
486      AC_TRY_LINK(
487 <      [$2], [int main(void) { return 0; }],
487 >      [$2], [],
488        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
489      )
490    ])
# Line 378 | Line 495 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
495   ])
496  
497   dnl Check for some MacOS X frameworks
498 + AC_CHECK_FRAMEWORK(AppKit, [])
499   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
500   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
501 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
502  
503   dnl Select system-dependant source files.
504   SERIALSRC=serial_unix.cpp
505   ETHERSRC=../dummy/ether_dummy.cpp
506   SCSISRC=../dummy/scsi_dummy.cpp
507   AUDIOSRC=../dummy/audio_dummy.cpp
508 + EXTFSSRC=extfs_unix.cpp
509   EXTRASYSSRCS=
510   CAN_NATIVE_M68K=no
511   case "$target_os" in
# Line 419 | Line 539 | freebsd*)
539    ;;
540   netbsd*)
541    CAN_NATIVE_M68K=yes
542 +  ETHERSRC=ether_unix.cpp
543    ;;
544   solaris*)
545    AUDIOSRC=Solaris/audio_solaris.cpp
546    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
547    ;;
548   irix*)
428  ETHERSRC=ether_unix.cpp
549    AUDIOSRC=Irix/audio_irix.cpp
550    EXTRASYSSRCS=Irix/unaligned.c
431  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
432  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
551    LIBS="$LIBS -laudio"
552    WANT_ESD=no
553  
# Line 439 | Line 557 | irix*)
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(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
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   darwin*)
566 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
566 >  ETHERSRC=ether_unix.cpp
567 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
568      EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
569    fi
570 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
571 +    EXTFSSRC=../MacOSX/extfs_macosx.mm
572 +  fi
573 +  ;;
574 + cygwin*)
575 +  SERIALSRC="../dummy/serial_dummy.cpp"
576 +  EXTRASYSSRCS="../Windows/BasiliskII.rc"
577 +  ;;
578 + esac
579 +
580 + dnl Is the slirp library supported?
581 + case "$ac_cv_have_byte_bitfields" in
582 + yes|"guessing yes")
583 +  CAN_SLIRP=yes
584 +  ETHERSRC=ether_unix.cpp
585    ;;
586   esac
587 + if [[ -n "$CAN_SLIRP" ]]; then
588 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
589 +  SLIRP_SRCS="\
590 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
591 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
592 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
593 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
594 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
595 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
596 + fi
597 + AC_SUBST(SLIRP_SRCS)
598 +
599   dnl SDL overrides
600   if [[ "x$WANT_SDL" = "xyes" ]]; then
601    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
# Line 459 | Line 607 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
607    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
608      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
609    else
610 <    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
610 >    case "$target_os" in
611 >    cygwin*)
612 >      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
613 >      ;;
614 >    *)
615 >      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
616 >      ;;
617 >    esac
618    fi
619   else
620    VIDEOSRCS="video_x.cpp"
# Line 485 | Line 640 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
640    ETHERSRC=../dummy/ether_dummy.cpp
641    AUDIOSRC=../dummy/audio_dummy.cpp
642   fi
643 < SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
643 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
644  
645   dnl Define a macro that translates a yesno-variable into a C macro definition
646   dnl to be put into the config.h file
647   dnl $1 -- the macro to define
648   dnl $2 -- the value to translate
649   dnl $3 -- template name
650 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
650 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
651      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
652          AC_DEFINE($1, 1, $3)
653      fi
# Line 838 | Line 993 | AC_CACHE_CHECK([whether your system supp
993   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
994    [Define if your system supports Mach exceptions.])
995  
996 + dnl Check if Windows exceptions are supported.
997 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
998 +  ac_cv_have_win32_exceptions, [
999 +  AC_LANG_SAVE
1000 +  AC_LANG_CPLUSPLUS
1001 +  AC_TRY_RUN([
1002 +    #define HAVE_WIN32_EXCEPTIONS 1
1003 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1004 +    #include "vm_alloc.cpp"
1005 +    #include "sigsegv.cpp"
1006 +  ], [
1007 +  sigsegv_recovery=win32
1008 +  ac_cv_have_win32_exceptions=yes
1009 +  ],
1010 +  ac_cv_have_win32_exceptions=no,
1011 +  dnl When cross-compiling, do not assume anything.
1012 +  ac_cv_have_win32_exceptions=no
1013 +  )
1014 +  AC_LANG_RESTORE
1015 +  ]
1016 + )
1017 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
1018 +  [Define if your system supports Windows exceptions.])
1019 +
1020   dnl Otherwise, check if extended signals are supported.
1021   if [[ -z "$sigsegv_recovery" ]]; then
1022    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 918 | Line 1097 | fi
1097   dnl A dummy program that returns always true
1098   AC_PATH_PROG([BLESS], "true")
1099  
1100 + dnl Check for linker script support
1101 + case $target_os:$target_cpu in
1102 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1103 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1104 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1105 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1106 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1107 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1108 + esac
1109 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1110 +  AC_CACHE_CHECK([whether linker script is usable],
1111 +    ac_cv_linker_script_works, [
1112 +    AC_LANG_SAVE
1113 +    AC_LANG_CPLUSPLUS
1114 +    saved_LDFLAGS="$LDFLAGS"
1115 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1116 +    AC_TRY_RUN(
1117 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1118 +      [ac_cv_linker_script_works=yes],
1119 +      [ac_cv_linker_script_works=no],
1120 +      dnl When cross-compiling, assume it works
1121 +      [ac_cv_linker_script_works="guessing yes"]
1122 +    )
1123 +    AC_LANG_RESTORE
1124 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1125 +      LDFLAGS="$saved_LDFLAGS"
1126 +      LINKER_SCRIPT_FLAGS=""
1127 +    fi
1128 +  ])
1129 + fi
1130 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1131 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1132 +
1133   dnl Determine the addressing mode to use
1134   if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1135    ADDRESSING_MODE="real"
# Line 995 | Line 1207 | AC_MSG_RESULT($HAVE_GAS)
1207   dnl Check for GCC 2.7 or higher.
1208   HAVE_GCC27=no
1209   AC_MSG_CHECKING(for GCC 2.7 or higher)
1210 < AC_EGREP_CPP(xyes,
1211 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1212 <  xyes
1213 < #endif
1214 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1210 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1211 >                                     # error gcc < 2.7
1212 >                                     #endif
1213 >                                   ]])],
1214 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1215 >                  [AC_MSG_RESULT(no)])
1216  
1217   dnl Check for GCC 3.0 or higher.
1218   HAVE_GCC30=no
1219   AC_MSG_CHECKING(for GCC 3.0 or higher)
1220 < AC_EGREP_CPP(xyes,
1221 < [#if __GNUC__ >= 3
1222 <  xyes
1223 < #endif
1224 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1220 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1221 >                                     # error gcc < 3
1222 >                                     #endif
1223 >                                   ]])],
1224 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1225 >                  [AC_MSG_RESULT(no)])
1226 >
1227 > dnl Check for ICC.
1228 > AC_MSG_CHECKING(for ICC)
1229 > HAVE_ICC=no
1230 > if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1231 >  HAVE_ICC=yes
1232 > fi
1233 > AC_MSG_RESULT($HAVE_ICC)
1234  
1235   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1236   dnl Also set "-fno-exceptions" for C++ because exception handling requires
# Line 1023 | Line 1245 | dnl As of 2001/08/02, this affects the f
1245   dnl Official: probably gcc-3.1 (mainline CVS)
1246   dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1247   dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1248 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1248 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1249    SAVED_CXXFLAGS="$CXXFLAGS"
1250    CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1251    AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
# Line 1039 | Line 1261 | fi
1261  
1262   dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1263   dnl However, there are some corner cases exposed on x86-64
1264 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1264 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1265    SAVED_CXXFLAGS="$CXXFLAGS"
1266    CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1267    AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
# Line 1053 | Line 1275 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1275    fi
1276   fi
1277  
1278 + dnl Add -fno-strict-aliasing for slirp sources
1279 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1280 +  SAVED_CFLAGS="$CFLAGS"
1281 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1282 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1283 +    ac_cv_gcc_no_strict_aliasing, [
1284 +    AC_TRY_COMPILE([],[],
1285 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1286 +      [ac_cv_gcc_no_strict_aliasing=no])
1287 +  ])
1288 +  CFLAGS="$SAVED_CFLAGS"
1289 + fi
1290 +
1291 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1292 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1293 +  SAVED_CFLAGS="$CFLAGS"
1294 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1295 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1296 +    ac_cv_gcc_mdynamic_no_pic, [
1297 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1298 +  ])
1299 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1300 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1301 +  else
1302 +    CFLAGS="$SAVED_CFLAGS"
1303 +  fi
1304 + fi
1305 +
1306   dnl Select appropriate CPU source and REGPARAM define.
1307   ASM_OPTIMIZATIONS=none
1308   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines