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.62 by asvitkine, 2008-11-21T01:09:28Z

# 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_ENABLE(standalone-gui,[  --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no])
32   AC_ARG_WITH(esd,            [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
33 < AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
33 > AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]],
34 >  [case "$withval" in
35 >   gtk1)      WANT_GTK="gtk";;
36 >   gtk|gtk2)  WANT_GTK="$withval";;
37 >   yes)       WANT_GTK="gtk2 gtk";;
38 >   *)         WANT_GTK="no";;
39 >   esac],
40 >  [WANT_GTK="gtk2 gtk"])
41   AC_ARG_WITH(mon,            [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
42   AC_ARG_WITH(dgcc,           [  --with-dgcc=COMPILER    use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval])
43  
# Line 90 | Line 106 | if [[ "x$WANT_MON" = "xyes" ]]; then
106    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
107      AC_MSG_RESULT(yes)
108      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
109 <    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
109 >    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c $mon_srcdir/disass/mips-dis.c $mon_srcdir/disass/mips-opc.c $mon_srcdir/disass/mips16-opc.c"
110      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
111      AC_CHECK_LIB(ncurses, tgetent, ,
112        AC_CHECK_LIB(termcap, tgetent, ,
# Line 110 | Line 126 | AC_SUBST(MONSRCS)
126  
127   dnl Checks for libraries.
128   AC_CHECK_LIB(posix4, sem_init)
129 + AC_CHECK_LIB(m, cos)
130  
131   dnl Do we need SDL?
132   WANT_SDL=no
# Line 127 | Line 144 | fi
144   if [[ "x$WANT_SDL" = "xyes" ]]; then
145    AC_PATH_PROG(sdl_config, "sdl-config")
146    if [[ -n "$sdl_config" ]]; then
147 <    case $target_os in
148 <    # Special treatment for Cygwin so that we can still use the POSIX layer
149 <    *cygwin*)
150 <      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
151 <      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
152 <      ;;
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
147 >    sdl_cflags=`$sdl_config --cflags`
148 >    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
149 >      sdl_libs=`$sdl_config --static-libs`
150 >    else
151 >      sdl_libs=`$sdl_config --libs`
152 >    fi
153      CFLAGS="$CFLAGS $sdl_cflags"
154      CXXFLAGS="$CXXFLAGS $sdl_cflags"
155      LIBS="$LIBS $sdl_libs"
# Line 177 | Line 185 | no:linux*|no:netbsd*)
185    AC_CHECK_LIB(pthread, pthread_create, , [
186      AC_CHECK_LIB(c_r, pthread_create, , [
187        AC_CHECK_LIB(PTL, pthread_create, , [
188 <        AC_MSG_ERROR([You need pthreads to run Basilisk II.])
188 >        dnl XXX remove when no pthreads case is merged
189 >        AC_MSG_ERROR([You need pthreads to run SheepShaver.])
190 >        HAVE_PTHREADS=no
191        ])
192      ])
193    ])
194    AC_CHECK_FUNCS(pthread_cancel)
195 +  AC_CHECK_FUNCS(pthread_cond_init pthread_testcancel)
196    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
197    AC_CHECK_FUNCS(pthread_mutexattr_settype)
198    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
199    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
200    SEMSRC=
201    AC_CHECK_FUNCS(sem_init, , [
# Line 197 | Line 205 | no:linux*|no:netbsd*)
205    ])
206    ;;
207   esac
208 + if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
209 +  AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
210 + fi
211 +
212 + dnl We use FBDev DGA if possible.
213 + if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
214 +  AC_CHECK_HEADER(linux/fb.h, [
215 +    AC_DEFINE(ENABLE_FBDEV_DGA, 1, [Define if using Linux fbdev extension.])
216 +  ], [
217 +    AC_MSG_WARN([Could not find Linux FBDev extension, ignoring --enable-fbdev-dga.])
218 +    WANT_FBDEV_DGA=no
219 +  ])
220 + fi
221  
222   dnl We use XFree86 DGA if possible.
223   if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then
# Line 222 | Line 243 | fi
243  
244   dnl We use GTK+ if possible.
245   UISRCS=../dummy/prefs_editor_dummy.cpp
246 < if [[ "x$WANT_GTK" = "xyes" ]]; then
246 > case "x$WANT_GTK" in
247 > xgtk2*)
248 >  WANT_GTK=no
249 >  AM_PATH_GTK_2_0(1.3.15, [
250 >    GUI_CFLAGS="$GTK_CFLAGS"
251 >    GUI_LIBS="$GTK_LIBS"
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 >  WANT_GTK=no
269    AM_PATH_GTK(1.2.0, [
270 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
271 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
272 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
230 <    LIBS="$LIBS $GTK_LIBS"
231 <    UISRCS=prefs_editor_gtk.cpp
270 >    GUI_CFLAGS="$GTK_CFLAGS"
271 >    GUI_LIBS="$GTK_LIBS"
272 >    WANT_GTK=gtk
273    ], [
274      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
234    WANT_GTK=no
275    ])
276   fi
277 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
278 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
279 +  UISRCS=prefs_editor_gtk.cpp
280 + fi
281 + AC_SUBST(GUI_CFLAGS)
282 + AC_SUBST(GUI_LIBS)
283 +
284 + dnl Build external GUI if requested.
285 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
286 +  WANT_STANDALONE_GUI=no
287 + fi
288 + if [[ "$WANT_GTK" = "no" ]]; then
289 +  WANT_STANDALONE_GUI=no
290 + fi
291 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
292  
293   dnl We use ESD if possible.
294   if [[ "x$WANT_ESD" = "xyes" ]]; then
295 +  WANT_ESD=no
296    AM_PATH_ESD(0.2.8, [
297      AC_DEFINE(ENABLE_ESD, 1, [Define is using ESD.])
298      CFLAGS="$CFLAGS $ESD_CFLAGS"
299      CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
300      LIBS="$LIBS $ESD_LIBS"
301 +    WANT_ESD=yes
302    ], [
303      AC_MSG_WARN([Could not find ESD, disabling ESD support.])
247    WANT_ESD=no
304    ])
305   fi
306  
# Line 254 | Line 310 | AC_SYS_LARGEFILE
310   dnl Checks for header files.
311   AC_HEADER_STDC
312   AC_HEADER_SYS_WAIT
313 < AC_CHECK_HEADERS(malloc.h)
313 > AC_CHECK_HEADERS(malloc.h stdint.h)
314   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)
315   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
316 < AC_CHECK_HEADERS(linux/if.h, [], [], [
317 < #if HAVE_SYS_SOCKET_H
318 < # include <sys/socket.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/time.h sys/poll.h sys/select.h arpa/inet.h)
318 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
319 > #ifdef HAVE_SYS_TYPES_H
320 > #include <sys/types.h>
321 > #endif
322 > #ifdef HAVE_SYS_SOCKET_H
323 > #include <sys/socket.h>
324   #endif
325   ])
326 < AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
326 > AC_CHECK_HEADERS(AvailabilityMacros.h)
327 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
328   AC_CHECK_HEADERS(fenv.h)
329  
330   dnl Checks for typedefs, structures, and compiler characteristics.
# Line 284 | Line 345 | AC_TYPE_SIGNAL
345   AC_HEADER_TIME
346   AC_STRUCT_TM
347  
348 + dnl Check whether sys/socket.h defines type socklen_t.
349 + dnl (extracted from ac-archive/Miscellaneous)
350 + AC_CACHE_CHECK([for socklen_t],
351 +  ac_cv_type_socklen_t, [
352 +  AC_TRY_COMPILE([
353 +    #include <sys/types.h>
354 +    #include <sys/socket.h>
355 +  ], [socklen_t len = 42; return 0;],
356 +  ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
357 +  dnl When cross-compiling, do not assume anything.
358 +  ac_cv_type_socklen_t="guessing no"
359 +  )
360 + ])
361 + if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
362 +  AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
363 + fi
364 +
365   dnl Check whether struct sigaction has sa_restorer member.
366   AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
367    ac_cv_signal_sa_restorer, [
# Line 300 | Line 378 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
378   fi
379  
380   dnl Checks for library functions.
381 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
381 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
382   AC_CHECK_FUNCS(nanosleep)
383   AC_CHECK_FUNCS(sigaction signal)
384   AC_CHECK_FUNCS(mmap mprotect munmap)
385   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
386 < AC_CHECK_FUNCS(posix_memalign memalign valloc)
387 < AC_CHECK_FUNCS(exp2f log2f exp2 log2 trunc)
386 > AC_CHECK_FUNCS(exp2f log2f exp2 log2)
387 > AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
388 > AC_CHECK_FUNCS(poll inet_aton)
389  
390   dnl Darwin seems to define mach_task_self() instead of task_self().
391   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 346 | Line 425 | mips-sony-bsd|mips-sony-newsos4)
425   *-*-cygwin*)
426          no_dev_ptmx=1
427          ;;
428 + *-*-darwin*)
429 +        no_dev_ptmx=1
430 +        ;;
431   esac
432  
433   if test -z "$no_dev_ptmx" ; then
# Line 366 | Line 448 | AC_CHECK_FILE([/dev/ptc],
448   )
449   dnl (end of code from openssh-3.2.2p1 configure.ac)
450  
451 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
452 + dnl doesn't work or is unimplemented. On these systems (mostly older
453 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
454 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
455 +  ac_cv_nonblocking_io, [
456 +  case "$host" in
457 +  *-*-osf*)
458 +    ac_cv_nonblocking_io=FIONBIO
459 +    ;;
460 +  *-*-sunos4*)
461 +    ac_cv_nonblocking_io=FIONBIO
462 +    ;;
463 +  *-*-ultrix*)
464 +    ac_cv_nonblocking_io=FIONBIO
465 +    ;;
466 +  *)
467 +    ac_cv_nonblocking_io=O_NONBLOCK
468 +    ;;
469 +  esac
470 + ])
471 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
472 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
473 + fi
474 +
475 + dnl Check whether compiler supports byte bit-fields
476 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
477 +  ac_cv_have_byte_bitfields, [
478 +  AC_LANG_SAVE
479 +  AC_LANG_CPLUSPLUS
480 +  AC_TRY_RUN([
481 +    struct A {
482 +      unsigned char b1:4;
483 +      unsigned char b2:4;
484 +      unsigned char c;
485 +      unsigned short s;
486 +      unsigned char a[4];
487 +    };
488 +
489 +    int main(void) {
490 +      A a;
491 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
492 +    }],
493 +    [ac_cv_have_byte_bitfields=yes],
494 +    [ac_cv_have_byte_bitfields=no],
495 +    dnl When cross-compiling, assume only GCC supports this
496 +    [if [[ "$GCC" = "yes" ]]; then
497 +      ac_cv_have_byte_bitfields="guessing yes"
498 +    else
499 +      ac_cv_have_byte_bitfields="guessing no"
500 +    fi]
501 +    )
502 +  AC_LANG_RESTORE
503 + ])
504 +
505   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
506 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
506 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
507    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
508    AC_CACHE_CHECK([whether compiler supports framework $1],
509      ac_Framework, [
510      saved_LIBS="$LIBS"
511      LIBS="$LIBS -framework $1"
512      AC_TRY_LINK(
513 <      [$2], [int main(void) { return 0; }],
513 >      [$2], [],
514        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
515      )
516    ])
# Line 387 | Line 523 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
523   dnl Check for some MacOS X frameworks
524   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
525   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
526 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
527 + AC_CHECK_FRAMEWORK(CoreAudio, [#include <CoreAudio/CoreAudio.h>])
528 + AC_CHECK_FRAMEWORK(AudioUnit, [#include <AudioUnit/AudioUnit.h>])
529 + AC_CHECK_FRAMEWORK(AudioToolbox, [#include <AudioToolbox/AudioToolbox.h>])
530  
531   dnl Select system-dependant sources.
532   SERIALSRC=serial_unix.cpp
533   ETHERSRC=../dummy/ether_dummy.cpp
534   SCSISRC=../dummy/scsi_dummy.cpp
535   AUDIOSRC=../dummy/audio_dummy.cpp
536 + PREFSSRC=../dummy/prefs_dummy.cpp
537   EXTFSSRC=extfs_unix.cpp
538   EXTRASYSSRCS=
539   case "$target_os" in
540   linux*)
541 <  ETHERSRC=Linux/ether_linux.cpp
541 >  ETHERSRC=ether_unix.cpp
542    AUDIOSRC=audio_oss_esd.cpp
543    SCSISRC=Linux/scsi_linux.cpp
544    if [[ "x$EMULATED_PPC" = "xno" ]]; then
545 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
545 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
546    fi
547    ;;
548 + freebsd*)
549 +  ETHERSRC=ether_unix.cpp
550 +  ;;
551   netbsd*)
552 +  ETHERSRC=ether_unix.cpp
553    if [[ "x$EMULATED_PPC" = "xno" ]]; then
554 <    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
554 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
555    fi
556    ;;
557   darwin*)
558 +  ETHERSRC=ether_unix.cpp
559    if [[ "x$EMULATED_PPC" = "xno" ]]; then
560 <    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
560 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
561    fi
562 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
562 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
563      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
564    fi
565    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
566 <    EXTFSSRC=../MacOSX/extfs_macosx.mm
566 >    EXTFSSRC=../MacOSX/extfs_macosx.cpp
567 >    PREFSSRC="../MacOSX/prefs_macosx.mm ../MacOSX/PrefsEditor/PrefsEditor.mm"
568 >    CPPFLAGS="$CPPFLAGS -I../MacOSX/PrefsEditor"
569 > fi
570 >  if [[ "x$ac_cv_framework_CoreAudio" = "xyes" ]]; then
571 >    AUDIOSRC="../MacOSX/audio_macosx.cpp ../MacOSX/AudioBackEnd.cpp ../MacOSX/AudioDevice.cpp ../MacOSX/MacOSX_sound_if.cpp"
572    fi
573    ;;
574 < cygwin*)
575 <  SERIALSRC="../dummy/serial_dummy.cpp"
574 > irix*)
575 >  AUDIOSRC=Irix/audio_irix.cpp
576 >  LIBS="$LIBS -laudio"
577 >  WANT_ESD=no
578 >
579 >  dnl Check if our compiler supports -IPA (MIPSPro)
580 >  HAVE_IPA=no
581 >  ocflags="$CFLAGS"
582 >  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
583 >  AC_MSG_CHECKING(if "-IPA" works)
584 >  dnl Do a test compile of an empty function
585 >  AC_TRY_COMPILE([#if defined __GNUC__
586 >                  # error GCC does not support IPA yet
587 >                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
588 >  CFLAGS="$ocflags"
589    ;;
590   esac
591  
592 + dnl Is the slirp library supported?
593 + case "$ac_cv_have_byte_bitfields" in
594 + yes|"guessing yes")
595 +  CAN_SLIRP=yes
596 +  ETHERSRC=ether_unix.cpp
597 +  ;;
598 + esac
599 + if [[ -n "$CAN_SLIRP" ]]; then
600 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
601 +  SLIRP_SRCS="\
602 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
603 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
604 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
605 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
606 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
607 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
608 + fi
609 + AC_SUBST(SLIRP_SRCS)
610 +
611   dnl SDL overrides
612   if [[ "x$WANT_SDL" = "xyes" ]]; then
613    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 436 | Line 619 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
619    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
620      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
621    else
622 <    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
622 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
623    fi
624   else
625    VIDEOSRCS="video_x.cpp"
# Line 455 | Line 631 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
631    AUDIOSRC="../SDL/audio_sdl.cpp"
632   fi
633  
634 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
634 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $PREFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
635  
636   dnl Define a macro that translates a yesno-variable into a C macro definition
637   dnl to be put into the config.h file
638   dnl $1 -- the macro to define
639   dnl $2 -- the value to translate
640   dnl $3 -- template name
641 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
641 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
642      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
643          AC_DEFINE($1, 1, $3)
644      fi
# Line 871 | Line 1047 | fi
1047  
1048   dnl Check addressing mode to use
1049   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
1050   if [[ "$EMULATED_PPC" != "yes" ]]; then
1051    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
1052      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 958 | Line 1128 | EOF
1128   fi
1129   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1130  
1131 + dnl Utility macro used by next two tests.
1132 + dnl AC_EXAMINE_OBJECT(C source code,
1133 + dnl     commands examining object file,
1134 + dnl     [commands to run if compile failed]):
1135 + dnl
1136 + dnl Compile the source code to an object file; then convert it into a
1137 + dnl printable representation.  All unprintable characters and
1138 + dnl asterisks (*) are replaced by dots (.).  All white space is
1139 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1140 + dnl output, but runs of newlines are compressed to a single newline.
1141 + dnl Finally, line breaks are forcibly inserted so that no line is
1142 + dnl longer than 80 columns and the file ends with a newline.  The
1143 + dnl result of all this processing is in the file conftest.dmp, which
1144 + dnl may be examined by the commands in the second argument.
1145 + dnl
1146 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1147 + [AC_LANG_SAVE
1148 + AC_LANG_C
1149 + dnl Next bit cribbed from AC_TRY_COMPILE.
1150 + cat > conftest.$ac_ext <<EOF
1151 + [#line __oline__ "configure"
1152 + #include "confdefs.h"
1153 + $1
1154 + ]EOF
1155 + if AC_TRY_EVAL(ac_compile); then
1156 +  od -c conftest.o |
1157 +    sed ['s/^[0-7]*[    ]*/ /
1158 +          s/\*/./g
1159 +          s/ \\n/*/g
1160 +          s/ [0-9][0-9][0-9]/./g
1161 +          s/  \\[^ ]/./g'] |
1162 +    tr -d '
1163 + ' | tr -s '*' '
1164 + ' | fold | sed '$a\
1165 + ' > conftest.dmp
1166 +  $2
1167 + ifelse($3, , , else
1168 +  $3
1169 + )dnl
1170 + fi
1171 + rm -rf conftest*
1172 + AC_LANG_RESTORE])
1173 +
1174 + dnl Floating point format probe.
1175 + dnl The basic concept is the same as the above: grep the object
1176 + dnl file for an interesting string.  We have to watch out for
1177 + dnl rounding changing the values in the object, however; this is
1178 + dnl handled by ignoring the least significant byte of the float.
1179 + dnl
1180 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1181 + dnl It does know about PDP-10 idiosyncratic format, but this is
1182 + dnl not presently supported by GCC.  S/390 "binary floating point"
1183 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1184 + dnl as ASCII?)
1185 + dnl
1186 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1187 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1188 + [gcc_AC_EXAMINE_OBJECT(
1189 + [/* This will not work unless sizeof(double) == 8.  */
1190 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1191 +
1192 + /* This structure must have no internal padding.  */
1193 + struct possibility {
1194 +  char prefix[8];
1195 +  double candidate;
1196 +  char postfix[8];
1197 + };
1198 +
1199 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1200 + struct possibility table [] =
1201 + {
1202 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1203 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1204 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1205 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1206 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1207 + };],
1208 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1209 +    ac_cv_c_float_format='IEEE (big-endian)'
1210 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1211 +    ac_cv_c_float_format='IEEE (big-endian)'
1212 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1213 +    ac_cv_c_float_format='IEEE (little-endian)'
1214 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1215 +    ac_cv_c_float_format='IEEE (little-endian)'
1216 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1217 +    ac_cv_c_float_format='VAX D-float'
1218 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1219 +    ac_cv_c_float_format='PDP-10'
1220 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1221 +    ac_cv_c_float_format='IBM 370 hex'
1222 +  else
1223 +    AC_MSG_ERROR(Unknown floating point format)
1224 +  fi],
1225 +  [AC_MSG_ERROR(compile failed)])
1226 + ])
1227 + # IEEE is the default format.  If the float endianness isn't the same
1228 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1229 + # (which is a tristate: yes, no, default).  This is only an issue with
1230 + # IEEE; the other formats are only supported by a few machines each,
1231 + # all with the same endianness.
1232 + format=IEEE_FLOAT_FORMAT
1233 + fbigend=
1234 + case $ac_cv_c_float_format in
1235 +    'IEEE (big-endian)' )
1236 +        if test $ac_cv_c_bigendian = no; then
1237 +            fbigend=1
1238 +        fi
1239 +        ;;
1240 +    'IEEE (little-endian)' )
1241 +        if test $ac_cv_c_bigendian = yes; then
1242 +            fbigend=0
1243 +        fi
1244 +        ;;
1245 +    'VAX D-float' )
1246 +        format=VAX_FLOAT_FORMAT
1247 +        ;;
1248 +    'PDP-10' )
1249 +        format=PDP10_FLOAT_FORMAT
1250 +        ;;
1251 +    'IBM 370 hex' )
1252 +        format=IBM_FLOAT_FORMAT
1253 +        ;;
1254 + esac
1255 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1256 +  [Define to the floating point format of the host machine.])
1257 + if test -n "$fbigend"; then
1258 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1259 +  [Define to 1 if the host machine stores floating point numbers in
1260 +   memory with the word containing the sign bit at the lowest address,
1261 +   or to 0 if it does it the other way around.
1262 +
1263 +   This macro should not be defined if the ordering is the same as for
1264 +   multi-word integers.])
1265 + fi
1266 + ])
1267 +
1268 + dnl Check for host float format
1269 + gcc_AC_C_FLOAT_FORMAT
1270 +
1271   dnl Platform specific binary postprocessor
1272   AC_PATH_PROG(BLESS, "true")
1273   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 968 | Line 1278 | fi
1278   dnl Check for GCC 2.7 or higher.
1279   HAVE_GCC27=no
1280   AC_MSG_CHECKING(for GCC 2.7 or higher)
1281 < AC_EGREP_CPP(xyes,
1282 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1283 <  xyes
1284 < #endif
1285 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1281 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1282 >                                     # error gcc < 2.7
1283 >                                     typedef syntax error;
1284 >                                     #endif
1285 >                                   ]])],
1286 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1287 >                  [AC_MSG_RESULT(no)])
1288  
1289   dnl Check for GCC 3.0 or higher.
1290   HAVE_GCC30=no
1291   AC_MSG_CHECKING(for GCC 3.0 or higher)
1292 < AC_EGREP_CPP(xyes,
1293 < [#if __GNUC__ >= 3
1294 <  xyes
1295 < #endif
1296 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1292 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1293 >                                     # error gcc < 3
1294 >                                     typedef syntax error;
1295 >                                     #endif
1296 >                                   ]])],
1297 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1298 >                  [AC_MSG_RESULT(no)])
1299  
1300   dnl Check for ICC.
1301   AC_MSG_CHECKING(for ICC)
# Line 992 | Line 1306 | fi
1306   AC_MSG_RESULT($HAVE_ICC)
1307  
1308   dnl Determine the generated object format
1309 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1309 > AC_CACHE_CHECK([the format of compiler generated objects],
1310    ac_cv_object_format, [
1311    echo 'int i;' > conftest.$ac_ext
1312    ac_cv_object_format=no
# Line 1001 | Line 1315 | AC_CACHE_CHECK([whether the compiler can
1315      *"ELF"*)
1316        ac_cv_object_format=elf
1317        ;;
1318 +    *"Mach-O"*)
1319 +      ac_cv_object_format=mach
1320 +      ;;
1321      *)
1322        ac_cv_object_format=unknown
1323        ;;
# Line 1009 | Line 1326 | AC_CACHE_CHECK([whether the compiler can
1326    rm -rf conftest*
1327   ])
1328  
1329 + dnl Add -fno-strict-aliasing for slirp sources
1330 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1331 +  SAVED_CFLAGS="$CFLAGS"
1332 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1333 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1334 +    ac_cv_gcc_no_strict_aliasing, [
1335 +    AC_TRY_COMPILE([],[],
1336 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1337 +      [ac_cv_gcc_no_strict_aliasing=no])
1338 +  ])
1339 +  CFLAGS="$SAVED_CFLAGS"
1340 + fi
1341 +
1342 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1343 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1344 +  SAVED_CFLAGS="$CFLAGS"
1345 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1346 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1347 +    ac_cv_gcc_mdynamic_no_pic, [
1348 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1349 +  ])
1350 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1351 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1352 +  else
1353 +    CFLAGS="$SAVED_CFLAGS"
1354 +  fi
1355 + fi
1356 +
1357   dnl CPU emulator sources
1358   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1359    CPUSRCS="\
1360      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1361 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1362      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1363      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1364      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1365 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1365 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1366 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1367    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1368  
1369    dnl Enable JIT compiler, if possible
# Line 1033 | Line 1380 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1380        i?86:elf)
1381          ac_cv_use_dyngen=yes
1382          ;;
1383 +      mips:elf)
1384 +        ac_cv_use_dyngen=yes
1385 +        ;;
1386 +      powerpc:mach)
1387 +        ac_cv_use_dyngen=yes
1388 +        ;;
1389 +      i?86:mach)
1390 +        ac_cv_use_dyngen=yes
1391 +        ;;
1392        *:*)
1393          ac_cv_use_dyngen=no
1394          ;;
# Line 1042 | Line 1398 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1398          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1399            DYNGEN_CC=$CXX
1400          else
1401 <          for p in /usr/bin /usr/local/bin; do
1401 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1402              gxx="$p/g++"
1403              if [[ -x "$gxx" ]]; then
1404                DYNGEN_CC="$gxx"
# Line 1050 | Line 1406 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1406            done
1407          fi
1408        fi
1409 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1409 >      if [[ -z "$DYNGEN_CC" ]]; then
1410          ac_cv_use_dyngen=no
1411        fi
1412      ])
1413      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1414        case $host_cpu in
1415        i?86)
1416 <        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
1416 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1417          ;;
1418 <      x86_64)
1419 <        AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h)
1418 >      mips)
1419 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1420          ;;
1421 +      powerpc)
1422 +        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1423 +          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1424 +        fi
1425 +        ;;
1426 +      esac
1427 +      have_dyngen_gcc3=no
1428 +      case "x`$DYNGEN_CC -dumpversion`" in
1429 +      x[12].*) ;;
1430 +      x*) have_dyngen_gcc3=yes ;;
1431        esac
1432 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0"
1433 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1432 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1433 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1434 >      else
1435 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1436 >      fi
1437 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1438 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1439          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1440        fi
1441 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1442 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1443 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1444 +      else
1445 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1446 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1447 +      fi
1448      else
1449        WANT_JIT=no
1450      fi
# Line 1091 | Line 1456 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1456        CPUSRCS="\
1457          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1458          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1459 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1459 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1460 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1461      fi
1462    fi
1463    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1464   else
1465    WANT_JIT=no
1466   fi
1101 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1102  AC_CACHE_CHECK([whether static data regions are executable],
1103    ac_cv_have_static_data_exec, [
1104    AC_TRY_RUN([int main(void) {
1105 #if defined(__powerpc__)
1106      static unsigned int p[8] = {0x4e800020,};
1107      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1108      asm volatile("sync" : : : "memory");
1109      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1110      asm volatile("sync" : : : "memory");
1111      asm volatile("isync" : : : "memory");
1112      ((void (*)(void))p)();
1113      return 0;
1114 #endif
1115      return 1;
1116    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1117    dnl When cross-compiling, do not assume anything.
1118    ac_cv_have_static_data_exec=no
1119    )
1120  ])
1121 else
1122  ac_cv_use_dyngen=no
1123 fi
1124 AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1125  [Define if your system marks static data pages as executable.])
1126
1467   if [[ "x$WANT_JIT" = "xyes" ]]; then
1468    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1469   fi
1470  
1471 + dnl Higher level optimizations with MIPSPro compilers are possible
1472 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1473 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1474 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1475 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1476 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1477 + fi
1478 +
1479 + dnl Check for linker script support
1480 + case $target_os:$target_cpu in
1481 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1482 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1483 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1484 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1485 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1486 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1487 + esac
1488 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1489 +  AC_CACHE_CHECK([whether linker script is usable],
1490 +    ac_cv_linker_script_works, [
1491 +    AC_LANG_SAVE
1492 +    AC_LANG_CPLUSPLUS
1493 +    saved_LDFLAGS="$LDFLAGS"
1494 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1495 +    AC_TRY_RUN(
1496 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1497 +      [ac_cv_linker_script_works=yes],
1498 +      [ac_cv_linker_script_works=no],
1499 +      dnl When cross-compiling, assume it works
1500 +      [ac_cv_linker_script_works="guessing yes"]
1501 +    )
1502 +    AC_LANG_RESTORE
1503 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1504 +      LDFLAGS="$saved_LDFLAGS"
1505 +      LINKER_SCRIPT_FLAGS=""
1506 +    fi
1507 +  ])
1508 + fi
1509 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1510 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1511 +
1512   dnl Generate Makefile.
1513   AC_SUBST(PERL)
1514   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1515   AC_SUBST(DYNGENSRCS)
1516   AC_SUBST(DYNGEN_CC)
1517 + AC_SUBST(DYNGEN_CFLAGS)
1518 + AC_SUBST(DYNGEN_CXXFLAGS)
1519   AC_SUBST(DYNGEN_OP_FLAGS)
1520   AC_SUBST(SYSSRCS)
1521   AC_SUBST(CPUSRCS)
# Line 1148 | Line 1531 | echo
1531   echo SheepShaver configuration summary:
1532   echo
1533   echo SDL support ...................... : $SDL_SUPPORT
1534 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1535   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1536   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1537   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines