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.4 by gbeauche, 2004-07-03T10:39:06Z vs.
Revision 1.47 by gbeauche, 2006-01-24T23:47:09Z

# 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  
43 + dnl Addressing mode
44 + AC_ARG_ENABLE(addressing,
45 +  [  --enable-addressing=AM  set the addressing mode to use [default=real]],
46 +  [case "$enableval" in
47 +   real)        WANT_ADDRESSING_MODE="real";;
48 +   direct)      WANT_ADDRESSING_MODE="direct";;
49 +   direct,0x*)  WANT_ADDRESSING_MODE="direct"; NATMEM_OFFSET=`echo "$enableval" | sed -n '/direct,\(0[[xX]][[0-9A-Fa-f]]*\([[UuLl]]\{1,2\}\)\?\)$/s//\1/p'`;;
50 +   esac],
51 +  [WANT_ADDRESSING_MODE="real"]
52 + )
53 +
54   dnl SDL options.
55   AC_ARG_ENABLE(sdl-static,   [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
56   AC_ARG_ENABLE(sdl-video,    [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
57 + AC_ARG_ENABLE(sdl-audio,    [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
58  
59   dnl Checks for programs.
60   AC_PROG_CC
# Line 36 | Line 63 | AC_PROG_CXX
63   AC_PROG_MAKE_SET
64   AC_PROG_INSTALL
65   AC_PROG_EGREP
66 + AC_PATH_PROGS(FILE, [file false])
67 + AC_PATH_PROG(PERL, [perl])
68  
69   dnl Check for PowerPC target CPU.
70   HAVE_PPC=no
# Line 92 | Line 121 | if [[ "x$WANT_MON" = "xyes" ]]; then
121      WANT_MON=no
122    fi
123   fi
124 + AC_SUBST(MONSRCS)
125  
126   dnl Checks for libraries.
127   AC_CHECK_LIB(posix4, sem_init)
128 + AC_CHECK_LIB(m, cos)
129  
130   dnl Do we need SDL?
131   WANT_SDL=no
101 SDL_SUPPORT="none"
132   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
133    WANT_SDL=yes
134    WANT_XF86_DGA=no
135    WANT_XF86_VIDMODE=no
136    WANT_FBDEV_DGA=no
137 <  SDL_SUPPORT="video"
137 >  SDL_SUPPORT="$SDL_SUPPORT video"
138 > fi
139 > if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
140 >  WANT_SDL=yes
141 >  SDL_SUPPORT="$SDL_SUPPORT audio"
142   fi
143   if [[ "x$WANT_SDL" = "xyes" ]]; then
144    AC_PATH_PROG(sdl_config, "sdl-config")
# Line 120 | Line 154 | if [[ "x$WANT_SDL" = "xyes" ]]; then
154      LIBS="$LIBS $sdl_libs"
155    else
156      WANT_SDL=no
157 +    WANT_SDL_VIDEO=no
158 +    WANT_SDL_AUDIO=no
159    fi
160 +  SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
161 + else
162 +  SDL_SUPPORT="none"
163   fi
164  
165   dnl We need X11, if not using SDL.
166 < if [[ "x$WANT_SDL" = "xno" ]]; then
166 > if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; then
167    AC_PATH_XTRA
168    if [[ "x$no_x" = "xyes" ]]; then
169      AC_MSG_ERROR([You need X11 to run SheepShaver.])
# Line 137 | Line 176 | fi
176   dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
177   HAVE_PTHREADS=yes
178   case $EMULATED_PPC:$target_os in
179 < no:linux*)
179 > no:linux*|no:netbsd*)
180    dnl We do have our own pthread_cancel() implementation
181    AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.])
182    ;;
# Line 145 | Line 184 | no:linux*)
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)
156  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
157    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
158  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 165 | Line 204 | no:linux*)
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 190 | 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 222 | 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 stdint.h)
301   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
226 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.
318   AC_C_BIGENDIAN
# Line 250 | 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 266 | 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)
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 283 | Line 384 | no:linux*)
384    ;;
385   *:*)
386    AC_SEARCH_LIBS(clock_gettime, [rt posix4])
387 <  AC_CHECK_FUNCS(clock_gettime)
387 >  AC_CHECK_FUNCS(clock_gettime clock_nanosleep)
388    ;;
389   esac
390  
391 + dnl Check for headers and functions related to pty support (sshpty.c)
392 + dnl From openssh-3.2.2p1 configure.ac
393 + AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h)
394 + AC_CHECK_FUNCS(_getpty vhangup strlcpy)
395 +
396 + case "$host" in
397 + *-*-hpux10.26)
398 +        disable_ptmx_check=yes
399 +        ;;
400 + *-*-linux*)
401 +        no_dev_ptmx=1
402 +        ;;
403 + mips-sony-bsd|mips-sony-newsos4)
404 +        AC_DEFINE(HAVE_NEWS4, 1, [Define if you are on NEWS-OS (additions from openssh-3.2.2p1, for sshpty.c).])
405 +        ;;
406 + *-*-sco3.2v4*)
407 +        no_dev_ptmx=1
408 +        ;;
409 + *-*-sco3.2v5*)
410 +        no_dev_ptmx=1
411 +        ;;
412 + *-*-cygwin*)
413 +        no_dev_ptmx=1
414 +        ;;
415 + esac
416 +
417 + if test -z "$no_dev_ptmx" ; then
418 +        if test "x$disable_ptmx_check" != "xyes" ; then
419 +                AC_CHECK_FILE([/dev/ptmx],
420 +                        [
421 +                                AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx.])
422 +                                have_dev_ptmx=1
423 +                        ]
424 +                )
425 +        fi
426 + fi
427 + AC_CHECK_FILE([/dev/ptc],
428 +        [
429 +                AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC, 1, [Define if you have /dev/ptc.])
430 +                have_dev_ptc=1
431 +        ]
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 AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
460   AC_DEFUN(AC_CHECK_FRAMEWORK, [
461    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
# Line 295 | Line 464 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
464      saved_LIBS="$LIBS"
465      LIBS="$LIBS -framework $1"
466      AC_TRY_LINK(
467 <      [$2], [int main(void) { return 0; }],
467 >      [$2], [],
468        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
469      )
470    ])
# Line 308 | Line 477 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
477   dnl Check for some MacOS X frameworks
478   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
479   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
480 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
481  
482   dnl Select system-dependant sources.
483   SERIALSRC=serial_unix.cpp
484   ETHERSRC=../dummy/ether_dummy.cpp
485   SCSISRC=../dummy/scsi_dummy.cpp
486   AUDIOSRC=../dummy/audio_dummy.cpp
487 + EXTFSSRC=extfs_unix.cpp
488   EXTRASYSSRCS=
489   case "$target_os" in
490   linux*)
491 <  ETHERSRC=Linux/ether_linux.cpp
491 >  ETHERSRC=ether_unix.cpp
492    AUDIOSRC=audio_oss_esd.cpp
493    SCSISRC=Linux/scsi_linux.cpp
494    if [[ "x$EMULATED_PPC" = "xno" ]]; then
495 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S"
495 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
496 >  fi
497 >  ;;
498 > freebsd*)
499 >  ETHERSRC=ether_unix.cpp
500 >  ;;
501 > netbsd*)
502 >  ETHERSRC=ether_unix.cpp
503 >  if [[ "x$EMULATED_PPC" = "xno" ]]; then
504 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
505    fi
506    ;;
507   darwin*)
508 +  ETHERSRC=ether_unix.cpp
509    if [[ "x$EMULATED_PPC" = "xno" ]]; then
510 <    EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S"
510 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
511    fi
512 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
512 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
513      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
514    fi
515 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
516 +    EXTFSSRC=../MacOSX/extfs_macosx.mm
517 +  fi
518 +  ;;
519 + irix*)
520 +  ETHERSRC=ether_unix.cpp
521 +  AUDIOSRC=Irix/audio_irix.cpp
522 +  LIBS="$LIBS -laudio"
523 +  WANT_ESD=no
524 +
525 +  dnl Check if our compiler supports -IPA (MIPSPro)
526 +  HAVE_IPA=no
527 +  ocflags="$CFLAGS"
528 +  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
529 +  AC_MSG_CHECKING(if "-IPA" works)
530 +  dnl Do a test compile of an empty function
531 +  AC_TRY_COMPILE([#if defined __GNUC__
532 +                  # error GCC does not support IPA yet
533 +                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
534 +  CFLAGS="$ocflags"
535    ;;
536   esac
537  
538 + dnl Is the slirp library supported?
539 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
540 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
541 +  SLIRP_SRCS="\
542 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
543 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
544 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
545 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
546 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
547 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
548 + fi
549 + AC_SUBST(SLIRP_SRCS)
550 +
551   dnl SDL overrides
552   if [[ "x$WANT_SDL" = "xyes" ]]; then
553    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
554   fi
555   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
342  VIDEOSRCS="../SDL/video_sdl.cpp"
556    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
557 +  VIDEOSRCS="../SDL/video_sdl.cpp"
558    KEYCODES="../SDL/keycodes"
559    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
560      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
# Line 352 | Line 566 | else
566    KEYCODES="keycodes"
567    EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
568   fi
569 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
570 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
571 +  AUDIOSRC="../SDL/audio_sdl.cpp"
572 + fi
573  
574 < SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
574 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
575  
576   dnl Define a macro that translates a yesno-variable into a C macro definition
577   dnl to be put into the config.h file
# Line 657 | Line 875 | fi
875   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
876    [Define if your system supports Mach exceptions.])
877  
878 + dnl Check if Windows exceptions are supported.
879 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
880 +  ac_cv_have_win32_exceptions, [
881 +  AC_LANG_SAVE
882 +  AC_LANG_CPLUSPLUS
883 +  AC_TRY_RUN([
884 +    #define HAVE_WIN32_EXCEPTIONS 1
885 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
886 +    #include "vm_alloc.cpp"
887 +    #include "sigsegv.cpp"
888 +  ], [
889 +  sigsegv_recovery=win32
890 +  ac_cv_have_win32_exceptions=yes
891 +  ],
892 +  ac_cv_have_win32_exceptions=no,
893 +  dnl When cross-compiling, do not assume anything.
894 +  ac_cv_have_win32_exceptions=no
895 +  )
896 +  AC_LANG_RESTORE
897 +  ]
898 + )
899 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
900 +  [Define if your system supports Windows exceptions.])
901 +
902   dnl Otherwise, check if extended signals are supported.
903   if [[ -z "$sigsegv_recovery" ]]; then
904    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 743 | Line 985 | else
985      WANT_VOSF=no
986   fi
987  
988 + dnl Check addressing mode to use
989 + AC_MSG_CHECKING([for addressing mode to use])
990 + if [[ "$EMULATED_PPC" != "yes" ]]; then
991 +  if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
992 +    AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
993 +    WANT_ADDRESSING_MODE="real"
994 +  fi
995 + fi
996 + if [[ "$WANT_ADDRESSING_MODE" = "direct" ]]; then
997 +  if [[ -n "$NATMEM_OFFSET" ]]; then
998 +    NATMEM_OFFSET_DEF="-DNATMEM_OFFSET=$NATMEM_OFFSET"
999 +  fi
1000 +  AC_LANG_SAVE
1001 +  AC_LANG_CPLUSPLUS
1002 +  cat confdefs.h > conftest.$ac_ext
1003 +  cat >> conftest.$ac_ext << EOF
1004 + #include <stdio.h>
1005 + #include <string.h>
1006 + #include "vm_alloc.cpp"
1007 +
1008 + int main(void)
1009 + {
1010 +        if (vm_init() < 0)
1011 +                return 1;
1012 +
1013 +        static const struct {
1014 +                unsigned long base;
1015 +                unsigned int size;
1016 +        } ranges[[]] = {
1017 +                { 0x00000000, 0x0003000 },
1018 +                { 0x10000000, 0x2000000 },
1019 +                { 0x40800000, 0x0400000 },
1020 +                { 0x68070000, 0x0010000 },
1021 +                { 0x69000000, 0x0080000 },
1022 +                { 0x68ffe000, 0x0002000 },
1023 +                { 0x5fffe000, 0x0002000 },
1024 +                { 0x60000000, 0x0040000 },
1025 +        };
1026 +        const int n_ranges = sizeof(ranges)/ sizeof(ranges[[0]]);
1027 +
1028 + #ifdef NATMEM_OFFSET
1029 +        unsigned long ofs = NATMEM_OFFSET;
1030 + #else
1031 +        for (unsigned long ofs = 0x10000000; ofs <= 0x90000000; ofs += 0x10000000)
1032 + #endif
1033 +        for (int i = 0; i < n_ranges; i++) {
1034 +                char *m = (char *)(ranges[[i]].base + ofs);
1035 +                if (vm_acquire_fixed(m, ranges[[i]].size) != 0)
1036 +                        break;
1037 +                memset(m, 0, ranges[[i]].size);
1038 +                vm_release(m, ranges[[i]].size);
1039 +                if (i == n_ranges - 1) {
1040 +                        if (sizeof(void *) == 8 && ofs > 0xffffffff)
1041 +                                printf("0x%lxul\n", ofs);
1042 +                        else
1043 +                                printf("0x%08x\n", ofs);
1044 +                        return 0;
1045 +                }
1046 +        }
1047 +
1048 +        vm_exit();
1049 +        return 1;
1050 + }
1051 + EOF
1052 +  doit='$CXX conftest.$ac_ext -o conftest.$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS $NATMEM_OFFSET_DEF >& AS_MESSAGE_LOG_FD'
1053 +  if AC_TRY_EVAL(doit); then
1054 +    NATMEM_OFFSET=`./conftest.$ac_exeext`
1055 +  else
1056 +    NATMEM_OFFSET=
1057 +  fi
1058 +  rm -f conftest*
1059 +  AC_LANG_RESTORE
1060 +
1061 +  if [[ -z "$NATMEM_OFFSET" ]]; then
1062 +    AC_MSG_ERROR([could not determine a sensible NATMEM_OFFSET value])
1063 +  else
1064 +    WANT_ADDRESSING_MODE="direct,$NATMEM_OFFSET"
1065 +    AC_DEFINE_UNQUOTED(NATMEM_OFFSET, $NATMEM_OFFSET,
1066 +      [Define constant offset for Mac address translation])
1067 +  fi
1068 + fi
1069 + AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1070 +
1071 + dnl Utility macro used by next two tests.
1072 + dnl AC_EXAMINE_OBJECT(C source code,
1073 + dnl     commands examining object file,
1074 + dnl     [commands to run if compile failed]):
1075 + dnl
1076 + dnl Compile the source code to an object file; then convert it into a
1077 + dnl printable representation.  All unprintable characters and
1078 + dnl asterisks (*) are replaced by dots (.).  All white space is
1079 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1080 + dnl output, but runs of newlines are compressed to a single newline.
1081 + dnl Finally, line breaks are forcibly inserted so that no line is
1082 + dnl longer than 80 columns and the file ends with a newline.  The
1083 + dnl result of all this processing is in the file conftest.dmp, which
1084 + dnl may be examined by the commands in the second argument.
1085 + dnl
1086 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1087 + [AC_LANG_SAVE
1088 + AC_LANG_C
1089 + dnl Next bit cribbed from AC_TRY_COMPILE.
1090 + cat > conftest.$ac_ext <<EOF
1091 + [#line __oline__ "configure"
1092 + #include "confdefs.h"
1093 + $1
1094 + ]EOF
1095 + if AC_TRY_EVAL(ac_compile); then
1096 +  od -c conftest.o |
1097 +    sed ['s/^[0-7]*[    ]*/ /
1098 +          s/\*/./g
1099 +          s/ \\n/*/g
1100 +          s/ [0-9][0-9][0-9]/./g
1101 +          s/  \\[^ ]/./g'] |
1102 +    tr -d '
1103 + ' | tr -s '*' '
1104 + ' | fold | sed '$a\
1105 + ' > conftest.dmp
1106 +  $2
1107 + ifelse($3, , , else
1108 +  $3
1109 + )dnl
1110 + fi
1111 + rm -rf conftest*
1112 + AC_LANG_RESTORE])
1113 +
1114 + dnl Floating point format probe.
1115 + dnl The basic concept is the same as the above: grep the object
1116 + dnl file for an interesting string.  We have to watch out for
1117 + dnl rounding changing the values in the object, however; this is
1118 + dnl handled by ignoring the least significant byte of the float.
1119 + dnl
1120 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1121 + dnl It does know about PDP-10 idiosyncratic format, but this is
1122 + dnl not presently supported by GCC.  S/390 "binary floating point"
1123 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1124 + dnl as ASCII?)
1125 + dnl
1126 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1127 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1128 + [gcc_AC_EXAMINE_OBJECT(
1129 + [/* This will not work unless sizeof(double) == 8.  */
1130 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1131 +
1132 + /* This structure must have no internal padding.  */
1133 + struct possibility {
1134 +  char prefix[8];
1135 +  double candidate;
1136 +  char postfix[8];
1137 + };
1138 +
1139 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1140 + struct possibility table [] =
1141 + {
1142 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1143 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1144 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1145 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1146 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1147 + };],
1148 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1149 +    ac_cv_c_float_format='IEEE (big-endian)'
1150 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1151 +    ac_cv_c_float_format='IEEE (big-endian)'
1152 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1153 +    ac_cv_c_float_format='IEEE (little-endian)'
1154 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1155 +    ac_cv_c_float_format='IEEE (little-endian)'
1156 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1157 +    ac_cv_c_float_format='VAX D-float'
1158 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1159 +    ac_cv_c_float_format='PDP-10'
1160 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1161 +    ac_cv_c_float_format='IBM 370 hex'
1162 +  else
1163 +    AC_MSG_ERROR(Unknown floating point format)
1164 +  fi],
1165 +  [AC_MSG_ERROR(compile failed)])
1166 + ])
1167 + # IEEE is the default format.  If the float endianness isn't the same
1168 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1169 + # (which is a tristate: yes, no, default).  This is only an issue with
1170 + # IEEE; the other formats are only supported by a few machines each,
1171 + # all with the same endianness.
1172 + format=IEEE_FLOAT_FORMAT
1173 + fbigend=
1174 + case $ac_cv_c_float_format in
1175 +    'IEEE (big-endian)' )
1176 +        if test $ac_cv_c_bigendian = no; then
1177 +            fbigend=1
1178 +        fi
1179 +        ;;
1180 +    'IEEE (little-endian)' )
1181 +        if test $ac_cv_c_bigendian = yes; then
1182 +            fbigend=0
1183 +        fi
1184 +        ;;
1185 +    'VAX D-float' )
1186 +        format=VAX_FLOAT_FORMAT
1187 +        ;;
1188 +    'PDP-10' )
1189 +        format=PDP10_FLOAT_FORMAT
1190 +        ;;
1191 +    'IBM 370 hex' )
1192 +        format=IBM_FLOAT_FORMAT
1193 +        ;;
1194 + esac
1195 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1196 +  [Define to the floating point format of the host machine.])
1197 + if test -n "$fbigend"; then
1198 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1199 +  [Define to 1 if the host machine stores floating point numbers in
1200 +   memory with the word containing the sign bit at the lowest address,
1201 +   or to 0 if it does it the other way around.
1202 +
1203 +   This macro should not be defined if the ordering is the same as for
1204 +   multi-word integers.])
1205 + fi
1206 + ])
1207 +
1208 + dnl Check for host float format
1209 + gcc_AC_C_FLOAT_FORMAT
1210 +
1211   dnl Platform specific binary postprocessor
1212   AC_PATH_PROG(BLESS, "true")
1213   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 753 | Line 1218 | fi
1218   dnl Check for GCC 2.7 or higher.
1219   HAVE_GCC27=no
1220   AC_MSG_CHECKING(for GCC 2.7 or higher)
1221 < AC_EGREP_CPP(xyes,
1222 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1223 <  xyes
1224 < #endif
1225 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1221 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1222 >                                     # error gcc < 2.7
1223 >                                     typedef syntax error;
1224 >                                     #endif
1225 >                                   ]])],
1226 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1227 >                  [AC_MSG_RESULT(no)])
1228  
1229   dnl Check for GCC 3.0 or higher.
1230   HAVE_GCC30=no
1231   AC_MSG_CHECKING(for GCC 3.0 or higher)
1232 < AC_EGREP_CPP(xyes,
1233 < [#if __GNUC__ >= 3
1234 <  xyes
1235 < #endif
1236 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1232 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1233 >                                     # error gcc < 3
1234 >                                     typedef syntax error;
1235 >                                     #endif
1236 >                                   ]])],
1237 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1238 >                  [AC_MSG_RESULT(no)])
1239  
1240   dnl Check for ICC.
1241   AC_MSG_CHECKING(for ICC)
# Line 776 | Line 1245 | if $CXX -V -v 2>&1 | grep -q "Intel(R) C
1245   fi
1246   AC_MSG_RESULT($HAVE_ICC)
1247  
1248 < # Test if the compiler can generate ELF objects
1249 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1250 <  ac_cv_elf_objects, [
1248 > dnl Determine the generated object format
1249 > AC_CACHE_CHECK([the format of compiler generated objects],
1250 >  ac_cv_object_format, [
1251    echo 'int i;' > conftest.$ac_ext
1252 <  ac_cv_elf_objects=no
1252 >  ac_cv_object_format=no
1253    if AC_TRY_EVAL(ac_compile); then
1254      case `/usr/bin/file conftest.$ac_objext` in
1255      *"ELF"*)
1256 <      ac_cv_elf_objects=yes
1256 >      ac_cv_object_format=elf
1257 >      ;;
1258 >    *"Mach-O"*)
1259 >      ac_cv_object_format=mach
1260 >      ;;
1261 >    *)
1262 >      ac_cv_object_format=unknown
1263        ;;
1264      esac
1265    fi
1266    rm -rf conftest*
1267   ])
1268 < ELF_OBJECTS=$ac_cv_elf_objects
1268 >
1269 > dnl Add -fno-strict-aliasing for slirp sources
1270 > if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1271 >  SAVED_CFLAGS="$CFLAGS"
1272 >  CFLAGS="$CFLAGS -fno-strict-aliasing"
1273 >  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1274 >    ac_cv_gcc_no_strict_aliasing, [
1275 >    AC_TRY_COMPILE([],[],
1276 >      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1277 >      [ac_cv_gcc_no_strict_aliasing=no])
1278 >  ])
1279 >  CFLAGS="$SAVED_CFLAGS"
1280 > fi
1281 >
1282 > dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1283 > if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1284 >  SAVED_CFLAGS="$CFLAGS"
1285 >  CFLAGS="$CFLAGS -mdynamic-no-pic"
1286 >  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1287 >    ac_cv_gcc_mdynamic_no_pic, [
1288 >    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1289 >  ])
1290 >  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1291 >    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1292 >  else
1293 >    CFLAGS="$SAVED_CFLAGS"
1294 >  fi
1295 > fi
1296  
1297   dnl CPU emulator sources
1298   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1299    CPUSRCS="\
1300 +    ../kpx_cpu/src/mathlib/ieeefp.cpp \
1301 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1302      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1303      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1304      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
# Line 805 | Line 1309 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1309    if [[ "x$WANT_JIT" = "xyes" ]]; then
1310      AC_CACHE_CHECK([whether dyngen can be used],
1311        ac_cv_use_dyngen, [
1312 <      case $host_cpu:$ELF_OBJECTS in
1313 <      powerpc:yes)
1312 >      case $host_cpu:$ac_cv_object_format in
1313 >      powerpc:elf)
1314 >        ac_cv_use_dyngen=yes
1315 >        ;;
1316 >      x86_64:elf)
1317 >        ac_cv_use_dyngen=yes
1318 >        ;;
1319 >      i?86:elf)
1320 >        ac_cv_use_dyngen=yes
1321 >        ;;
1322 >      mips:elf)
1323          ac_cv_use_dyngen=yes
1324          ;;
1325 <      x86_64:yes)
1325 >      powerpc:mach)
1326          ac_cv_use_dyngen=yes
1327          ;;
1328 <      i?86:yes)
1328 >      i?86:mach)
1329          ac_cv_use_dyngen=yes
1330          ;;
1331        *:*)
# Line 824 | Line 1337 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1337          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1338            DYNGEN_CC=$CXX
1339          else
1340 <          for p in /usr/bin /usr/local/bin; do
1340 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1341              gxx="$p/g++"
1342              if [[ -x "$gxx" ]]; then
1343                DYNGEN_CC="$gxx"
# Line 832 | Line 1345 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1345            done
1346          fi
1347        fi
1348 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1348 >      if [[ -z "$DYNGEN_CC" ]]; then
1349          ac_cv_use_dyngen=no
1350        fi
1351      ])
1352      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1353        case $host_cpu in
1354        i?86)
1355 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
843 <        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
844 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
845 <        else
846 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
847 <        fi
848 <        saved_CPPFLAGS=$CPPFLAGS
849 <        CPPFLAGS="$CPPFLAGS -mmmx"
850 <        AC_CHECK_HEADERS(mmintrin.h,  [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"])
851 <        CPPFLAGS="$CPPFLAGS -msse"
852 <        AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"])
853 <        CPPFLAGS="$CPPFLAGS -msse2"
854 <        AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"])
855 <        CPPFLAGS=$saved_CPPFLAGS
1355 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1356          ;;
1357 <      x86_64)
1358 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1357 >      mips)
1358 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1359 >        ;;
1360 >      powerpc)
1361 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1362 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1363 >        fi
1364          ;;
1365        esac
1366 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000"
1367 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1366 >      have_dyngen_gcc3=no
1367 >      case "x`$DYNGEN_CC -dumpversion`" in
1368 >      x[12].*) ;;
1369 >      x*) have_dyngen_gcc3=yes ;;
1370 >      esac
1371 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1372 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1373 >      else
1374 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1375 >      fi
1376 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1377 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1378          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1379        fi
1380 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1381 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1382 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1383 +      else
1384 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1385 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1386 +      fi
1387      else
1388        WANT_JIT=no
1389      fi
# Line 884 | Line 1406 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1406    AC_CACHE_CHECK([whether static data regions are executable],
1407      ac_cv_have_static_data_exec, [
1408      AC_TRY_RUN([int main(void) {
1409 < #if defined(__powerpc__)
1409 > #if defined(__powerpc__) || defined(__ppc__)
1410        static unsigned int p[8] = {0x4e800020,};
1411        asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1412        asm volatile("sync" : : : "memory");
# Line 900 | Line 1422 | if [[ "x$ac_cv_use_dyngen" = "xyes" ]];
1422      ac_cv_have_static_data_exec=no
1423      )
1424    ])
1425 + else
1426 +  ac_cv_use_dyngen=no
1427   fi
1428   AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1429    [Define if your system marks static data pages as executable.])
# Line 908 | Line 1432 | if [[ "x$WANT_JIT" = "xyes" ]]; then
1432    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1433   fi
1434  
1435 + dnl Higher level optimizations with MIPSPro compilers are possible
1436 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1437 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1438 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1439 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1440 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1441 + fi
1442 +
1443   dnl Generate Makefile.
1444 + AC_SUBST(PERL)
1445 + AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1446   AC_SUBST(DYNGENSRCS)
1447   AC_SUBST(DYNGEN_CC)
1448 + AC_SUBST(DYNGEN_CFLAGS)
1449 + AC_SUBST(DYNGEN_CXXFLAGS)
1450   AC_SUBST(DYNGEN_OP_FLAGS)
1451   AC_SUBST(SYSSRCS)
1452   AC_SUBST(CPUSRCS)
1453   AC_SUBST(BLESS)
1454   AC_SUBST(KEYCODES)
1455 < AC_OUTPUT(Makefile)
1455 > AC_OUTPUT([
1456 > Makefile
1457 > ../MacOSX/Info.plist
1458 > ])
1459  
1460   dnl Print summary.
1461   echo
1462   echo SheepShaver configuration summary:
1463   echo
1464   echo SDL support ...................... : $SDL_SUPPORT
1465 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1466   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1467   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1468   echo Using PowerPC emulator ........... : $EMULATED_PPC
# Line 931 | Line 1471 | echo Enable video on SEGV signals .....
1471   echo ESD sound support ................ : $WANT_ESD
1472   echo GTK user interface ............... : $WANT_GTK
1473   echo mon debugger support ............. : $WANT_MON
1474 + echo Addressing mode .................. : $WANT_ADDRESSING_MODE
1475   echo Bad memory access recovery type .. : $sigsegv_recovery
1476   echo
1477   echo "Configuration done. Now type \"make\"."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines