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.43 by gbeauche, 2005-12-11T18:15:05Z vs.
Revision 1.68 by asvitkine, 2010-10-06T00:34:15Z

# 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 +
48   dnl Addressing mode
49   AC_ARG_ENABLE(addressing,
50    [  --enable-addressing=AM  set the addressing mode to use [default=real]],
# Line 55 | Line 60 | dnl SDL options.
60   AC_ARG_ENABLE(sdl-static,   [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
61   AC_ARG_ENABLE(sdl-video,    [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
62   AC_ARG_ENABLE(sdl-audio,    [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
63 + AC_ARG_ENABLE(sdl-framework,    [  --enable-sdl-framework  use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
64 + AC_ARG_ENABLE(sdl-framework-prefix,    [  --enable-sdl-framework-prefix=PFX    default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
65  
66   dnl Checks for programs.
67   AC_PROG_CC
# Line 105 | Line 112 | if [[ "x$WANT_MON" = "xyes" ]]; then
112    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
113      AC_MSG_RESULT(yes)
114      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
115 <    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"
115 >    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"
116      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
117      AC_CHECK_LIB(ncurses, tgetent, ,
118 <      AC_CHECK_LIB(termcap, tgetent, ,
119 <        AC_CHECK_LIB(termlib, tgetent, ,
120 <          AC_CHECK_LIB(terminfo, tgetent, ,
121 <            AC_CHECK_LIB(Hcurses, tgetent, ,
122 <              AC_CHECK_LIB(curses, tgetent))))))
118 >      [AC_CHECK_LIB(termcap, tgetent, ,
119 >        [AC_CHECK_LIB(termlib, tgetent, ,
120 >          [AC_CHECK_LIB(terminfo, tgetent, ,
121 >            [AC_CHECK_LIB(Hcurses, tgetent, ,
122 >              [AC_CHECK_LIB(curses, tgetent)])])])])])
123      AC_CHECK_LIB(readline, readline)
124      AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
125    else
# Line 127 | Line 134 | dnl Checks for libraries.
134   AC_CHECK_LIB(posix4, sem_init)
135   AC_CHECK_LIB(m, cos)
136  
137 + dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES)
138 + dnl AC_TRY_LINK uses main() but SDL needs main to take args,
139 + dnl therefore main is undefined with #undef.
140 + dnl Framework can be in an custom location.
141 + AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [
142 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])
143 +  AC_CACHE_CHECK([whether compiler supports framework $1],
144 +    ac_Framework, [
145 +    saved_LIBS="$LIBS"
146 +    LIBS="$LIBS -framework $1"
147 +    if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then
148 +      if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then
149 +        LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1"
150 +      fi
151 +    fi
152 +    saved_CPPFLAGS="$CPPFLAGS"
153 +    CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers"
154 +    AC_TRY_LINK(
155 +      [$2
156 + #undef main], [],
157 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no);
158 + LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"]
159 +    )
160 +  ])
161 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
162 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
163 +  )
164 +  AS_VAR_POPDEF([ac_Framework])
165 + ])
166 +
167   dnl Do we need SDL?
168   WANT_SDL=no
169   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
# Line 141 | Line 178 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
178    SDL_SUPPORT="$SDL_SUPPORT audio"
179   fi
180   if [[ "x$WANT_SDL" = "xyes" ]]; then
181 <  AC_PATH_PROG(sdl_config, "sdl-config")
182 <  if [[ -n "$sdl_config" ]]; then
183 <    sdl_cflags=`$sdl_config --cflags`
184 <    if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
185 <      sdl_libs=`$sdl_config --static-libs`
181 >  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
182 >    AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>])
183 >  else
184 >    ac_cv_framework_SDL=no
185 >  fi
186 >  if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
187 >    AC_PATH_PROG(sdl_config, "sdl-config")
188 >    if [[ -n "$sdl_config" ]]; then
189 >      sdl_cflags=`$sdl_config --cflags`
190 >      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
191 >        sdl_libs=`$sdl_config --static-libs`
192 >      else
193 >        sdl_libs=`$sdl_config --libs`
194 >      fi
195 >      CFLAGS="$CFLAGS $sdl_cflags"
196 >      CXXFLAGS="$CXXFLAGS $sdl_cflags"
197 >      LIBS="$LIBS $sdl_libs"
198      else
199 <      sdl_libs=`$sdl_config --libs`
199 >      WANT_SDL=no
200 >      WANT_SDL_VIDEO=no
201 >      WANT_SDL_AUDIO=no
202      fi
152    CFLAGS="$CFLAGS $sdl_cflags"
153    CXXFLAGS="$CXXFLAGS $sdl_cflags"
154    LIBS="$LIBS $sdl_libs"
155  else
156    WANT_SDL=no
157    WANT_SDL_VIDEO=no
158    WANT_SDL_AUDIO=no
203    fi
204    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
205   else
# Line 173 | Line 217 | if [[ "x$WANT_SDL_VIDEO" != "xyes" ]]; t
217    LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
218   fi
219  
220 +
221 +
222   dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL.
223   HAVE_PTHREADS=yes
224   case $EMULATED_PPC:$target_os in
# Line 244 | Line 290 | dnl We use GTK+ if possible.
290   UISRCS=../dummy/prefs_editor_dummy.cpp
291   case "x$WANT_GTK" in
292   xgtk2*)
293 +  WANT_GTK=no
294    AM_PATH_GTK_2_0(1.3.15, [
295 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
296 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
250 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
251 <    LIBS="$LIBS $GTK_LIBS"
252 <    UISRCS=prefs_editor_gtk.cpp
295 >    GUI_CFLAGS="$GTK_CFLAGS"
296 >    GUI_LIBS="$GTK_LIBS"
297      WANT_GTK=gtk2
298    ], [
299      case "x${WANT_GTK}x" in
# Line 260 | Line 304 | xgtk2*)
304      *)
305        AC_MSG_WARN([Could not find GTK+, disabling user interface.])
306        WANT_GTK=no
307 <      ;;
307 >     ;;
308      esac
309    ])
310    ;;
311   esac
312   if [[ "x$WANT_GTK" = "xgtk" ]]; then
313 +  WANT_GTK=no
314    AM_PATH_GTK(1.2.0, [
315 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
316 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
317 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
273 <    LIBS="$LIBS $GTK_LIBS"
274 <    UISRCS=prefs_editor_gtk.cpp
315 >    GUI_CFLAGS="$GTK_CFLAGS"
316 >    GUI_LIBS="$GTK_LIBS"
317 >    WANT_GTK=gtk
318    ], [
319      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
277    WANT_GTK=no
320    ])
321   fi
322 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
323 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
324 +  UISRCS=prefs_editor_gtk.cpp
325 + fi
326 + AC_SUBST(GUI_CFLAGS)
327 + AC_SUBST(GUI_LIBS)
328 +
329 + dnl Build external GUI if requested.
330 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
331 +  WANT_STANDALONE_GUI=no
332 + fi
333 + if [[ "$WANT_GTK" = "no" ]]; then
334 +  WANT_STANDALONE_GUI=no
335 + fi
336 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
337  
338   dnl We use ESD if possible.
339   if [[ "x$WANT_ESD" = "xyes" ]]; then
340 +  WANT_ESD=no
341    AM_PATH_ESD(0.2.8, [
342      AC_DEFINE(ENABLE_ESD, 1, [Define is using ESD.])
343      CFLAGS="$CFLAGS $ESD_CFLAGS"
344      CXXFLAGS="$CXXFLAGS $ESD_CFLAGS"
345      LIBS="$LIBS $ESD_LIBS"
346 +    WANT_ESD=yes
347    ], [
348      AC_MSG_WARN([Could not find ESD, disabling ESD support.])
290    WANT_ESD=no
349    ])
350   fi
351  
# Line 412 | Line 470 | mips-sony-bsd|mips-sony-newsos4)
470   *-*-cygwin*)
471          no_dev_ptmx=1
472          ;;
473 + *-*-darwin*)
474 +        no_dev_ptmx=1
475 +        ;;
476   esac
477  
478   if test -z "$no_dev_ptmx" ; then
# Line 432 | Line 493 | AC_CHECK_FILE([/dev/ptc],
493   )
494   dnl (end of code from openssh-3.2.2p1 configure.ac)
495  
496 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
497 + dnl doesn't work or is unimplemented. On these systems (mostly older
498 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
499 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
500 +  ac_cv_nonblocking_io, [
501 +  case "$host" in
502 +  *-*-osf*)
503 +    ac_cv_nonblocking_io=FIONBIO
504 +    ;;
505 +  *-*-sunos4*)
506 +    ac_cv_nonblocking_io=FIONBIO
507 +    ;;
508 +  *-*-ultrix*)
509 +    ac_cv_nonblocking_io=FIONBIO
510 +    ;;
511 +  *)
512 +    ac_cv_nonblocking_io=O_NONBLOCK
513 +    ;;
514 +  esac
515 + ])
516 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
517 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
518 + fi
519 +
520 + dnl Check whether compiler supports byte bit-fields
521 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
522 +  ac_cv_have_byte_bitfields, [
523 +  AC_LANG_SAVE
524 +  AC_LANG_CPLUSPLUS
525 +  AC_TRY_RUN([
526 +    struct A {
527 +      unsigned char b1:4;
528 +      unsigned char b2:4;
529 +      unsigned char c;
530 +      unsigned short s;
531 +      unsigned char a[4];
532 +    };
533 +
534 +    int main(void) {
535 +      A a;
536 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
537 +    }],
538 +    [ac_cv_have_byte_bitfields=yes],
539 +    [ac_cv_have_byte_bitfields=no],
540 +    dnl When cross-compiling, assume only GCC supports this
541 +    [if [[ "$GCC" = "yes" ]]; then
542 +      ac_cv_have_byte_bitfields="guessing yes"
543 +    else
544 +      ac_cv_have_byte_bitfields="guessing no"
545 +    fi]
546 +    )
547 +  AC_LANG_RESTORE
548 + ])
549 +
550   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
551 < AC_DEFUN(AC_CHECK_FRAMEWORK, [
551 > AC_DEFUN([AC_CHECK_FRAMEWORK], [
552    AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
553    AC_CACHE_CHECK([whether compiler supports framework $1],
554      ac_Framework, [
555      saved_LIBS="$LIBS"
556      LIBS="$LIBS -framework $1"
557      AC_TRY_LINK(
558 <      [$2], [int main(void) { return 0; }],
558 >      [$2], [],
559        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
560      )
561    ])
# Line 454 | Line 569 | dnl Check for some MacOS X frameworks
569   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
570   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
571   AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
572 + AC_CHECK_FRAMEWORK(CoreAudio, [#include <CoreAudio/CoreAudio.h>])
573 + AC_CHECK_FRAMEWORK(AudioUnit, [#include <AudioUnit/AudioUnit.h>])
574 + AC_CHECK_FRAMEWORK(AudioToolbox, [#include <AudioToolbox/AudioToolbox.h>])
575 + AC_CHECK_FRAMEWORK(AppKit, [])
576  
577   dnl Select system-dependant sources.
578   SERIALSRC=serial_unix.cpp
579   ETHERSRC=../dummy/ether_dummy.cpp
580   SCSISRC=../dummy/scsi_dummy.cpp
581   AUDIOSRC=../dummy/audio_dummy.cpp
582 + PREFSSRC=../dummy/prefs_dummy.cpp
583   EXTFSSRC=extfs_unix.cpp
584   EXTRASYSSRCS=
585   case "$target_os" in
# Line 489 | Line 609 | darwin*)
609      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/sys_darwin.cpp"
610    fi
611    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
612 <    EXTFSSRC=../MacOSX/extfs_macosx.mm
612 >    EXTFSSRC=../MacOSX/extfs_macosx.cpp
613 >    if [[ "x$ac_cv_framework_AppKit" = "xyes" -a "x$WANT_GTK" = "xno" ]]; then
614 >      PREFSSRC="../MacOSX/prefs_macosx.mm ../MacOSX/Launcher/VMSettingsController.mm"
615 >      CPPFLAGS="$CPPFLAGS -I../MacOSX/Launcher"
616 >    fi
617 >  fi
618 >  if [[ "x$WANT_ESD" = "xno" -a "x$ac_cv_framework_CoreAudio" = "xyes" -a "x$WANT_SDL_AUDIO" = "xno" ]]; then
619 >    AUDIOSRC="../MacOSX/audio_macosx.cpp ../MacOSX/AudioBackEnd.cpp ../MacOSX/AudioDevice.cpp ../MacOSX/MacOSX_sound_if.cpp"
620 >    OSX_CORE_AUDIO="-DOSX_CORE_AUDIO"
621    fi
622    ;;
623   irix*)
496  ETHERSRC=ether_unix.cpp
624    AUDIOSRC=Irix/audio_irix.cpp
625    LIBS="$LIBS -laudio"
626    WANT_ESD=no
# Line 511 | Line 638 | irix*)
638    ;;
639   esac
640  
641 + dnl BINCUE
642 + AS_IF([test  "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
643 + AS_IF([test  "x$have_bincue" = "xyes" ], [
644 +   if [[ "xOSX_CORE_AUDIO" = "xno"  -a "x$WANT_SDL_AUDIO"="xno"]]; then
645 +       AC_MSG_ERROR([You need SDL or OSX Core Audio to use BINCUE support.])
646 +   else
647 +       CPPFLAGS="$CPPFLAGS -DBINCUE $OSX_CORE_AUDIO"
648 +   fi
649 + ])
650 +
651 +
652   dnl Is the slirp library supported?
653 < if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
653 > case "$ac_cv_have_byte_bitfields" in
654 > yes|"guessing yes")
655 >  CAN_SLIRP=yes
656 >  ETHERSRC=ether_unix.cpp
657 >  ;;
658 > esac
659 > if [[ -n "$CAN_SLIRP" ]]; then
660    AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
661    SLIRP_SRCS="\
662      ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
# Line 527 | Line 671 | AC_SUBST(SLIRP_SRCS)
671   dnl SDL overrides
672   if [[ "x$WANT_SDL" = "xyes" ]]; then
673    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support.])
674 +  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
675 +    EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m"
676 +  fi
677   fi
678   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
679    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support.])
# Line 547 | Line 694 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
694    AUDIOSRC="../SDL/audio_sdl.cpp"
695   fi
696  
697 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
697 > dnl BINCUE overrides
698 >
699 > if [[ "x$have_bincue" = "xyes" ]]; then
700 >  EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
701 > fi
702 >
703 >
704 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $PREFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
705  
706   dnl Define a macro that translates a yesno-variable into a C macro definition
707   dnl to be put into the config.h file
708   dnl $1 -- the macro to define
709   dnl $2 -- the value to translate
710   dnl $3 -- template name
711 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
711 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
712      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
713          AC_DEFINE($1, 1, $3)
714      fi
# Line 1196 | Line 1350 | HAVE_GCC27=no
1350   AC_MSG_CHECKING(for GCC 2.7 or higher)
1351   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1352                                       # error gcc < 2.7
1353 +                                     typedef syntax error;
1354                                       #endif
1355                                     ]])],
1356                    [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
# Line 1206 | Line 1361 | HAVE_GCC30=no
1361   AC_MSG_CHECKING(for GCC 3.0 or higher)
1362   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1363                                       # error gcc < 3
1364 +                                     typedef syntax error;
1365                                       #endif
1366                                     ]])],
1367                    [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
# Line 1276 | Line 1432 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1432      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1433      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1434      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1435 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1435 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1436 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1437    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1438  
1439    dnl Enable JIT compiler, if possible
# Line 1311 | Line 1468 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1468          if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1469            DYNGEN_CC=$CXX
1470          else
1471 <          for p in /usr/bin /usr/local/bin; do
1471 >          for p in /usr/bin /usr/local/bin /usr/freeware/bin; do
1472              gxx="$p/g++"
1473              if [[ -x "$gxx" ]]; then
1474                DYNGEN_CC="$gxx"
# Line 1326 | Line 1483 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1483      if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1484        case $host_cpu in
1485        i?86)
1486 <        DYNGEN_OP_FLAGS="-fomit-frame-pointer -mpreferred-stack-boundary=2"
1486 >        DYNGEN_OP_FLAGS="-fomit-frame-pointer"
1487          ;;
1488        mips)
1489          DYNGEN_OP_FLAGS="-fno-delayed-branch -mno-abicalls"
# Line 1337 | Line 1494 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1494          fi
1495          ;;
1496        esac
1497 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1498 <        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1497 >      have_dyngen_gcc3=no
1498 >      case "x`$DYNGEN_CC -dumpversion`" in
1499 >      x[12].*) ;;
1500 >      x*) have_dyngen_gcc3=yes ;;
1501 >      esac
1502 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1503 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1504        else
1505          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1506        fi
1507        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-functions -finline-limit=10000 -fno-exceptions -g0"
1508 <      if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1508 >      if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1509          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-reorder-blocks -fno-optimize-sibling-calls"
1510        fi
1511        if [[ "x$DYNGEN_CC" != "x$CXX" ]]; then
# Line 1364 | Line 1526 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1526        CPUSRCS="\
1527          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1528          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1529 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1529 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1530 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1531      fi
1532    fi
1533    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1534   else
1535    WANT_JIT=no
1536   fi
1374 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1375  AC_CACHE_CHECK([whether static data regions are executable],
1376    ac_cv_have_static_data_exec, [
1377    AC_TRY_RUN([int main(void) {
1378 #if defined(__powerpc__) || defined(__ppc__)
1379      static unsigned int p[8] = {0x4e800020,};
1380      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1381      asm volatile("sync" : : : "memory");
1382      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1383      asm volatile("sync" : : : "memory");
1384      asm volatile("isync" : : : "memory");
1385      ((void (*)(void))p)();
1386      return 0;
1387 #endif
1388      return 1;
1389    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1390    dnl When cross-compiling, do not assume anything.
1391    ac_cv_have_static_data_exec=no
1392    )
1393  ])
1394 else
1395  ac_cv_use_dyngen=no
1396 fi
1397 AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1398  [Define if your system marks static data pages as executable.])
1399
1537   if [[ "x$WANT_JIT" = "xyes" ]]; then
1538    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1539   fi
# Line 1409 | Line 1546 | if [[ "x$HAVE_IPA" = "xyes" ]]; then
1546    LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1547   fi
1548  
1549 + dnl Check for linker script support
1550 + case $target_os:$target_cpu in
1551 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1552 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1553 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1554 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1555 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1556 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1557 + esac
1558 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1559 +  AC_CACHE_CHECK([whether linker script is usable],
1560 +    ac_cv_linker_script_works, [
1561 +    AC_LANG_SAVE
1562 +    AC_LANG_CPLUSPLUS
1563 +    saved_LDFLAGS="$LDFLAGS"
1564 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1565 +    AC_TRY_RUN(
1566 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1567 +      [ac_cv_linker_script_works=yes],
1568 +      [ac_cv_linker_script_works=no],
1569 +      dnl When cross-compiling, assume it works
1570 +      [ac_cv_linker_script_works="guessing yes"]
1571 +    )
1572 +    AC_LANG_RESTORE
1573 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1574 +      LDFLAGS="$saved_LDFLAGS"
1575 +      LINKER_SCRIPT_FLAGS=""
1576 +    fi
1577 +  ])
1578 + fi
1579 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1580 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1581 +
1582   dnl Generate Makefile.
1583   AC_SUBST(PERL)
1584   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
# Line 1431 | Line 1601 | echo
1601   echo SheepShaver configuration summary:
1602   echo
1603   echo SDL support ...................... : $SDL_SUPPORT
1604 + echo BINCUE support ................... : $have_bincue
1605   echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1606   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1607   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines