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.46 by gbeauche, 2006-01-22T00:08:32Z vs.
Revision 1.70 by asvitkine, 2010-12-28T02:36:09Z

# Line 5 | Line 5 | AC_INIT([SheepShaver], 2.3, [Christian.B
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 127 | Line 144 | 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
179   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
# Line 141 | 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
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
213    fi
214    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
215   else
# Line 173 | 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 244 | 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"
250 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
251 <    LIBS="$LIBS $GTK_LIBS"
252 <    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 260 | 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"
273 <    LIBS="$LIBS $GTK_LIBS"
274 <    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.])
277    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.])
290    WANT_ESD=no
359    ])
360   fi
361  
# Line 412 | 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 432 | 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, [
# Line 454 | 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 489 | 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*)
496  ETHERSRC=ether_unix.cpp
634    AUDIOSRC=Irix/audio_irix.cpp
635    LIBS="$LIBS -laudio"
636    WANT_ESD=no
# Line 511 | Line 648 | irix*)
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 527 | 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 547 | Line 721 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
721    AUDIOSRC="../SDL/audio_sdl.cpp"
722   fi
723  
724 < SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
724 > dnl BINCUE overrides
725 >
726 > if [[ "x$have_bincue" = "xyes" ]]; then
727 >  EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
728 > fi
729 >
730 > dnl libvhd overrides
731 >
732 > if [[ "x$have_libvhd" = "xyes" ]]; then
733 >  EXTRASYSSRCS="$EXTRASYSSRCS vhd_unix.cpp"
734 > fi
735 >
736 >
737 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $PREFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $EXTRASYSSRCS"
738  
739   dnl Define a macro that translates a yesno-variable into a C macro definition
740   dnl to be put into the config.h file
741   dnl $1 -- the macro to define
742   dnl $2 -- the value to translate
743   dnl $3 -- template name
744 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
744 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
745      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
746          AC_DEFINE($1, 1, $3)
747      fi
# Line 1278 | Line 1465 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1465      ../kpx_cpu/src/cpu/ppc/ppc-cpu.cpp \
1466      ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp \
1467      ../kpx_cpu/src/cpu/ppc/ppc-execute.cpp \
1468 <    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp"
1468 >    ../kpx_cpu/src/cpu/ppc/ppc-translate.cpp \
1469 >    ../kpx_cpu/src/utils/utils-cpuinfo.cpp"
1470    CPPFLAGS="$CPPFLAGS -I../kpx_cpu/include -I../kpx_cpu/src"
1471  
1472    dnl Enable JIT compiler, if possible
# Line 1345 | Line 1533 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1533        x*) have_dyngen_gcc3=yes ;;
1534        esac
1535        if [[ "x$have_dyngen_gcc3" = "xyes" ]]; then
1536 <        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -falign-functions=0"
1536 >        DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -fno-align-functions"
1537        else
1538          DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0"
1539        fi
# Line 1371 | Line 1559 | if [[ "x$EMULATED_PPC" = "xyes" ]]; then
1559        CPUSRCS="\
1560          ../kpx_cpu/src/cpu/jit/jit-cache.cpp \
1561          ../kpx_cpu/src/cpu/jit/basic-dyngen.cpp \
1562 <        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp $CPUSRCS"
1562 >        ../kpx_cpu/src/cpu/ppc/ppc-dyngen.cpp \
1563 >        ../kpx_cpu/src/cpu/ppc/ppc-jit.cpp $CPUSRCS"
1564      fi
1565    fi
1566    CPUSRCS="$CPUSRCS ../kpx_cpu/sheepshaver_glue.cpp"
1567   else
1568    WANT_JIT=no
1569   fi
1381 if [[ "x$ac_cv_use_dyngen" = "xyes" ]]; then
1382  AC_CACHE_CHECK([whether static data regions are executable],
1383    ac_cv_have_static_data_exec, [
1384    AC_TRY_RUN([int main(void) {
1385 #if defined(__powerpc__) || defined(__ppc__)
1386      static unsigned int p[8] = {0x4e800020,};
1387      asm volatile("dcbst 0,%0" : : "r" (p) : "memory");
1388      asm volatile("sync" : : : "memory");
1389      asm volatile("icbi 0,%0" : : "r" (p) : "memory");
1390      asm volatile("sync" : : : "memory");
1391      asm volatile("isync" : : : "memory");
1392      ((void (*)(void))p)();
1393      return 0;
1394 #endif
1395      return 1;
1396    }], ac_cv_have_static_data_exec=yes, ac_cv_have_static_data_exec=no,
1397    dnl When cross-compiling, do not assume anything.
1398    ac_cv_have_static_data_exec=no
1399    )
1400  ])
1401 else
1402  ac_cv_use_dyngen=no
1403 fi
1404 AC_TRANSLATE_DEFINE(HAVE_STATIC_DATA_EXEC, "$ac_cv_have_static_data_exec",
1405  [Define if your system marks static data pages as executable.])
1406
1570   if [[ "x$WANT_JIT" = "xyes" ]]; then
1571    CPPFLAGS="$CPPFLAGS -DUSE_JIT"
1572   fi
# Line 1416 | Line 1579 | if [[ "x$HAVE_IPA" = "xyes" ]]; then
1579    LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1580   fi
1581  
1582 + dnl Check for linker script support
1583 + case $target_os:$target_cpu in
1584 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1585 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1586 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1587 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1588 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1589 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1590 + esac
1591 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1592 +  AC_CACHE_CHECK([whether linker script is usable],
1593 +    ac_cv_linker_script_works, [
1594 +    AC_LANG_SAVE
1595 +    AC_LANG_CPLUSPLUS
1596 +    saved_LDFLAGS="$LDFLAGS"
1597 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1598 +    AC_TRY_RUN(
1599 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1600 +      [ac_cv_linker_script_works=yes],
1601 +      [ac_cv_linker_script_works=no],
1602 +      dnl When cross-compiling, assume it works
1603 +      [ac_cv_linker_script_works="guessing yes"]
1604 +    )
1605 +    AC_LANG_RESTORE
1606 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1607 +      LDFLAGS="$saved_LDFLAGS"
1608 +      LINKER_SCRIPT_FLAGS=""
1609 +    fi
1610 +  ])
1611 + fi
1612 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1613 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1614 +
1615   dnl Generate Makefile.
1616   AC_SUBST(PERL)
1617   AC_SUBST(USE_DYNGEN, [$ac_cv_use_dyngen])
# Line 1438 | Line 1634 | echo
1634   echo SheepShaver configuration summary:
1635   echo
1636   echo SDL support ...................... : $SDL_SUPPORT
1637 + echo BINCUE support ................... : $have_bincue
1638 + echo LIBVHD support ................... : $have_libvhd
1639   echo FBDev DGA support ................ : $WANT_FBDEV_DGA
1640   echo XFree86 DGA support .............. : $WANT_XF86_DGA
1641   echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines