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.19 by gbeauche, 2005-03-13T12:49:30Z vs.
Revision 1.63 by asvitkine, 2009-02-11T19:22:16Z

# 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 + AC_CHECK_FRAMEWORK(AppKit, [])
531  
532   dnl Select system-dependant sources.
533   SERIALSRC=serial_unix.cpp
534   ETHERSRC=../dummy/ether_dummy.cpp
535   SCSISRC=../dummy/scsi_dummy.cpp
536   AUDIOSRC=../dummy/audio_dummy.cpp
537 + PREFSSRC=../dummy/prefs_dummy.cpp
538   EXTFSSRC=extfs_unix.cpp
539   EXTRASYSSRCS=
540   case "$target_os" in
541   linux*)
542 <  ETHERSRC=Linux/ether_linux.cpp
542 >  ETHERSRC=ether_unix.cpp
543    AUDIOSRC=audio_oss_esd.cpp
544    SCSISRC=Linux/scsi_linux.cpp
545    if [[ "x$EMULATED_PPC" = "xno" ]]; then
546 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
546 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
547    fi
548    ;;
549 + freebsd*)
550 +  ETHERSRC=ether_unix.cpp
551 +  ;;
552   netbsd*)
553 +  ETHERSRC=ether_unix.cpp
554    if [[ "x$EMULATED_PPC" = "xno" ]]; then
555 <    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
555 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
556    fi
557    ;;
558   darwin*)
559 +  ETHERSRC=ether_unix.cpp
560    if [[ "x$EMULATED_PPC" = "xno" ]]; then
561 <    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
561 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
562    fi
563 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
563 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
564      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
565    fi
566    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
567 <    EXTFSSRC=../MacOSX/extfs_macosx.mm
567 >    EXTFSSRC=../MacOSX/extfs_macosx.cpp
568 >    if [[ "x$ac_cv_framework_AppKit" = "xyes" ]]; then
569 >      PREFSSRC="../MacOSX/prefs_macosx.mm ../MacOSX/PrefsEditor/PrefsEditor.mm"
570 >      CPPFLAGS="$CPPFLAGS -I../MacOSX/PrefsEditor"
571 >    fi
572 >  fi
573 >  if [[ "x$ac_cv_framework_CoreAudio" = "xyes" -a "x$WANT_SDL_AUDIO" = "xno" ]]; then
574 >    AUDIOSRC="../MacOSX/audio_macosx.cpp ../MacOSX/AudioBackEnd.cpp ../MacOSX/AudioDevice.cpp ../MacOSX/MacOSX_sound_if.cpp"
575    fi
576    ;;
577 < cygwin*)
578 <  SERIALSRC="../dummy/serial_dummy.cpp"
577 > irix*)
578 >  AUDIOSRC=Irix/audio_irix.cpp
579 >  LIBS="$LIBS -laudio"
580 >  WANT_ESD=no
581 >
582 >  dnl Check if our compiler supports -IPA (MIPSPro)
583 >  HAVE_IPA=no
584 >  ocflags="$CFLAGS"
585 >  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
586 >  AC_MSG_CHECKING(if "-IPA" works)
587 >  dnl Do a test compile of an empty function
588 >  AC_TRY_COMPILE([#if defined __GNUC__
589 >                  # error GCC does not support IPA yet
590 >                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
591 >  CFLAGS="$ocflags"
592    ;;
593   esac
594  
595 + dnl Is the slirp library supported?
596 + case "$ac_cv_have_byte_bitfields" in
597 + yes|"guessing yes")
598 +  CAN_SLIRP=yes
599 +  ETHERSRC=ether_unix.cpp
600 +  ;;
601 + esac
602 + if [[ -n "$CAN_SLIRP" ]]; then
603 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
604 +  SLIRP_SRCS="\
605 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
606 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
607 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
608 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
609 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
610 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
611 + fi
612 + AC_SUBST(SLIRP_SRCS)
613 +
614   dnl SDL overrides
615   if [[ "x$WANT_SDL" = "xyes" ]]; then
616    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
# Line 436 | Line 622 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
622    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
623      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
624    else
625 <    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
625 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
626    fi
627   else
628    VIDEOSRCS="video_x.cpp"
# Line 455 | Line 634 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
634    AUDIOSRC="../SDL/audio_sdl.cpp"
635   fi
636  
637 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
637 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $PREFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
638  
639   dnl Define a macro that translates a yesno-variable into a C macro definition
640   dnl to be put into the config.h file
641   dnl $1 -- the macro to define
642   dnl $2 -- the value to translate
643   dnl $3 -- template name
644 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
644 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
645      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
646          AC_DEFINE($1, 1, $3)
647      fi
# Line 871 | Line 1050 | fi
1050  
1051   dnl Check addressing mode to use
1052   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
1053   if [[ "$EMULATED_PPC" != "yes" ]]; then
1054    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
1055      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 958 | Line 1131 | EOF
1131   fi
1132   AC_MSG_RESULT($WANT_ADDRESSING_MODE)
1133  
1134 + dnl Utility macro used by next two tests.
1135 + dnl AC_EXAMINE_OBJECT(C source code,
1136 + dnl     commands examining object file,
1137 + dnl     [commands to run if compile failed]):
1138 + dnl
1139 + dnl Compile the source code to an object file; then convert it into a
1140 + dnl printable representation.  All unprintable characters and
1141 + dnl asterisks (*) are replaced by dots (.).  All white space is
1142 + dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
1143 + dnl output, but runs of newlines are compressed to a single newline.
1144 + dnl Finally, line breaks are forcibly inserted so that no line is
1145 + dnl longer than 80 columns and the file ends with a newline.  The
1146 + dnl result of all this processing is in the file conftest.dmp, which
1147 + dnl may be examined by the commands in the second argument.
1148 + dnl
1149 + AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
1150 + [AC_LANG_SAVE
1151 + AC_LANG_C
1152 + dnl Next bit cribbed from AC_TRY_COMPILE.
1153 + cat > conftest.$ac_ext <<EOF
1154 + [#line __oline__ "configure"
1155 + #include "confdefs.h"
1156 + $1
1157 + ]EOF
1158 + if AC_TRY_EVAL(ac_compile); then
1159 +  od -c conftest.o |
1160 +    sed ['s/^[0-7]*[    ]*/ /
1161 +          s/\*/./g
1162 +          s/ \\n/*/g
1163 +          s/ [0-9][0-9][0-9]/./g
1164 +          s/  \\[^ ]/./g'] |
1165 +    tr -d '
1166 + ' | tr -s '*' '
1167 + ' | fold | sed '$a\
1168 + ' > conftest.dmp
1169 +  $2
1170 + ifelse($3, , , else
1171 +  $3
1172 + )dnl
1173 + fi
1174 + rm -rf conftest*
1175 + AC_LANG_RESTORE])
1176 +
1177 + dnl Floating point format probe.
1178 + dnl The basic concept is the same as the above: grep the object
1179 + dnl file for an interesting string.  We have to watch out for
1180 + dnl rounding changing the values in the object, however; this is
1181 + dnl handled by ignoring the least significant byte of the float.
1182 + dnl
1183 + dnl Does not know about VAX G-float or C4x idiosyncratic format.
1184 + dnl It does know about PDP-10 idiosyncratic format, but this is
1185 + dnl not presently supported by GCC.  S/390 "binary floating point"
1186 + dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
1187 + dnl as ASCII?)
1188 + dnl
1189 + AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
1190 + [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
1191 + [gcc_AC_EXAMINE_OBJECT(
1192 + [/* This will not work unless sizeof(double) == 8.  */
1193 + extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
1194 +
1195 + /* This structure must have no internal padding.  */
1196 + struct possibility {
1197 +  char prefix[8];
1198 +  double candidate;
1199 +  char postfix[8];
1200 + };
1201 +
1202 + #define C(cand) { "\nformat:", cand, ":tamrof\n" }
1203 + struct possibility table [] =
1204 + {
1205 +  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
1206 +  C( 3.53802595280598432000e+18), /* D__float - VAX */
1207 +  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
1208 +  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
1209 +  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
1210 + };],
1211 + [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1212 +    ac_cv_c_float_format='IEEE (big-endian)'
1213 +  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
1214 +    ac_cv_c_float_format='IEEE (big-endian)'
1215 +  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
1216 +    ac_cv_c_float_format='IEEE (little-endian)'
1217 +  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
1218 +    ac_cv_c_float_format='IEEE (little-endian)'
1219 +  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
1220 +    ac_cv_c_float_format='VAX D-float'
1221 +  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
1222 +    ac_cv_c_float_format='PDP-10'
1223 +  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
1224 +    ac_cv_c_float_format='IBM 370 hex'
1225 +  else
1226 +    AC_MSG_ERROR(Unknown floating point format)
1227 +  fi],
1228 +  [AC_MSG_ERROR(compile failed)])
1229 + ])
1230 + # IEEE is the default format.  If the float endianness isn't the same
1231 + # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
1232 + # (which is a tristate: yes, no, default).  This is only an issue with
1233 + # IEEE; the other formats are only supported by a few machines each,
1234 + # all with the same endianness.
1235 + format=IEEE_FLOAT_FORMAT
1236 + fbigend=
1237 + case $ac_cv_c_float_format in
1238 +    'IEEE (big-endian)' )
1239 +        if test $ac_cv_c_bigendian = no; then
1240 +            fbigend=1
1241 +        fi
1242 +        ;;
1243 +    'IEEE (little-endian)' )
1244 +        if test $ac_cv_c_bigendian = yes; then
1245 +            fbigend=0
1246 +        fi
1247 +        ;;
1248 +    'VAX D-float' )
1249 +        format=VAX_FLOAT_FORMAT
1250 +        ;;
1251 +    'PDP-10' )
1252 +        format=PDP10_FLOAT_FORMAT
1253 +        ;;
1254 +    'IBM 370 hex' )
1255 +        format=IBM_FLOAT_FORMAT
1256 +        ;;
1257 + esac
1258 + AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
1259 +  [Define to the floating point format of the host machine.])
1260 + if test -n "$fbigend"; then
1261 +        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
1262 +  [Define to 1 if the host machine stores floating point numbers in
1263 +   memory with the word containing the sign bit at the lowest address,
1264 +   or to 0 if it does it the other way around.
1265 +
1266 +   This macro should not be defined if the ordering is the same as for
1267 +   multi-word integers.])
1268 + fi
1269 + ])
1270 +
1271 + dnl Check for host float format
1272 + gcc_AC_C_FLOAT_FORMAT
1273 +
1274   dnl Platform specific binary postprocessor
1275   AC_PATH_PROG(BLESS, "true")
1276   if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
# Line 968 | Line 1281 | fi
1281   dnl Check for GCC 2.7 or higher.
1282   HAVE_GCC27=no
1283   AC_MSG_CHECKING(for GCC 2.7 or higher)
1284 < AC_EGREP_CPP(xyes,
1285 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1286 <  xyes
1287 < #endif
1288 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1284 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1285 >                                     # error gcc < 2.7
1286 >                                     typedef syntax error;
1287 >                                     #endif
1288 >                                   ]])],
1289 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1290 >                  [AC_MSG_RESULT(no)])
1291  
1292   dnl Check for GCC 3.0 or higher.
1293   HAVE_GCC30=no
1294   AC_MSG_CHECKING(for GCC 3.0 or higher)
1295 < AC_EGREP_CPP(xyes,
1296 < [#if __GNUC__ >= 3
1297 <  xyes
1298 < #endif
1299 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1295 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1296 >                                     # error gcc < 3
1297 >                                     typedef syntax error;
1298 >                                     #endif
1299 >                                   ]])],
1300 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1301 >                  [AC_MSG_RESULT(no)])
1302  
1303   dnl Check for ICC.
1304   AC_MSG_CHECKING(for ICC)
# Line 992 | Line 1309 | fi
1309   AC_MSG_RESULT($HAVE_ICC)
1310  
1311   dnl Determine the generated object format
1312 < AC_CACHE_CHECK([whether the compiler can generate ELF objects],
1312 > AC_CACHE_CHECK([the format of compiler generated objects],
1313    ac_cv_object_format, [
1314    echo 'int i;' > conftest.$ac_ext
1315    ac_cv_object_format=no
# Line 1001 | Line 1318 | AC_CACHE_CHECK([whether the compiler can
1318      *"ELF"*)
1319        ac_cv_object_format=elf
1320        ;;
1321 +    *"Mach-O"*)
1322 +      ac_cv_object_format=mach
1323 +      ;;
1324      *)
1325        ac_cv_object_format=unknown
1326        ;;
# Line 1009 | Line 1329 | AC_CACHE_CHECK([whether the compiler can
1329    rm -rf conftest*
1330   ])
1331  
1332 + dnl Add -fno-strict-aliasing for slirp sources
1333 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1334 +  SAVED_CFLAGS="$CFLAGS"
1335 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1336 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1337 +    ac_cv_gcc_no_strict_aliasing, [
1338 +    AC_TRY_COMPILE([],[],
1339 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1340 +      [ac_cv_gcc_no_strict_aliasing=no])
1341 +  ])
1342 +  CFLAGS="$SAVED_CFLAGS"
1343 + fi
1344 +
1345 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1346 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1347 +  SAVED_CFLAGS="$CFLAGS"
1348 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1349 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1350 +    ac_cv_gcc_mdynamic_no_pic, [
1351 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1352 +  ])
1353 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1354 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1355 +  else
1356 +    CFLAGS="$SAVED_CFLAGS"
1357 +  fi
1358 + fi
1359 +
1360   dnl CPU emulator sources
1361   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1362    CPUSRCS="\
1363      ../kpx_cpu/src/mathlib/ieeefp.cpp \
1364 +    ../kpx_cpu/src/mathlib/mathlib.cpp \
1365      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1366      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1367      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1368 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1368 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1369 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1370    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1371  
1372    dnl Enable JIT compiler, if possible
# Line 1033 | Line 1383 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1383        i?86:elf)
1384          ac_cv_use_dyngen=yes
1385          ;;
1386 +      mips:elf)
1387 +        ac_cv_use_dyngen=yes
1388 +        ;;
1389 +      powerpc:mach)
1390 +        ac_cv_use_dyngen=yes
1391 +        ;;
1392 +      i?86:mach)
1393 +        ac_cv_use_dyngen=yes
1394 +        ;;
1395        *:*)
1396          ac_cv_use_dyngen=no
1397          ;;
# Line 1042 | Line 1401 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1401          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1402            DYNGEN_CC=$CXX
1403          else
1404 <          for p in /usr/bin /usr/local/bin; do
1404 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1405              gxx="$p/g++"
1406              if [[ -x "$gxx" ]]; then
1407                DYNGEN_CC="$gxx"
# Line 1050 | Line 1409 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1409            done
1410          fi
1411        fi
1412 <      if [[ -z "$DYNGEN_CC" ]] || ! { echo '#include <limits>' | $DYNGEN_CC -xc++ -c -o /dev/null - >& /dev/null; }; then
1412 >      if [[ -z "$DYNGEN_CC" ]]; then
1413          ac_cv_use_dyngen=no
1414        fi
1415      ])
1416      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1417        case $host_cpu in
1418        i?86)
1419 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1420 <        if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1421 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1422 <        else
1423 <          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1419 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1420 >        ;;
1421 >      mips)
1422 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1423 >        ;;
1424 >      powerpc)
1425 >        if [[ "x$ac_cv_object_format" = "xmach" ]]; then
1426 >          DYNGEN_OP_FLAGS="-mdynamic-no-pic"
1427          fi
1428          ;;
1429        esac
1430 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -g0"
1431 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1430 >      have_dyngen_gcc3=no
1431 >      case "x`$DYNGEN_CC -dumpversion`" in
1432 >      x[12].*) ;;
1433 >      x*) have_dyngen_gcc3=yes ;;
1434 >      esac
1435 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1436 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1437 >      else
1438 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1439 >      fi
1440 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1441 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1442          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1443        fi
1444 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1445 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1446 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1447 +      else
1448 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1449 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1450 +      fi
1451      else
1452        WANT_JIT=no
1453      fi
# Line 1080 | Line 1459 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1459        CPUSRCS="\
1460          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1461          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1462 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1462 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1463 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1464      fi
1465    fi
1466    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1467   else
1468    WANT_JIT=no
1469   fi
1090 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1091  AC_CACHE_CHECK([whether static data regions are executable],
1092    ac_cv_have_static_data_exec, [
1093    AC_TRY_RUN([int main(void) {
1094 #if defined(__powerpc__)
1095      static unsigned int p[8] = {0x4e800020,};
1096      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1097      asm volatile("sync" : : : "memory");
1098      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1099      asm volatile("sync" : : : "memory");
1100      asm volatile("isync" : : : "memory");
1101      ((void (*)(void))p)();
1102      return 0;
1103 #endif
1104      return 1;
1105    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1106    dnl When cross-compiling, do not assume anything.
1107    ac_cv_have_static_data_exec=no
1108    )
1109  ])
1110 else
1111  ac_cv_use_dyngen=no
1112 fi
1113 AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1114  [Define if your system marks static data pages as executable.])
1115
1470   if [[ "x$WANT_JIT" = "xyes" ]]; then
1471    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1472   fi
1473  
1474 + dnl Higher level optimizations with MIPSPro compilers are possible
1475 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1476 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1477 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1478 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1479 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1480 + fi
1481 +
1482 + dnl Check for linker script support
1483 + case $target_os:$target_cpu in
1484 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1485 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1486 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1487 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1488 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1489 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1490 + esac
1491 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1492 +  AC_CACHE_CHECK([whether linker script is usable],
1493 +    ac_cv_linker_script_works, [
1494 +    AC_LANG_SAVE
1495 +    AC_LANG_CPLUSPLUS
1496 +    saved_LDFLAGS="$LDFLAGS"
1497 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1498 +    AC_TRY_RUN(
1499 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1500 +      [ac_cv_linker_script_works=yes],
1501 +      [ac_cv_linker_script_works=no],
1502 +      dnl When cross-compiling, assume it works
1503 +      [ac_cv_linker_script_works="guessing yes"]
1504 +    )
1505 +    AC_LANG_RESTORE
1506 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1507 +      LDFLAGS="$saved_LDFLAGS"
1508 +      LINKER_SCRIPT_FLAGS=""
1509 +    fi
1510 +  ])
1511 + fi
1512 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1513 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1514 +
1515   dnl Generate Makefile.
1516   AC_SUBST(PERL)
1517   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1518   AC_SUBST(DYNGENSRCS)
1519   AC_SUBST(DYNGEN_CC)
1520 + AC_SUBST(DYNGEN_CFLAGS)
1521 + AC_SUBST(DYNGEN_CXXFLAGS)
1522   AC_SUBST(DYNGEN_OP_FLAGS)
1523   AC_SUBST(SYSSRCS)
1524   AC_SUBST(CPUSRCS)
# Line 1137 | Line 1534 | echo
1534   echo SheepShaver configuration summary:
1535   echo
1536   echo SDL support ...................... : $SDL_SUPPORT
1537 + echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1538   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1539   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE
1540   echo Using PowerPC emulator ........... : $EMULATED_PPC

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines