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.37 by gbeauche, 2005-07-10T15:43:33Z vs.
Revision 1.69 by asvitkine, 2010-10-19T22:20:01Z

# 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 28 | Line 28 | AC_ARG_ENABLE(fbdev-dga,    [  --enable-
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=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]],
34    [case "$withval" in
# Line 40 | Line 41 | AC_ARG_WITH(gtk,            [  --with-gt
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  
44 + AC_ARG_WITH(bincue,  
45 +  AS_HELP_STRING([--with-bincue], [Allow cdrom image files in bin/cue mode]))
46 +
47 + AC_ARG_WITH(libvhd,  
48 +  AS_HELP_STRING([--with-libvhd], [Enable VHD disk images]))
49 +
50 +
51   dnl Addressing mode
52   AC_ARG_ENABLE(addressing,
53    [  --enable-addressing=AM  set the addressing mode to use [default=real]],
# Line 55 | Line 63 | dnl SDL options.
63   AC_ARG_ENABLE(sdl-static,   [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
64   AC_ARG_ENABLE(sdl-video,    [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
65   AC_ARG_ENABLE(sdl-audio,    [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
66 + AC_ARG_ENABLE(sdl-framework,    [  --enable-sdl-framework  use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
67 + AC_ARG_ENABLE(sdl-framework-prefix,    [  --enable-sdl-framework-prefix=PFX    default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
68  
69   dnl Checks for programs.
70   AC_PROG_CC
# Line 105 | Line 115 | if [[ "x$WANT_MON" = "xyes" ]]; then
115    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
116      AC_MSG_RESULT(yes)
117      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
118 <    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"
118 >    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"
119      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
120      AC_CHECK_LIB(ncurses, tgetent, ,
121 <      AC_CHECK_LIB(termcap, tgetent, ,
122 <        AC_CHECK_LIB(termlib, tgetent, ,
123 <          AC_CHECK_LIB(terminfo, tgetent, ,
124 <            AC_CHECK_LIB(Hcurses, tgetent, ,
125 <              AC_CHECK_LIB(curses, tgetent))))))
121 >      [AC_CHECK_LIB(termcap, tgetent, ,
122 >        [AC_CHECK_LIB(termlib, tgetent, ,
123 >          [AC_CHECK_LIB(terminfo, tgetent, ,
124 >            [AC_CHECK_LIB(Hcurses, tgetent, ,
125 >              [AC_CHECK_LIB(curses, tgetent)])])])])])
126      AC_CHECK_LIB(readline, readline)
127      AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
128    else
# Line 125 | Line 135 | AC_SUBST(MONSRCS)
135  
136   dnl Checks for libraries.
137   AC_CHECK_LIB(posix4, sem_init)
138 + AC_CHECK_LIB(m, cos)
139 +
140 + dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES)
141 + dnl AC_TRY_LINK uses main() but SDL needs main to take args,
142 + dnl therefore main is undefined with #undef.
143 + dnl Framework can be in an custom location.
144 + AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [
145 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])
146 +  AC_CACHE_CHECK([whether compiler supports framework $1],
147 +    ac_Framework, [
148 +    saved_LIBS="$LIBS"
149 +    LIBS="$LIBS -framework $1"
150 +    if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then
151 +      if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then
152 +        LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1"
153 +      fi
154 +    fi
155 +    saved_CPPFLAGS="$CPPFLAGS"
156 +    CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers"
157 +    AC_TRY_LINK(
158 +      [$2
159 + #undef main], [],
160 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no);
161 + LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"]
162 +    )
163 +  ])
164 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
165 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
166 +  )
167 +  AS_VAR_POPDEF([ac_Framework])
168 + ])
169  
170   dnl Do we need SDL?
171   WANT_SDL=no
# Line 140 | Line 181 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
181    SDL_SUPPORT="$SDL_SUPPORT audio"
182   fi
183   if [[ "x$WANT_SDL" = "xyes" ]]; then
184 <  AC_PATH_PROG(sdl_config, "sdl-config")
185 <  if [[ -n "$sdl_config" ]]; then
186 <    sdl_cflags=`$sdl_config --cflags`
187 <    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
188 <      sdl_libs=`$sdl_config --static-libs`
184 >  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
185 >    AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>])
186 >  else
187 >    ac_cv_framework_SDL=no
188 >  fi
189 >  if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
190 >    AC_PATH_PROG(sdl_config, "sdl-config")
191 >    if [[ -n "$sdl_config" ]]; then
192 >      sdl_cflags=`$sdl_config --cflags`
193 >      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
194 >        sdl_libs=`$sdl_config --static-libs`
195 >      else
196 >        sdl_libs=`$sdl_config --libs`
197 >      fi
198 >      CFLAGS="$CFLAGS $sdl_cflags"
199 >      CXXFLAGS="$CXXFLAGS $sdl_cflags"
200 >      LIBS="$LIBS $sdl_libs"
201      else
202 <      sdl_libs=`$sdl_config --libs`
202 >      WANT_SDL=no
203 >      WANT_SDL_VIDEO=no
204 >      WANT_SDL_AUDIO=no
205      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
206    fi
207    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
208   else
# Line 172 | Line 220 | if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; t
220    LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
221   fi
222  
223 +
224 +
225   dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
226   HAVE_PTHREADS=yes
227   case $EMULATED_PPC:$target_os in
# Line 243 | Line 293 | dnl We use GTK+ if possible.
293   UISRCS=../dummy/prefs_editor_dummy.cpp
294   case "x$WANT_GTK" in
295   xgtk2*)
296 +  WANT_GTK=no
297    AM_PATH_GTK_2_0(1.3.15, [
298 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
299 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
249 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
250 <    LIBS="$LIBS $GTK_LIBS"
251 <    UISRCS=prefs_editor_gtk.cpp
298 >    GUI_CFLAGS="$GTK_CFLAGS"
299 >    GUI_LIBS="$GTK_LIBS"
300      WANT_GTK=gtk2
301    ], [
302      case "x${WANT_GTK}x" in
# Line 259 | Line 307 | xgtk2*)
307      *)
308        AC_MSG_WARN([Could not find GTK+, disabling user interface.])
309        WANT_GTK=no
310 <      ;;
310 >     ;;
311      esac
312    ])
313    ;;
314   esac
315   if [[ "x$WANT_GTK" = "xgtk" ]]; then
316 +  WANT_GTK=no
317    AM_PATH_GTK(1.2.0, [
318 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
319 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
320 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
272 <    LIBS="$LIBS $GTK_LIBS"
273 <    UISRCS=prefs_editor_gtk.cpp
318 >    GUI_CFLAGS="$GTK_CFLAGS"
319 >    GUI_LIBS="$GTK_LIBS"
320 >    WANT_GTK=gtk
321    ], [
322      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
276    WANT_GTK=no
323    ])
324   fi
325 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
326 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
327 +  UISRCS=prefs_editor_gtk.cpp
328 + fi
329 + AC_SUBST(GUI_CFLAGS)
330 + AC_SUBST(GUI_LIBS)
331 +
332 + dnl Build external GUI if requested.
333 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
334 +  WANT_STANDALONE_GUI=no
335 + fi
336 + if [[ "$WANT_GTK" = "no" ]]; then
337 +  WANT_STANDALONE_GUI=no
338 + fi
339 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
340  
341   dnl We use ESD if possible.
342   if [[ "x$WANT_ESD" = "xyes" ]]; then
343 +  WANT_ESD=no
344    AM_PATH_ESD(0.2.8, [
345      AC_DEFINE(ENABLE_ESD, 1, [Define is using ESD.])
346      CFLAGS="$CFLAGS $ESD_CFLAGS"
347      CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
348      LIBS="$LIBS $ESD_LIBS"
349 +    WANT_ESD=yes
350    ], [
351      AC_MSG_WARN([Could not find ESD, disabling ESD support.])
289    WANT_ESD=no
352    ])
353   fi
354  
# Line 411 | Line 473 | mips-sony-bsd|mips-sony-newsos4)
473   *-*-cygwin*)
474          no_dev_ptmx=1
475          ;;
476 + *-*-darwin*)
477 +        no_dev_ptmx=1
478 +        ;;
479   esac
480  
481   if test -z "$no_dev_ptmx" ; then
# Line 431 | Line 496 | AC_CHECK_FILE([/dev/ptc],
496   )
497   dnl (end of code from openssh-3.2.2p1 configure.ac)
498  
499 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
500 + dnl doesn't work or is unimplemented. On these systems (mostly older
501 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
502 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
503 +  ac_cv_nonblocking_io, [
504 +  case "$host" in
505 +  *-*-osf*)
506 +    ac_cv_nonblocking_io=FIONBIO
507 +    ;;
508 +  *-*-sunos4*)
509 +    ac_cv_nonblocking_io=FIONBIO
510 +    ;;
511 +  *-*-ultrix*)
512 +    ac_cv_nonblocking_io=FIONBIO
513 +    ;;
514 +  *)
515 +    ac_cv_nonblocking_io=O_NONBLOCK
516 +    ;;
517 +  esac
518 + ])
519 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
520 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
521 + fi
522 +
523 + dnl Check whether compiler supports byte bit-fields
524 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
525 +  ac_cv_have_byte_bitfields, [
526 +  AC_LANG_SAVE
527 +  AC_LANG_CPLUSPLUS
528 +  AC_TRY_RUN([
529 +    struct A {
530 +      unsigned char b1:4;
531 +      unsigned char b2:4;
532 +      unsigned char c;
533 +      unsigned short s;
534 +      unsigned char a[4];
535 +    };
536 +
537 +    int main(void) {
538 +      A a;
539 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
540 +    }],
541 +    [ac_cv_have_byte_bitfields=yes],
542 +    [ac_cv_have_byte_bitfields=no],
543 +    dnl When cross-compiling, assume only GCC supports this
544 +    [if [[ "$GCC" = "yes" ]]; then
545 +      ac_cv_have_byte_bitfields="guessing yes"
546 +    else
547 +      ac_cv_have_byte_bitfields="guessing no"
548 +    fi]
549 +    )
550 +  AC_LANG_RESTORE
551 + ])
552 +
553   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
554 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
554 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
555    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
556    AC_CACHE_CHECK([whether compiler supports framework $1],
557      ac_Framework, [
558      saved_LIBS="$LIBS"
559      LIBS="$LIBS -framework $1"
560      AC_TRY_LINK(
561 <      [$2], [int main(void) { return 0; }],
561 >      [$2], [],
562        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
563      )
564    ])
# Line 453 | Line 572 | dnl Check for some MacOS X frameworks
572   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
573   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
574   AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
575 + AC_CHECK_FRAMEWORK(CoreAudio, [#include <CoreAudio/CoreAudio.h>])
576 + AC_CHECK_FRAMEWORK(AudioUnit, [#include <AudioUnit/AudioUnit.h>])
577 + AC_CHECK_FRAMEWORK(AudioToolbox, [#include <AudioToolbox/AudioToolbox.h>])
578 + AC_CHECK_FRAMEWORK(AppKit, [])
579  
580   dnl Select system-dependant sources.
581   SERIALSRC=serial_unix.cpp
582   ETHERSRC=../dummy/ether_dummy.cpp
583   SCSISRC=../dummy/scsi_dummy.cpp
584   AUDIOSRC=../dummy/audio_dummy.cpp
585 + PREFSSRC=../dummy/prefs_dummy.cpp
586   EXTFSSRC=extfs_unix.cpp
587   EXTRASYSSRCS=
588   case "$target_os" in
# Line 488 | Line 612 | darwin*)
612      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
613    fi
614    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
615 <    EXTFSSRC=../MacOSX/extfs_macosx.mm
615 >    EXTFSSRC=../MacOSX/extfs_macosx.cpp
616 >    if [[ "x$ac_cv_framework_AppKit" = "xyes" -a "x$WANT_GTK" = "xno" ]]; then
617 >      PREFSSRC="../MacOSX/prefs_macosx.mm ../MacOSX/Launcher/VMSettingsController.mm"
618 >      CPPFLAGS="$CPPFLAGS -I../MacOSX/Launcher"
619 >    fi
620 >  fi
621 >  if [[ "x$WANT_ESD" = "xno" -a "x$ac_cv_framework_CoreAudio" = "xyes" -a "x$WANT_SDL_AUDIO" = "xno" ]]; then
622 >    AUDIOSRC="../MacOSX/audio_macosx.cpp ../MacOSX/AudioBackEnd.cpp ../MacOSX/AudioDevice.cpp ../MacOSX/MacOSX_sound_if.cpp"
623 >    OSX_CORE_AUDIO="-DOSX_CORE_AUDIO"
624    fi
625    ;;
626 + irix*)
627 +  AUDIOSRC=Irix/audio_irix.cpp
628 +  LIBS="$LIBS -laudio"
629 +  WANT_ESD=no
630 +
631 +  dnl Check if our compiler supports -IPA (MIPSPro)
632 +  HAVE_IPA=no
633 +  ocflags="$CFLAGS"
634 +  CFLAGS=`echo " $CFLAGS -IPA" | sed -e "s/ -g //g"`
635 +  AC_MSG_CHECKING(if "-IPA" works)
636 +  dnl Do a test compile of an empty function
637 +  AC_TRY_COMPILE([#if defined __GNUC__
638 +                  # error GCC does not support IPA yet
639 +                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
640 +  CFLAGS="$ocflags"
641 +  ;;
642   esac
643  
644 + dnl BINCUE
645 + AS_IF([test  "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
646 + AS_IF([test  "x$have_bincue" = "xyes" ], [
647 +   if [[ "xOSX_CORE_AUDIO" = "xno"  -a "x$WANT_SDL_AUDIO"="xno"]]; then
648 +       AC_MSG_ERROR([You need SDL or OSX Core Audio to use BINCUE support.])
649 +   else
650 +       CPPFLAGS="$CPPFLAGS -DBINCUE $OSX_CORE_AUDIO"
651 +   fi
652 + ])
653 +
654 + dnl LIBVHD
655 + AS_IF([test  "x$with_libvhd" = "xyes" ], [have_libvhd=yes], [have_libvhd=no])
656 + AS_IF([test  "x$have_libvhd" = "xyes" ], [
657 +       CPPFLAGS="$CPPFLAGS -DHAVE_LIBVHD"
658 +           LIBS="$LIBS -lvhd"
659 +           case $target_os in
660 +           linux*)
661 +           LIBS="$LIBS -luuid"
662 +           esac
663 +           AC_CHECK_LIB(vhd, vhd_open)
664 +           AC_CHECK_LIB(vhd, vhd_io_read)
665 +           AC_CHECK_LIB(vhd, vhd_io_write)
666 +           AC_CHECK_LIB(vhd, vhd_close)
667 + ])
668 +
669 +
670 +
671 +
672   dnl Is the slirp library supported?
673 < if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
673 > case "$ac_cv_have_byte_bitfields" in
674 > yes|"guessing yes")
675 >  CAN_SLIRP=yes
676 >  ETHERSRC=ether_unix.cpp
677 >  ;;
678 > esac
679 > if [[ -n "$CAN_SLIRP" ]]; then
680    AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
681    SLIRP_SRCS="\
682      ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
# Line 509 | Line 691 | AC_SUBST(SLIRP_SRCS)
691   dnl SDL overrides
692   if [[ "x$WANT_SDL" = "xyes" ]]; then
693    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
694 +  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
695 +    EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m"
696 +  fi
697   fi
698   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
699    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
# Line 529 | Line 714 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
714    AUDIOSRC="../SDL/audio_sdl.cpp"
715   fi
716  
717 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
717 > dnl BINCUE overrides
718 >
719 > if [[ "x$have_bincue" = "xyes" ]]; then
720 >  EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
721 > fi
722 >
723 > dnl libvhd overrides
724 >
725 > if [[ "x$have_libvhd" = "xyes" ]]; then
726 >  EXTRASYSSRCS="$EXTRASYSSRCS vhd_unix.cpp"
727 > fi
728 >
729 >
730 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $PREFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
731  
732   dnl Define a macro that translates a yesno-variable into a C macro definition
733   dnl to be put into the config.h file
734   dnl $1 -- the macro to define
735   dnl $2 -- the value to translate
736   dnl $3 -- template name
737 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
737 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
738      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
739          AC_DEFINE($1, 1, $3)
740      fi
# Line 1178 | Line 1376 | HAVE_GCC27=no
1376   AC_MSG_CHECKING(for GCC 2.7 or higher)
1377   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1378                                       # error gcc < 2.7
1379 +                                     typedef syntax error;
1380                                       #endif
1381                                     ]])],
1382                    [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
# Line 1188 | Line 1387 | HAVE_GCC30=no
1387   AC_MSG_CHECKING(for GCC 3.0 or higher)
1388   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1389                                       # error gcc < 3
1390 +                                     typedef syntax error;
1391                                       #endif
1392                                     ]])],
1393                    [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
# Line 1235 | Line 1435 | if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1435    CFLAGS="$SAVED_CFLAGS"
1436   fi
1437  
1438 < dnl Add -mdynamic-no-pic for MacOS X
1439 < if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1438 > dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1439 > if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1440    SAVED_CFLAGS="$CFLAGS"
1441    CFLAGS="$CFLAGS -mdynamic-no-pic"
1442    AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
# Line 1258 | Line 1458 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1458      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1459      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1460      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1461 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1461 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1462 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1463    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1464  
1465    dnl Enable JIT compiler, if possible
# Line 1275 | Line 1476 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1476        i?86:elf)
1477          ac_cv_use_dyngen=yes
1478          ;;
1479 +      mips:elf)
1480 +        ac_cv_use_dyngen=yes
1481 +        ;;
1482        powerpc:mach)
1483          ac_cv_use_dyngen=yes
1484          ;;
1485 +      i?86:mach)
1486 +        ac_cv_use_dyngen=yes
1487 +        ;;
1488        *:*)
1489          ac_cv_use_dyngen=no
1490          ;;
# Line 1287 | Line 1494 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1494          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1495            DYNGEN_CC=$CXX
1496          else
1497 <          for p in /usr/bin /usr/local/bin; do
1497 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1498              gxx="$p/g++"
1499              if [[ -x "$gxx" ]]; then
1500                DYNGEN_CC="$gxx"
# Line 1302 | Line 1509 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1509      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1510        case $host_cpu in
1511        i?86)
1512 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1512 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1513 >        ;;
1514 >      mips)
1515 >        DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
1516          ;;
1517        powerpc)
1518          if [[ "x$ac_cv_object_format" = "xmach" ]]; then
# Line 1310 | Line 1520 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1520          fi
1521          ;;
1522        esac
1523 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1524 <        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1523 >      have_dyngen_gcc3=no
1524 >      case "x`$DYNGEN_CC -dumpversion`" in
1525 >      x[12].*) ;;
1526 >      x*) have_dyngen_gcc3=yes ;;
1527 >      esac
1528 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1529 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1530        else
1531          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1532        fi
1533 <      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000 -fno-exceptions -g0"
1534 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1533 >      DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1534 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1535          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1536        fi
1537 +      if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
1538 +        DYNGEN_CFLAGS="-O2 $CFLAGS"
1539 +        DYNGEN_CXXFLAGS="-O2 $CXXFLAGS"
1540 +      else
1541 +        DYNGEN_CFLAGS="\$(CFLAGS)"
1542 +        DYNGEN_CXXFLAGS="\$(CXXFLAGS)"
1543 +      fi
1544      else
1545        WANT_JIT=no
1546      fi
# Line 1330 | Line 1552 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1552        CPUSRCS="\
1553          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1554          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1555 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1555 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1556 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1557      fi
1558    fi
1559    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1560   else
1561    WANT_JIT=no
1562   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
1563   if [[ "x$WANT_JIT" = "xyes" ]]; then
1564    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1565   fi
1566  
1567 + dnl Higher level optimizations with MIPSPro compilers are possible
1568 + if [[ "x$HAVE_IPA" = "xyes" ]]; then
1569 +  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1570 +  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1571 +  CXXFLAGS="-LANG:std $CXXFLAGS"
1572 +  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1573 + fi
1574 +
1575 + dnl Check for linker script support
1576 + case $target_os:$target_cpu in
1577 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1578 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1579 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1580 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1581 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1582 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1583 + esac
1584 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1585 +  AC_CACHE_CHECK([whether linker script is usable],
1586 +    ac_cv_linker_script_works, [
1587 +    AC_LANG_SAVE
1588 +    AC_LANG_CPLUSPLUS
1589 +    saved_LDFLAGS="$LDFLAGS"
1590 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1591 +    AC_TRY_RUN(
1592 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1593 +      [ac_cv_linker_script_works=yes],
1594 +      [ac_cv_linker_script_works=no],
1595 +      dnl When cross-compiling, assume it works
1596 +      [ac_cv_linker_script_works="guessing yes"]
1597 +    )
1598 +    AC_LANG_RESTORE
1599 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1600 +      LDFLAGS="$saved_LDFLAGS"
1601 +      LINKER_SCRIPT_FLAGS=""
1602 +    fi
1603 +  ])
1604 + fi
1605 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1606 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1607 +
1608   dnl Generate Makefile.
1609   AC_SUBST(PERL)
1610   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
1611   AC_SUBST(DYNGENSRCS)
1612   AC_SUBST(DYNGEN_CC)
1613 + AC_SUBST(DYNGEN_CFLAGS)
1614 + AC_SUBST(DYNGEN_CXXFLAGS)
1615   AC_SUBST(DYNGEN_OP_FLAGS)
1616   AC_SUBST(SYSSRCS)
1617   AC_SUBST(CPUSRCS)
# Line 1387 | Line 1627 | echo
1627   echo SheepShaver configuration summary:
1628   echo
1629   echo SDL support ...................... : $SDL_SUPPORT
1630 + echo BINCUE support ................... : $have_bincue
1631 + echo LIBVHD support ................... : $have_libvhd
1632   echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1633   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1634   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines