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.38 by gbeauche, 2005-07-25T19:46:24Z vs.
Revision 1.72 by asvitkine, 2012-06-15T22:58:29Z

# 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 28 | 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 40 | 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 55 | 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 105 | 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 125 | 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 140 | 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 <    sdl_cflags=`$sdl_config --cflags`
194 <    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
195 <      sdl_libs=`$sdl_config --static-libs`
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 >      CFLAGS="$CFLAGS $sdl_cflags"
206 >      CXXFLAGS="$CXXFLAGS $sdl_cflags"
207 >      LIBS="$LIBS $sdl_libs"
208      else
209 <      sdl_libs=`$sdl_config --libs`
209 >      WANT_SDL=no
210 >      WANT_SDL_VIDEO=no
211 >      WANT_SDL_AUDIO=no
212      fi
151    CFLAGS="$CFLAGS $sdl_cflags"
152    CXXFLAGS="$CXXFLAGS $sdl_cflags"
153    LIBS="$LIBS $sdl_libs"
154  else
155    WANT_SDL=no
156    WANT_SDL_VIDEO=no
157    WANT_SDL_AUDIO=no
213    fi
214    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
215   else
# Line 172 | 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 243 | 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"
249 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
250 <    LIBS="$LIBS $GTK_LIBS"
251 <    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 259 | 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"
272 <    LIBS="$LIBS $GTK_LIBS"
273 <    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.])
276    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.])
289    WANT_ESD=no
359    ])
360   fi
361  
# Line 411 | Line 480 | mips-sony-bsd|mips-sony-newsos4)
480   *-*-cygwin*)
481          no_dev_ptmx=1
482          ;;
483 + *-*-darwin*)
484 +        no_dev_ptmx=1
485 +        ;;
486   esac
487  
488   if test -z "$no_dev_ptmx" ; then
# Line 431 | Line 503 | AC_CHECK_FILE([/dev/ptc],
503   )
504   dnl (end of code from openssh-3.2.2p1 configure.ac)
505  
506 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
507 + dnl doesn't work or is unimplemented. On these systems (mostly older
508 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
509 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
510 +  ac_cv_nonblocking_io, [
511 +  case "$host" in
512 +  *-*-osf*)
513 +    ac_cv_nonblocking_io=FIONBIO
514 +    ;;
515 +  *-*-sunos4*)
516 +    ac_cv_nonblocking_io=FIONBIO
517 +    ;;
518 +  *-*-ultrix*)
519 +    ac_cv_nonblocking_io=FIONBIO
520 +    ;;
521 +  *)
522 +    ac_cv_nonblocking_io=O_NONBLOCK
523 +    ;;
524 +  esac
525 + ])
526 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
527 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
528 + fi
529 +
530 + dnl Check whether compiler supports byte bit-fields
531 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
532 +  ac_cv_have_byte_bitfields, [
533 +  AC_LANG_SAVE
534 +  AC_LANG_CPLUSPLUS
535 +  AC_TRY_RUN([
536 +    struct A {
537 +      unsigned char b1:4;
538 +      unsigned char b2:4;
539 +      unsigned char c;
540 +      unsigned short s;
541 +      unsigned char a[4];
542 +    };
543 +
544 +    int main(void) {
545 +      A a;
546 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
547 +    }],
548 +    [ac_cv_have_byte_bitfields=yes],
549 +    [ac_cv_have_byte_bitfields=no],
550 +    dnl When cross-compiling, assume only GCC supports this
551 +    [if [[ "$GCC" = "yes" ]]; then
552 +      ac_cv_have_byte_bitfields="guessing yes"
553 +    else
554 +      ac_cv_have_byte_bitfields="guessing no"
555 +    fi]
556 +    )
557 +  AC_LANG_RESTORE
558 + ])
559 +
560   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
561 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
561 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
562    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
563    AC_CACHE_CHECK([whether compiler supports framework $1],
564      ac_Framework, [
565      saved_LIBS="$LIBS"
566      LIBS="$LIBS -framework $1"
567      AC_TRY_LINK(
568 <      [$2], [int main(void) { return 0; }],
568 >      [$2], [],
569        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
570      )
571    ])
# Line 453 | Line 579 | dnl Check for some MacOS X frameworks
579   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
580   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
581   AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
582 + AC_CHECK_FRAMEWORK(CoreAudio, [#include <CoreAudio/CoreAudio.h>])
583 + AC_CHECK_FRAMEWORK(AudioUnit, [#include <AudioUnit/AudioUnit.h>])
584 + AC_CHECK_FRAMEWORK(AudioToolbox, [#include <AudioToolbox/AudioToolbox.h>])
585 + AC_CHECK_FRAMEWORK(AppKit, [])
586  
587   dnl Select system-dependant sources.
588   SERIALSRC=serial_unix.cpp
589   ETHERSRC=../dummy/ether_dummy.cpp
590   SCSISRC=../dummy/scsi_dummy.cpp
591   AUDIOSRC=../dummy/audio_dummy.cpp
592 + PREFSSRC=../dummy/prefs_dummy.cpp
593   EXTFSSRC=extfs_unix.cpp
594   EXTRASYSSRCS=
595   case "$target_os" in
# Line 488 | Line 619 | darwin*)
619      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
620    fi
621    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
622 <    EXTFSSRC=../MacOSX/extfs_macosx.mm
622 >    EXTFSSRC=../MacOSX/extfs_macosx.cpp
623 >    if [[ "x$ac_cv_framework_AppKit" = "xyes" -a "x$WANT_GTK" = "xno" ]]; then
624 >      PREFSSRC="../MacOSX/prefs_macosx.mm ../MacOSX/Launcher/VMSettingsController.mm"
625 >      CPPFLAGS="$CPPFLAGS -I../MacOSX/Launcher"
626 >    fi
627 >  fi
628 >  if [[ "x$WANT_ESD" = "xno" -a "x$ac_cv_framework_CoreAudio" = "xyes" -a "x$WANT_SDL_AUDIO" = "xno" ]]; then
629 >    AUDIOSRC="../MacOSX/audio_macosx.cpp ../MacOSX/AudioBackEnd.cpp ../MacOSX/AudioDevice.cpp ../MacOSX/MacOSX_sound_if.cpp"
630 >    OSX_CORE_AUDIO="-DOSX_CORE_AUDIO"
631    fi
632    ;;
633 + irix*)
634 +  AUDIOSRC=Irix/audio_irix.cpp
635 +  LIBS="$LIBS -laudio"
636 +  WANT_ESD=no
637 +
638 +  dnl Check if our compiler supports -IPA (MIPSPro)
639 +  HAVE_IPA=no
640 +  ocflags="$CFLAGS"
641 +  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
642 +  AC_MSG_CHECKING(if "-IPA" works)
643 +  dnl Do a test compile of an empty function
644 +  AC_TRY_COMPILE([#if defined __GNUC__
645 +                  # error GCC does not support IPA yet
646 +                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
647 +  CFLAGS="$ocflags"
648 +  ;;
649   esac
650  
651 + dnl BINCUE
652 + AS_IF([test  "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
653 + AS_IF([test  "x$have_bincue" = "xyes" ], [
654 +   if [[ "xOSX_CORE_AUDIO" = "xno"  -a "x$WANT_SDL_AUDIO"="xno"]]; then
655 +       AC_MSG_ERROR([You need SDL or OSX Core Audio to use BINCUE support.])
656 +   else
657 +       CPPFLAGS="$CPPFLAGS -DBINCUE $OSX_CORE_AUDIO"
658 +   fi
659 + ])
660 +
661 + dnl LIBVHD
662 + AS_IF([test  "x$with_libvhd" = "xyes" ], [have_libvhd=yes], [have_libvhd=no])
663 + AS_IF([test  "x$have_libvhd" = "xyes" ], [
664 +       CPPFLAGS="$CPPFLAGS -DHAVE_LIBVHD"
665 +           LIBS="$LIBS -lvhd"
666 +           case $target_os in
667 +           linux*)
668 +           LIBS="$LIBS -luuid"
669 +           esac
670 +           AC_CHECK_LIB(vhd, vhd_open)
671 +           AC_CHECK_LIB(vhd, vhd_io_read)
672 +           AC_CHECK_LIB(vhd, vhd_io_write)
673 +           AC_CHECK_LIB(vhd, vhd_close)
674 + ])
675 +
676 +
677 +
678 +
679   dnl Is the slirp library supported?
680 < if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
680 > case "$ac_cv_have_byte_bitfields" in
681 > yes|"guessing yes")
682 >  CAN_SLIRP=yes
683 >  ETHERSRC=ether_unix.cpp
684 >  ;;
685 > esac
686 > if [[ -n "$CAN_SLIRP" ]]; then
687    AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
688    SLIRP_SRCS="\
689      ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
# Line 509 | Line 698 | AC_SUBST(SLIRP_SRCS)
698   dnl SDL overrides
699   if [[ "x$WANT_SDL" = "xyes" ]]; then
700    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
701 +  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
702 +    EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m"
703 +  fi
704   fi
705   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
706    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
# Line 516 | Line 708 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
708    KEYCODES="../SDL/keycodes"
709    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
710      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
711 +    EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/utils_macosx.mm"
712 +    CPPFLAGS="$CPPFLAGS -I../MacOSX"
713    else
714      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
715    fi
# Line 529 | Line 723 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
723    AUDIOSRC="../SDL/audio_sdl.cpp"
724   fi
725  
726 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
726 > dnl BINCUE overrides
727 >
728 > if [[ "x$have_bincue" = "xyes" ]]; then
729 >  EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
730 > fi
731 >
732 > dnl libvhd overrides
733 >
734 > if [[ "x$have_libvhd" = "xyes" ]]; then
735 >  EXTRASYSSRCS="$EXTRASYSSRCS vhd_unix.cpp"
736 > fi
737 >
738 >
739 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $PREFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
740  
741   dnl Define a macro that translates a yesno-variable into a C macro definition
742   dnl to be put into the config.h file
743   dnl $1 -- the macro to define
744   dnl $2 -- the value to translate
745   dnl $3 -- template name
746 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
746 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
747      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
748          AC_DEFINE($1, 1, $3)
749      fi
# Line 1178 | Line 1385 | HAVE_GCC27=no
1385   AC_MSG_CHECKING(for GCC 2.7 or higher)
1386   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1387                                       # error gcc < 2.7
1388 +                                     typedef syntax error;
1389                                       #endif
1390                                     ]])],
1391                    [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
# Line 1188 | Line 1396 | HAVE_GCC30=no
1396   AC_MSG_CHECKING(for GCC 3.0 or higher)
1397   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1398                                       # error gcc < 3
1399 +                                     typedef syntax error;
1400                                       #endif
1401                                     ]])],
1402                    [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
# Line 1235 | Line 1444 | if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1444    CFLAGS="$SAVED_CFLAGS"
1445   fi
1446  
1447 < dnl Add -mdynamic-no-pic for MacOS X
1448 < if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1447 > dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1448 > if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1449    SAVED_CFLAGS="$CFLAGS"
1450    CFLAGS="$CFLAGS -mdynamic-no-pic"
1451    AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
# Line 1258 | Line 1467 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1467      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1468      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1469      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1470 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1470 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1471 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1472    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1473  
1474    dnl Enable JIT compiler, if possible
# Line 1275 | Line 1485 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1485        i?86:elf)
1486          ac_cv_use_dyngen=yes
1487          ;;
1488 +      mips:elf)
1489 +        ac_cv_use_dyngen=yes
1490 +        ;;
1491        powerpc:mach)
1492          ac_cv_use_dyngen=yes
1493          ;;
1494 +      x86_64:mach)
1495 +        ac_cv_use_dyngen=yes
1496 +        ;;
1497 +      i?86:mach)
1498 +        ac_cv_use_dyngen=yes
1499 +        ;;
1500        *:*)
1501          ac_cv_use_dyngen=no
1502          ;;
# Line 1287 | Line 1506 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1506          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1507            DYNGEN_CC=$CXX
1508          else
1509 <          for p in /usr/bin /usr/local/bin; do
1509 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1510              gxx="$p/g++"
1511              if [[ -x "$gxx" ]]; then
1512                DYNGEN_CC="$gxx"
# Line 1302 | Line 1521 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1521      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1522        case $host_cpu in
1523        i?86)
1524 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1524 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1525 >        ;;
1526 >      mips)
1527 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1528          ;;
1529        powerpc)
1530          if [[ "x$ac_cv_object_format" = "xmach" ]]; then
# Line 1310 | Line 1532 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1532          fi
1533          ;;
1534        esac
1535 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1536 <        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1535 >      have_dyngen_gcc3=no
1536 >      case "x`$DYNGEN_CC -dumpversion`" in
1537 >      x[12].*) ;;
1538 >      x*) have_dyngen_gcc3=yes ;;
1539 >      esac
1540 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1541 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1542        else
1543          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1544        fi
1545        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1546 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1546 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1547          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1548        fi
1549 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1550 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1551 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1552 +      else
1553 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1554 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1555 +      fi
1556      else
1557        WANT_JIT=no
1558      fi
# Line 1330 | Line 1564 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1564        CPUSRCS="\
1565          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1566          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1567 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1567 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1568 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1569      fi
1570    fi
1571    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1572   else
1573    WANT_JIT=no
1574   fi
1340 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1341  AC_CACHE_CHECK([whether static data regions are executable],
1342    ac_cv_have_static_data_exec, [
1343    AC_TRY_RUN([int main(void) {
1344 #if defined(__powerpc__) || defined(__ppc__)
1345      static unsigned int p[8] = {0x4e800020,};
1346      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1347      asm volatile("sync" : : : "memory");
1348      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1349      asm volatile("sync" : : : "memory");
1350      asm volatile("isync" : : : "memory");
1351      ((void (*)(void))p)();
1352      return 0;
1353 #endif
1354      return 1;
1355    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1356    dnl When cross-compiling, do not assume anything.
1357    ac_cv_have_static_data_exec=no
1358    )
1359  ])
1360 else
1361  ac_cv_use_dyngen=no
1362 fi
1363 AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1364  [Define if your system marks static data pages as executable.])
1365
1575   if [[ "x$WANT_JIT" = "xyes" ]]; then
1576    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1577   fi
1578  
1579 + dnl Higher level optimizations with MIPSPro compilers are possible
1580 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1581 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1582 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1583 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1584 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1585 + fi
1586 +
1587 + dnl Check for linker script support
1588 + case $target_os:$target_cpu in
1589 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1590 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1591 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1592 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1593 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1594 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1595 + esac
1596 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1597 +  AC_CACHE_CHECK([whether linker script is usable],
1598 +    ac_cv_linker_script_works, [
1599 +    AC_LANG_SAVE
1600 +    AC_LANG_CPLUSPLUS
1601 +    saved_LDFLAGS="$LDFLAGS"
1602 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1603 +    AC_TRY_RUN(
1604 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1605 +      [ac_cv_linker_script_works=yes],
1606 +      [ac_cv_linker_script_works=no],
1607 +      dnl When cross-compiling, assume it works
1608 +      [ac_cv_linker_script_works="guessing yes"]
1609 +    )
1610 +    AC_LANG_RESTORE
1611 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1612 +      LDFLAGS="$saved_LDFLAGS"
1613 +      LINKER_SCRIPT_FLAGS=""
1614 +    fi
1615 +  ])
1616 + fi
1617 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1618 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1619 +
1620   dnl Generate Makefile.
1621   AC_SUBST(PERL)
1622   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1623   AC_SUBST(DYNGENSRCS)
1624   AC_SUBST(DYNGEN_CC)
1625 + AC_SUBST(DYNGEN_CFLAGS)
1626 + AC_SUBST(DYNGEN_CXXFLAGS)
1627   AC_SUBST(DYNGEN_OP_FLAGS)
1628   AC_SUBST(SYSSRCS)
1629   AC_SUBST(CPUSRCS)
# Line 1387 | Line 1639 | echo
1639   echo SheepShaver configuration summary:
1640   echo
1641   echo SDL support ...................... : $SDL_SUPPORT
1642 + echo BINCUE support ................... : $have_bincue
1643 + echo LIBVHD support ................... : $have_libvhd
1644   echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1645   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1646   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines