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.28 by gbeauche, 2005-06-22T16:38:15Z vs.
Revision 1.75 by asvitkine, 2012-06-17T23:14:11Z

# 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)
8 + AH_TOP(
9 + #ifndef CONFIG_H
10 + #define CONFIG_H
11 + )
12 + AH_BOTTOM(
13 + #endif /* CONFIG_H */
14 + )
15  
16   dnl Canonical system information.
17   AC_CANONICAL_HOST
# Line 14 | Line 21 | dnl Some systems do not put corefiles in
21   dnl cores for the configure tests since some are intended to dump core.
22   ulimit -c 0
23  
24 + dnl Invite Cygwin users to build within the Windows/ directory
25 + case $target_os in
26 + *cygwin* | *mingw32*)
27 +  AC_MSG_ERROR([You can only build the Windows version from its directory, Cygwin/X11 is not supported.])
28 +  ;;
29 + esac
30 +
31   dnl Options.
32   AC_ARG_ENABLE(jit,          [  --enable-jit            enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
33   AC_ARG_ENABLE(ppc-emulator, [  --enable-ppc-emulator   use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto])
# Line 21 | Line 35 | AC_ARG_ENABLE(fbdev-dga,    [  --enable-
35   AC_ARG_ENABLE(xf86-dga,     [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
36   AC_ARG_ENABLE(xf86-vidmode, [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
37   AC_ARG_ENABLE(vosf,         [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
38 + AC_ARG_ENABLE(standalone-gui,[  --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no])
39   AC_ARG_WITH(esd,            [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
40   AC_ARG_WITH(gtk,            [  --with-gtk              use GTK user interface [default=yes]],
41    [case "$withval" in
# Line 33 | Line 48 | AC_ARG_WITH(gtk,            [  --with-gt
48   AC_ARG_WITH(mon,            [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
49   AC_ARG_WITH(dgcc,           [  --with-dgcc=COMPILER    use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval])
50  
51 + AC_ARG_WITH(bincue,  
52 +  AS_HELP_STRING([--with-bincue], [Allow cdrom image files in bin/cue mode]))
53 +
54 + AC_ARG_WITH(libvhd,  
55 +  AS_HELP_STRING([--with-libvhd], [Enable VHD disk images]))
56 +
57 +
58   dnl Addressing mode
59   AC_ARG_ENABLE(addressing,
60    [  --enable-addressing=AM  set the addressing mode to use [default=real]],
# Line 48 | Line 70 | dnl SDL options.
70   AC_ARG_ENABLE(sdl-static,   [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
71   AC_ARG_ENABLE(sdl-video,    [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
72   AC_ARG_ENABLE(sdl-audio,    [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
73 + AC_ARG_ENABLE(sdl-framework,    [  --enable-sdl-framework  use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
74 + AC_ARG_ENABLE(sdl-framework-prefix,    [  --enable-sdl-framework-prefix=PFX    default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
75  
76   dnl Checks for programs.
77   AC_PROG_CC
# Line 98 | Line 122 | if [[ "x$WANT_MON" = "xyes" ]]; then
122    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
123      AC_MSG_RESULT(yes)
124      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
125 <    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"
125 >    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"
126      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
127      AC_CHECK_LIB(ncurses, tgetent, ,
128 <      AC_CHECK_LIB(termcap, tgetent, ,
129 <        AC_CHECK_LIB(termlib, tgetent, ,
130 <          AC_CHECK_LIB(terminfo, tgetent, ,
131 <            AC_CHECK_LIB(Hcurses, tgetent, ,
132 <              AC_CHECK_LIB(curses, tgetent))))))
128 >      [AC_CHECK_LIB(termcap, tgetent, ,
129 >        [AC_CHECK_LIB(termlib, tgetent, ,
130 >          [AC_CHECK_LIB(terminfo, tgetent, ,
131 >            [AC_CHECK_LIB(Hcurses, tgetent, ,
132 >              [AC_CHECK_LIB(curses, tgetent)])])])])])
133      AC_CHECK_LIB(readline, readline)
134      AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
135    else
# Line 118 | Line 142 | AC_SUBST(MONSRCS)
142  
143   dnl Checks for libraries.
144   AC_CHECK_LIB(posix4, sem_init)
145 + AC_CHECK_LIB(m, cos)
146 +
147 + dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES)
148 + dnl AC_TRY_LINK uses main() but SDL needs main to take args,
149 + dnl therefore main is undefined with #undef.
150 + dnl Framework can be in an custom location.
151 + AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [
152 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])
153 +  AC_CACHE_CHECK([whether compiler supports framework $1],
154 +    ac_Framework, [
155 +    saved_LIBS="$LIBS"
156 +    LIBS="$LIBS -framework $1"
157 +    if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then
158 +      if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then
159 +        LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1"
160 +      fi
161 +    fi
162 +    saved_CPPFLAGS="$CPPFLAGS"
163 +    CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers"
164 +    AC_TRY_LINK(
165 +      [$2
166 + #undef main], [],
167 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no);
168 + LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"]
169 +    )
170 +  ])
171 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
172 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
173 +  )
174 +  AS_VAR_POPDEF([ac_Framework])
175 + ])
176  
177   dnl Do we need SDL?
178   WANT_SDL=no
# Line 133 | Line 188 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
188    SDL_SUPPORT="$SDL_SUPPORT audio"
189   fi
190   if [[ "x$WANT_SDL" = "xyes" ]]; then
191 <  AC_PATH_PROG(sdl_config, "sdl-config")
192 <  if [[ -n "$sdl_config" ]]; then
193 <    case $target_os in
194 <    # Special treatment for Cygwin so that we can still use the POSIX layer
195 <    *cygwin*)
196 <      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
197 <      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
198 <      ;;
144 <    *)
191 >  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
192 >    AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>])
193 >  else
194 >    ac_cv_framework_SDL=no
195 >  fi
196 >  if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
197 >    AC_PATH_PROG(sdl_config, "sdl-config")
198 >    if [[ -n "$sdl_config" ]]; then
199        sdl_cflags=`$sdl_config --cflags`
200        if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
201          sdl_libs=`$sdl_config --static-libs`
202        else
203          sdl_libs=`$sdl_config --libs`
204        fi
205 <      ;;
206 <    esac
207 <    CFLAGS="$CFLAGS $sdl_cflags"
208 <    CXXFLAGS="$CXXFLAGS $sdl_cflags"
209 <    LIBS="$LIBS $sdl_libs"
210 <  else
211 <    WANT_SDL=no
212 <    WANT_SDL_VIDEO=no
159 <    WANT_SDL_AUDIO=no
205 >      CFLAGS="$CFLAGS $sdl_cflags"
206 >      CXXFLAGS="$CXXFLAGS $sdl_cflags"
207 >      LIBS="$LIBS $sdl_libs"
208 >    else
209 >      WANT_SDL=no
210 >      WANT_SDL_VIDEO=no
211 >      WANT_SDL_AUDIO=no
212 >    fi
213    fi
214    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
215   else
# Line 174 | Line 227 | if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; t
227    LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
228   fi
229  
230 +
231 +
232   dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
233   HAVE_PTHREADS=yes
234   case $EMULATED_PPC:$target_os in
# Line 185 | Line 240 | no:linux*|no:netbsd*)
240    AC_CHECK_LIB(pthread, pthread_create, , [
241      AC_CHECK_LIB(c_r, pthread_create, , [
242        AC_CHECK_LIB(PTL, pthread_create, , [
243 <        AC_MSG_ERROR([You need pthreads to run Basilisk II.])
243 >        dnl XXX remove when no pthreads case is merged
244 >        AC_MSG_ERROR([You need pthreads to run SheepShaver.])
245 >        HAVE_PTHREADS=no
246        ])
247      ])
248    ])
249    AC_CHECK_FUNCS(pthread_cancel)
250 +  AC_CHECK_FUNCS(pthread_cond_init pthread_testcancel)
251    AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
252    AC_CHECK_FUNCS(pthread_mutexattr_settype)
253    AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
196  if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
197    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
198  fi
254    dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
255    SEMSRC=
256    AC_CHECK_FUNCS(sem_init, , [
# Line 205 | Line 260 | no:linux*|no:netbsd*)
260    ])
261    ;;
262   esac
263 + if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
264 +  AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
265 + fi
266  
267   dnl We use FBDev DGA if possible.
268   if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then
# Line 242 | Line 300 | dnl We use GTK+ if possible.
300   UISRCS=../dummy/prefs_editor_dummy.cpp
301   case "x$WANT_GTK" in
302   xgtk2*)
303 +  WANT_GTK=no
304    AM_PATH_GTK_2_0(1.3.15, [
305 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
306 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
248 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
249 <    LIBS="$LIBS $GTK_LIBS"
250 <    UISRCS=prefs_editor_gtk.cpp
305 >    GUI_CFLAGS="$GTK_CFLAGS"
306 >    GUI_LIBS="$GTK_LIBS"
307      WANT_GTK=gtk2
308    ], [
309      case "x${WANT_GTK}x" in
# Line 258 | Line 314 | xgtk2*)
314      *)
315        AC_MSG_WARN([Could not find GTK+, disabling user interface.])
316        WANT_GTK=no
317 <      ;;
317 >     ;;
318      esac
319    ])
320    ;;
321   esac
322   if [[ "x$WANT_GTK" = "xgtk" ]]; then
323 +  WANT_GTK=no
324    AM_PATH_GTK(1.2.0, [
325 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
326 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
327 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
271 <    LIBS="$LIBS $GTK_LIBS"
272 <    UISRCS=prefs_editor_gtk.cpp
325 >    GUI_CFLAGS="$GTK_CFLAGS"
326 >    GUI_LIBS="$GTK_LIBS"
327 >    WANT_GTK=gtk
328    ], [
329      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
275    WANT_GTK=no
330    ])
331   fi
332 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
333 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
334 +  UISRCS=prefs_editor_gtk.cpp
335 + fi
336 + AC_SUBST(GUI_CFLAGS)
337 + AC_SUBST(GUI_LIBS)
338 +
339 + dnl Build external GUI if requested.
340 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
341 +  WANT_STANDALONE_GUI=no
342 + fi
343 + if [[ "$WANT_GTK" = "no" ]]; then
344 +  WANT_STANDALONE_GUI=no
345 + fi
346 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
347  
348   dnl We use ESD if possible.
349   if [[ "x$WANT_ESD" = "xyes" ]]; then
350 +  WANT_ESD=no
351    AM_PATH_ESD(0.2.8, [
352      AC_DEFINE(ENABLE_ESD, 1, [Define is using ESD.])
353      CFLAGS="$CFLAGS $ESD_CFLAGS"
354      CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
355      LIBS="$LIBS $ESD_LIBS"
356 +    WANT_ESD=yes
357    ], [
358      AC_MSG_WARN([Could not find ESD, disabling ESD support.])
288    WANT_ESD=no
359    ])
360   fi
361  
# Line 295 | Line 365 | AC_SYS_LARGEFILE
365   dnl Checks for header files.
366   AC_HEADER_STDC
367   AC_HEADER_SYS_WAIT
368 < AC_CHECK_HEADERS(malloc.h)
368 > AC_CHECK_HEADERS(malloc.h stdint.h)
369   AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h)
300 AC_CHECK_HEADERS(sys/time.h sys/times.h sys/socket.h)
370   AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h dirent.h)
371 < AC_CHECK_HEADERS(linux/if.h, [], [], [
372 < #if HAVE_SYS_SOCKET_H
373 < # include <sys/socket.h>
371 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
372 > AC_CHECK_HEADERS(sys/time.h sys/poll.h sys/select.h arpa/inet.h)
373 > AC_CHECK_HEADERS(netinet/in.h linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
374 > #ifdef HAVE_SYS_TYPES_H
375 > #include <sys/types.h>
376 > #endif
377 > #ifdef HAVE_SYS_SOCKET_H
378 > #include <sys/socket.h>
379   #endif
380   ])
381 < AC_CHECK_HEADERS(linux/if_tun.h net/if.h net/if_tun.h)
381 > AC_CHECK_HEADERS(AvailabilityMacros.h)
382 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
383   AC_CHECK_HEADERS(fenv.h)
384 + AC_CHECK_HEADERS(sys/stropts.h stropts.h)
385  
386   dnl Checks for typedefs, structures, and compiler characteristics.
387   AC_C_BIGENDIAN
# Line 325 | Line 401 | AC_TYPE_SIGNAL
401   AC_HEADER_TIME
402   AC_STRUCT_TM
403  
404 + dnl Check whether sys/socket.h defines type socklen_t.
405 + dnl (extracted from ac-archive/Miscellaneous)
406 + AC_CACHE_CHECK([for socklen_t],
407 +  ac_cv_type_socklen_t, [
408 +  AC_TRY_COMPILE([
409 +    #include <sys/types.h>
410 +    #include <sys/socket.h>
411 +  ], [socklen_t len = 42; return 0;],
412 +  ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no,
413 +  dnl When cross-compiling, do not assume anything.
414 +  ac_cv_type_socklen_t="guessing no"
415 +  )
416 + ])
417 + if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then
418 +  AC_DEFINE(socklen_t, int, [Define to 'int' if <sys/types.h> doesn't define.])
419 + fi
420 +
421   dnl Check whether struct sigaction has sa_restorer member.
422   AC_CACHE_CHECK([whether struct sigaction has sa_restorer],
423    ac_cv_signal_sa_restorer, [
# Line 341 | Line 434 | if [[ "x$ac_cv_signal_sa_restorer" = "xy
434   fi
435  
436   dnl Checks for library functions.
437 < AC_CHECK_FUNCS(strdup strlcpy cfmakeraw)
437 > AC_CHECK_FUNCS(strdup strerror strlcpy cfmakeraw)
438   AC_CHECK_FUNCS(nanosleep)
439   AC_CHECK_FUNCS(sigaction signal)
440   AC_CHECK_FUNCS(mmap mprotect munmap)
441   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
442   AC_CHECK_FUNCS(exp2f log2f exp2 log2)
443   AC_CHECK_FUNCS(floorf roundf ceilf truncf floor round ceil trunc)
444 + AC_CHECK_FUNCS(poll inet_aton)
445  
446   dnl Darwin seems to define mach_task_self() instead of task_self().
447   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 387 | Line 481 | mips-sony-bsd|mips-sony-newsos4)
481   *-*-cygwin*)
482          no_dev_ptmx=1
483          ;;
484 + *-*-darwin*)
485 +        no_dev_ptmx=1
486 +        ;;
487   esac
488  
489   if test -z "$no_dev_ptmx" ; then
# Line 407 | Line 504 | AC_CHECK_FILE([/dev/ptc],
504   )
505   dnl (end of code from openssh-3.2.2p1 configure.ac)
506  
507 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
508 + dnl doesn't work or is unimplemented. On these systems (mostly older
509 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
510 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
511 +  ac_cv_nonblocking_io, [
512 +  case "$host" in
513 +  *-*-osf*)
514 +    ac_cv_nonblocking_io=FIONBIO
515 +    ;;
516 +  *-*-sunos4*)
517 +    ac_cv_nonblocking_io=FIONBIO
518 +    ;;
519 +  *-*-ultrix*)
520 +    ac_cv_nonblocking_io=FIONBIO
521 +    ;;
522 +  *)
523 +    ac_cv_nonblocking_io=O_NONBLOCK
524 +    ;;
525 +  esac
526 + ])
527 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
528 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
529 + fi
530 +
531 + dnl Check whether compiler supports byte bit-fields
532 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
533 +  ac_cv_have_byte_bitfields, [
534 +  AC_LANG_SAVE
535 +  AC_LANG_CPLUSPLUS
536 +  AC_TRY_RUN([
537 +    struct A {
538 +      unsigned char b1:4;
539 +      unsigned char b2:4;
540 +      unsigned char c;
541 +      unsigned short s;
542 +      unsigned char a[4];
543 +    };
544 +
545 +    int main(void) {
546 +      A a;
547 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
548 +    }],
549 +    [ac_cv_have_byte_bitfields=yes],
550 +    [ac_cv_have_byte_bitfields=no],
551 +    dnl When cross-compiling, assume only GCC supports this
552 +    [if [[ "$GCC" = "yes" ]]; then
553 +      ac_cv_have_byte_bitfields="guessing yes"
554 +    else
555 +      ac_cv_have_byte_bitfields="guessing no"
556 +    fi]
557 +    )
558 +  AC_LANG_RESTORE
559 + ])
560 +
561   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
562 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
562 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
563    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
564    AC_CACHE_CHECK([whether compiler supports framework $1],
565      ac_Framework, [
566      saved_LIBS="$LIBS"
567      LIBS="$LIBS -framework $1"
568      AC_TRY_LINK(
569 <      [$2], [int main(void) { return 0; }],
569 >      [$2], [],
570        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
571      )
572    ])
# Line 428 | Line 579 | AC_DEFUN(AC_CHECK_FRAMEWORK, [
579   dnl Check for some MacOS X frameworks
580   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
581   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
582 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
583 + AC_CHECK_FRAMEWORK(CoreAudio, [#include <CoreAudio/CoreAudio.h>])
584 + AC_CHECK_FRAMEWORK(AudioUnit, [#include <AudioUnit/AudioUnit.h>])
585 + AC_CHECK_FRAMEWORK(AudioToolbox, [#include <AudioToolbox/AudioToolbox.h>])
586 + AC_CHECK_FRAMEWORK(AppKit, [])
587  
588   dnl Select system-dependant sources.
589   SERIALSRC=serial_unix.cpp
590   ETHERSRC=../dummy/ether_dummy.cpp
591   SCSISRC=../dummy/scsi_dummy.cpp
592   AUDIOSRC=../dummy/audio_dummy.cpp
593 + PREFSSRC=../dummy/prefs_dummy.cpp
594   EXTFSSRC=extfs_unix.cpp
595   EXTRASYSSRCS=
596   case "$target_os" in
597   linux*)
598 <  ETHERSRC=Linux/ether_linux.cpp
598 >  ETHERSRC=ether_unix.cpp
599    AUDIOSRC=audio_oss_esd.cpp
600    SCSISRC=Linux/scsi_linux.cpp
601    if [[ "x$EMULATED_PPC" = "xno" ]]; then
602 <    EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
602 >    EXTRASYSSRCS="paranoia.cpp Linux/sheepthreads.c ppc_asm.S"
603    fi
604    ;;
605 + freebsd*)
606 +  ETHERSRC=ether_unix.cpp
607 +  ;;
608   netbsd*)
609 +  ETHERSRC=ether_unix.cpp
610    if [[ "x$EMULATED_PPC" = "xno" ]]; then
611 <    EXTRASYSSRCS="NetBSD/paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
611 >    EXTRASYSSRCS="paranoia.cpp NetBSD/sheepthreads.c ppc_asm.S"
612    fi
613    ;;
614   darwin*)
615 +  ETHERSRC=ether_unix.cpp
616    if [[ "x$EMULATED_PPC" = "xno" ]]; then
617 <    EXTRASYSSRCS="Darwin/paranoia.cpp ppc_asm.S"
617 >    EXTRASYSSRCS="paranoia.cpp ppc_asm.S"
618    fi
619 <  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
619 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
620      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
621    fi
622    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
623 <    EXTFSSRC=../MacOSX/extfs_macosx.mm
623 >    EXTFSSRC=../MacOSX/extfs_macosx.cpp
624 >    if [[ "x$ac_cv_framework_AppKit" = "xyes" -a "x$WANT_GTK" = "xno" ]]; then
625 >      PREFSSRC="../MacOSX/prefs_macosx.mm ../MacOSX/Launcher/VMSettingsController.mm"
626 >      CPPFLAGS="$CPPFLAGS -I../MacOSX/Launcher"
627 >    fi
628    fi
629 +  if [[ "x$WANT_ESD" = "xno" -a "x$ac_cv_framework_CoreAudio" = "xyes" -a "x$WANT_SDL_AUDIO" = "xno" ]]; then
630 +    AUDIOSRC="../MacOSX/audio_macosx.cpp ../MacOSX/AudioBackEnd.cpp ../MacOSX/AudioDevice.cpp ../MacOSX/MacOSX_sound_if.cpp"
631 +    OSX_CORE_AUDIO="-DOSX_CORE_AUDIO"
632 +  fi
633 +  ;;
634 + irix*)
635 +  AUDIOSRC=Irix/audio_irix.cpp
636 +  LIBS="$LIBS -laudio"
637 +  WANT_ESD=no
638 +
639 +  dnl Check if our compiler supports -IPA (MIPSPro)
640 +  HAVE_IPA=no
641 +  ocflags="$CFLAGS"
642 +  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
643 +  AC_MSG_CHECKING(if "-IPA" works)
644 +  dnl Do a test compile of an empty function
645 +  AC_TRY_COMPILE([#if defined __GNUC__
646 +                  # error GCC does not support IPA yet
647 +                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
648 +  CFLAGS="$ocflags"
649    ;;
650 < cygwin*)
651 <  SERIALSRC="../dummy/serial_dummy.cpp"
650 > esac
651 >
652 > dnl BINCUE
653 > AS_IF([test  "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
654 > AS_IF([test  "x$have_bincue" = "xyes" ], [
655 >   if [[ "xOSX_CORE_AUDIO" = "xno"  -a "x$WANT_SDL_AUDIO"="xno"]]; then
656 >       AC_MSG_ERROR([You need SDL or OSX Core Audio to use BINCUE support.])
657 >   else
658 >       CPPFLAGS="$CPPFLAGS -DBINCUE $OSX_CORE_AUDIO"
659 >   fi
660 > ])
661 >
662 > dnl LIBVHD
663 > AS_IF([test  "x$with_libvhd" = "xyes" ], [have_libvhd=yes], [have_libvhd=no])
664 > AS_IF([test  "x$have_libvhd" = "xyes" ], [
665 >       CPPFLAGS="$CPPFLAGS -DHAVE_LIBVHD"
666 >           LIBS="$LIBS -lvhd"
667 >           case $target_os in
668 >           linux*)
669 >           LIBS="$LIBS -luuid"
670 >           esac
671 >           AC_CHECK_LIB(vhd, vhd_open)
672 >           AC_CHECK_LIB(vhd, vhd_io_read)
673 >           AC_CHECK_LIB(vhd, vhd_io_write)
674 >           AC_CHECK_LIB(vhd, vhd_close)
675 > ])
676 >
677 >
678 >
679 >
680 > dnl Is the slirp library supported?
681 > case "$ac_cv_have_byte_bitfields" in
682 > yes|"guessing yes")
683 >  CAN_SLIRP=yes
684 >  ETHERSRC=ether_unix.cpp
685    ;;
686   esac
687 + if [[ -n "$CAN_SLIRP" ]]; then
688 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
689 +  SLIRP_SRCS="\
690 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
691 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
692 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
693 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
694 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
695 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
696 + fi
697 + AC_SUBST(SLIRP_SRCS)
698  
699   dnl SDL overrides
700   if [[ "x$WANT_SDL" = "xyes" ]]; then
701    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
702 +  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
703 +    EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m"
704 +  fi
705   fi
706   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
707    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
# Line 476 | Line 709 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
709    KEYCODES="../SDL/keycodes"
710    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
711      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
712 +    EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/utils_macosx.mm"
713 +    CPPFLAGS="$CPPFLAGS -I../MacOSX"
714    else
715 <    case "$target_os" in
481 <    cygwin*)
482 <      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
483 <      ;;
484 <    *)
485 <      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
486 <      ;;
487 <    esac
715 >    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
716    fi
717   else
718    VIDEOSRCS="video_x.cpp"
# Line 496 | Line 724 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
724    AUDIOSRC="../SDL/audio_sdl.cpp"
725   fi
726  
727 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
727 > dnl BINCUE overrides
728 >
729 > if [[ "x$have_bincue" = "xyes" ]]; then
730 >  EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
731 > fi
732 >
733 > dnl libvhd overrides
734 >
735 > if [[ "x$have_libvhd" = "xyes" ]]; then
736 >  EXTRASYSSRCS="$EXTRASYSSRCS vhd_unix.cpp"
737 > fi
738 >
739 >
740 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $PREFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
741  
742   dnl Define a macro that translates a yesno-variable into a C macro definition
743   dnl to be put into the config.h file
744   dnl $1 -- the macro to define
745   dnl $2 -- the value to translate
746   dnl $3 -- template name
747 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
747 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
748      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
749          AC_DEFINE($1, 1, $3)
750      fi
# Line 513 | Line 754 | dnl Check that the host supports TUN/TAP
754   AC_CACHE_CHECK([whether TUN/TAP is supported],
755    ac_cv_tun_tap_support, [
756    AC_TRY_COMPILE([
757 +        #if defined(HAVE_NETINET_IN_H)
758 +        #include <netinet/in.h>
759 +        #endif
760      #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
761      #include <linux/if.h>
762      #include <linux/if_tun.h>
# Line 912 | Line 1156 | fi
1156  
1157   dnl Check addressing mode to use
1158   AC_MSG_CHECKING([for addressing mode to use])
915 case "$os_target" in
916 cygwin*)
917  WANT_ADDRESSING_MODE="direct,cygwin-hack"
918  NATMEM_OFFSET=
919  ;;
920 esac
1159   if [[ "$EMULATED_PPC" != "yes" ]]; then
1160    if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then
1161      AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.])
# Line 1149 | Line 1387 | fi
1387   dnl Check for GCC 2.7 or higher.
1388   HAVE_GCC27=no
1389   AC_MSG_CHECKING(for GCC 2.7 or higher)
1390 < AC_EGREP_CPP(xyes,
1391 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1392 <  xyes
1393 < #endif
1394 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1390 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1391 >                                     # error gcc < 2.7
1392 >                                     typedef syntax error;
1393 >                                     #endif
1394 >                                   ]])],
1395 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1396 >                  [AC_MSG_RESULT(no)])
1397  
1398   dnl Check for GCC 3.0 or higher.
1399   HAVE_GCC30=no
1400   AC_MSG_CHECKING(for GCC 3.0 or higher)
1401 < AC_EGREP_CPP(xyes,
1402 < [#if __GNUC__ >= 3
1403 <  xyes
1404 < #endif
1405 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1401 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1402 >                                     # error gcc < 3
1403 >                                     typedef syntax error;
1404 >                                     #endif
1405 >                                   ]])],
1406 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1407 >                  [AC_MSG_RESULT(no)])
1408  
1409   dnl Check for ICC.
1410   AC_MSG_CHECKING(for ICC)
# Line 1193 | Line 1435 | AC_CACHE_CHECK([the format of compiler g
1435    rm -rf conftest*
1436   ])
1437  
1438 + dnl Add -fno-strict-aliasing for slirp sources
1439 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1440 +  SAVED_CFLAGS="$CFLAGS"
1441 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1442 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1443 +    ac_cv_gcc_no_strict_aliasing, [
1444 +    AC_TRY_COMPILE([],[],
1445 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1446 +      [ac_cv_gcc_no_strict_aliasing=no])
1447 +  ])
1448 +  CFLAGS="$SAVED_CFLAGS"
1449 + fi
1450 +
1451 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1452 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1453 +  SAVED_CFLAGS="$CFLAGS"
1454 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1455 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1456 +    ac_cv_gcc_mdynamic_no_pic, [
1457 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1458 +  ])
1459 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1460 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1461 +  else
1462 +    CFLAGS="$SAVED_CFLAGS"
1463 +  fi
1464 + fi
1465 +
1466   dnl CPU emulator sources
1467   if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1468    CPUSRCS="\
# Line 1201 | Line 1471 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1471      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1472      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1473      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1474 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1474 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1475 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1476    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1477  
1478    dnl Enable JIT compiler, if possible
# Line 1218 | Line 1489 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1489        i?86:elf)
1490          ac_cv_use_dyngen=yes
1491          ;;
1492 +      mips:elf)
1493 +        ac_cv_use_dyngen=yes
1494 +        ;;
1495        powerpc:mach)
1496          ac_cv_use_dyngen=yes
1497          ;;
1498 +      x86_64:mach)
1499 +        ac_cv_use_dyngen=yes
1500 +        ;;
1501 +      i?86:mach)
1502 +        ac_cv_use_dyngen=yes
1503 +        ;;
1504        *:*)
1505          ac_cv_use_dyngen=no
1506          ;;
# Line 1230 | Line 1510 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1510          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1511            DYNGEN_CC=$CXX
1512          else
1513 <          for p in /usr/bin /usr/local/bin; do
1513 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1514              gxx="$p/g++"
1515              if [[ -x "$gxx" ]]; then
1516                DYNGEN_CC="$gxx"
# Line 1245 | Line 1525 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1525      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1526        case $host_cpu in
1527        i?86)
1528 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1528 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1529 >        ;;
1530 >      mips)
1531 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1532          ;;
1533        powerpc)
1534          if [[ "x$ac_cv_object_format" = "xmach" ]]; then
# Line 1253 | Line 1536 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1536          fi
1537          ;;
1538        esac
1539 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1540 <        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1539 >      have_dyngen_gcc3=no
1540 >      case "x`$DYNGEN_CC -dumpversion`" in
1541 >      x[12].*) ;;
1542 >      x*) have_dyngen_gcc3=yes ;;
1543 >      esac
1544 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1545 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1546        else
1547          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1548        fi
1549 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1550 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1549 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1550 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1551          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1552        fi
1553 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1554 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1555 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1556 +      else
1557 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1558 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1559 +      fi
1560      else
1561        WANT_JIT=no
1562      fi
# Line 1273 | Line 1568 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1568        CPUSRCS="\
1569          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1570          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1571 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1571 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1572 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1573      fi
1574    fi
1575 <  CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1575 >  CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp ../kpx_cpu/ppc-dis.c"
1576   else
1577    WANT_JIT=no
1578   fi
1283 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1284  AC_CACHE_CHECK([whether static data regions are executable],
1285    ac_cv_have_static_data_exec, [
1286    AC_TRY_RUN([int main(void) {
1287 #if defined(__powerpc__) || defined(__ppc__)
1288      static unsigned int p[8] = {0x4e800020,};
1289      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1290      asm volatile("sync" : : : "memory");
1291      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1292      asm volatile("sync" : : : "memory");
1293      asm volatile("isync" : : : "memory");
1294      ((void (*)(void))p)();
1295      return 0;
1296 #endif
1297      return 1;
1298    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1299    dnl When cross-compiling, do not assume anything.
1300    ac_cv_have_static_data_exec=no
1301    )
1302  ])
1303 else
1304  ac_cv_use_dyngen=no
1305 fi
1306 AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1307  [Define if your system marks static data pages as executable.])
1308
1579   if [[ "x$WANT_JIT" = "xyes" ]]; then
1580    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1581   fi
1582  
1583 + dnl Higher level optimizations with MIPSPro compilers are possible
1584 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1585 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1586 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1587 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1588 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1589 + fi
1590 +
1591 + dnl Check for linker script support
1592 + case $target_os:$target_cpu in
1593 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1594 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1595 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1596 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1597 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1598 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1599 + esac
1600 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1601 +  AC_CACHE_CHECK([whether linker script is usable],
1602 +    ac_cv_linker_script_works, [
1603 +    AC_LANG_SAVE
1604 +    AC_LANG_CPLUSPLUS
1605 +    saved_LDFLAGS="$LDFLAGS"
1606 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1607 +    AC_TRY_RUN(
1608 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1609 +      [ac_cv_linker_script_works=yes],
1610 +      [ac_cv_linker_script_works=no],
1611 +      dnl When cross-compiling, assume it works
1612 +      [ac_cv_linker_script_works="guessing yes"]
1613 +    )
1614 +    AC_LANG_RESTORE
1615 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1616 +      LDFLAGS="$saved_LDFLAGS"
1617 +      LINKER_SCRIPT_FLAGS=""
1618 +    fi
1619 +  ])
1620 + fi
1621 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1622 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1623 +
1624   dnl Generate Makefile.
1625   AC_SUBST(PERL)
1626   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1627   AC_SUBST(DYNGENSRCS)
1628   AC_SUBST(DYNGEN_CC)
1629 + AC_SUBST(DYNGEN_CFLAGS)
1630 + AC_SUBST(DYNGEN_CXXFLAGS)
1631   AC_SUBST(DYNGEN_OP_FLAGS)
1632   AC_SUBST(SYSSRCS)
1633   AC_SUBST(CPUSRCS)
# Line 1330 | Line 1643 | echo
1643   echo SheepShaver configuration summary:
1644   echo
1645   echo SDL support ...................... : $SDL_SUPPORT
1646 + echo BINCUE support ................... : $have_bincue
1647 + echo LIBVHD support ................... : $have_libvhd
1648   echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1649   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1650   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines