ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/configure.ac
(Generate patch)

Comparing BasiliskII/src/Unix/configure.ac (file contents):
Revision 1.53 by gbeauche, 2005-07-06T05:25:05Z vs.
Revision 1.84 by asvitkine, 2012-06-17T23:15:10Z

# Line 6 | Line 6 | AC_CONFIG_SRCDIR(main_unix.cpp)
6   AC_PREREQ(2.52)
7   AC_CONFIG_HEADER(config.h)
8  
9 + AC_USE_SYSTEM_EXTENSIONS
10 +
11   dnl Aliases for PACKAGE and VERSION macros.
12   AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
13   AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
# Line 14 | Line 16 | dnl Some systems do not put corefiles in
16   dnl cores for the configure tests since some are intended to dump core.
17   ulimit -c 0
18  
19 + AC_ARG_ENABLE(standalone-gui,[  --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no])
20 +
21   dnl Video options.
22   AC_ARG_ENABLE(xf86-dga,      [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
23   AC_ARG_ENABLE(xf86-vidmode,  [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
# Line 24 | Line 28 | dnl SDL options.
28   AC_ARG_ENABLE(sdl-static,    [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
29   AC_ARG_ENABLE(sdl-video,     [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
30   AC_ARG_ENABLE(sdl-audio,     [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
31 + AC_ARG_ENABLE(sdl-framework,    [  --enable-sdl-framework  use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
32 + AC_ARG_ENABLE(sdl-framework-prefix,    [  --enable-sdl-framework-prefix=PFX    default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
33  
34   dnl JIT compiler options.
35   AC_ARG_ENABLE(jit-compiler,  [  --enable-jit-compiler   enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
# Line 70 | Line 76 | AC_ARG_WITH(gtk,             [  --with-g
76    [WANT_GTK="gtk2 gtk"])
77   AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
78  
79 + AC_ARG_WITH(bincue,  
80 +  AS_HELP_STRING([--with-bincue], [Allow cdrom image files in bin/cue mode]))
81 +
82 + AC_ARG_WITH(libvhd,  
83 +  AS_HELP_STRING([--with-libvhd], [Enable VHD disk images]))
84 +
85 +
86   dnl Canonical system information.
87   AC_CANONICAL_HOST
88   AC_CANONICAL_TARGET
# Line 99 | Line 112 | case "$target_cpu" in
112    x86_64* ) HAVE_X86_64=yes;;
113   esac
114  
115 + dnl Check if we should really be assuming x86_64 even if we detected HAVE_I386 above.
116 + if [[ "x$HAVE_I386" = "xyes" ]]; then
117 +  AC_TRY_RUN([
118 +    int main(void) {
119 +        #if defined(__x86_64__)
120 +                return 0;
121 +        #else
122 +                return 1;
123 +        #endif
124 +    }
125 +  ], [
126 +    HAVE_I386=no
127 +    HAVE_X86_64=yes
128 +  ])
129 + fi
130 +
131   dnl Checks for programs.
132   AC_PROG_CC
133   AC_PROG_CC_C_O
# Line 116 | Line 145 | if [[ "x$WANT_MON" = "xyes" ]]; then
145    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
146      AC_MSG_RESULT(yes)
147      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
148 <    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c"
148 >    MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.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"
149      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
150      AC_CHECK_LIB(ncurses, tgetent, ,
151 <      AC_CHECK_LIB(termcap, tgetent, ,
152 <        AC_CHECK_LIB(termlib, tgetent, ,
153 <          AC_CHECK_LIB(terminfo, tgetent, ,
154 <            AC_CHECK_LIB(Hcurses, tgetent, ,
155 <              AC_CHECK_LIB(curses, tgetent))))))
151 >      [AC_CHECK_LIB(termcap, tgetent, ,
152 >        [AC_CHECK_LIB(termlib, tgetent, ,
153 >          [AC_CHECK_LIB(terminfo, tgetent, ,
154 >            [AC_CHECK_LIB(Hcurses, tgetent, ,
155 >              [AC_CHECK_LIB(curses, tgetent)])])])])])
156      AC_CHECK_LIB(readline, readline)
157    else
158      AC_MSG_RESULT(no)
# Line 136 | Line 165 | dnl Checks for libraries.
165   AC_CHECK_LIB(posix4, sem_init)
166   AC_CHECK_LIB(rt, timer_create)
167   AC_CHECK_LIB(rt, shm_open)
168 + AC_CHECK_LIB(m, cos)
169 +
170 + dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES)
171 + dnl AC_TRY_LINK uses main() but SDL needs main to take args,
172 + dnl therefore main is undefined with #undef.
173 + dnl Framework can be in an custom location.
174 + AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [
175 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])
176 +  AC_CACHE_CHECK([whether compiler supports framework $1],
177 +    ac_Framework, [
178 +    saved_LIBS="$LIBS"
179 +    LIBS="$LIBS -framework $1"
180 +    if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then
181 +      if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then
182 +        LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1"
183 +      fi
184 +    fi
185 +    saved_CPPFLAGS="$CPPFLAGS"
186 +    CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers"
187 +    AC_TRY_LINK(
188 +      [$2
189 + #undef main], [],
190 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no);
191 + LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"]
192 +    )
193 +  ])
194 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
195 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
196 +  )
197 +  AS_VAR_POPDEF([ac_Framework])
198 + ])
199  
200   dnl Do we need SDL?
201   WANT_SDL=no
# Line 151 | Line 211 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
211    SDL_SUPPORT="$SDL_SUPPORT audio"
212   fi
213   if [[ "x$WANT_SDL" = "xyes" ]]; then
214 <  AC_PATH_PROG(sdl_config, "sdl-config")
215 <  if [[ -n "$sdl_config" ]]; then
156 <    case $target_os in
157 <    # Special treatment for Cygwin so that we can still use the POSIX layer
158 <    *cygwin*)
159 <      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
160 <      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
161 <      ;;
162 <    *)
163 <      sdl_cflags=`$sdl_config --cflags`
164 <      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
165 <        sdl_libs=`$sdl_config --static-libs`
166 <      else
167 <        sdl_libs=`$sdl_config --libs`
168 <      fi
169 <      ;;
170 <    esac
171 <    CFLAGS="$CFLAGS $sdl_cflags"
172 <    CXXFLAGS="$CXXFLAGS $sdl_cflags"
173 <    LIBS="$LIBS $sdl_libs"
214 >  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
215 >    AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>])
216    else
217 <    WANT_SDL=no
217 >    ac_cv_framework_SDL=no
218 >  fi
219 >  if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
220 >    AC_PATH_PROG(sdl_config, "sdl-config")
221 >    if [[ -n "$sdl_config" ]]; then
222 >      case $target_os in
223 >      # Special treatment for Cygwin so that we can still use the POSIX layer
224 >      *cygwin*)
225 >        sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
226 >        sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
227 >        ;;
228 >      *)
229 >        sdl_cflags=`$sdl_config --cflags`
230 >        if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
231 >          sdl_libs=`$sdl_config --static-libs`
232 >        else
233 >          sdl_libs=`$sdl_config --libs`
234 >        fi
235 >        ;;
236 >      esac
237 >      CFLAGS="$CFLAGS $sdl_cflags"
238 >      CXXFLAGS="$CXXFLAGS $sdl_cflags"
239 >      LIBS="$LIBS $sdl_libs"
240 >    else
241 >      WANT_SDL=no
242 >    fi
243    fi
244    SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
245   else
# Line 190 | Line 257 | if [[ "x$WANT_SDL" = "xno" ]]; then
257    LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
258   fi
259  
260 + dnl BINCUE
261 + AS_IF([test  "x$with_bincue" = "xyes" ], [have_bincue=yes], [have_bincue=no])
262 + AS_IF([test  "x$have_bincue" = "xyes" ], [
263 +   if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
264 +       DEFINES="$DEFINES -DBINCUE"
265 +   else
266 +       AC_MSG_ERROR([You need SDL Audio to use BINCUE support.])
267 +   fi
268 + ])
269 +
270 + dnl LIBVHD
271 + AS_IF([test  "x$with_libvhd" = "xyes" ], [have_libvhd=yes], [have_libvhd=no])
272 + AS_IF([test  "x$have_libvhd" = "xyes" ], [
273 +       CPPFLAGS="$CPPFLAGS -DHAVE_LIBVHD"
274 +           LIBS="$LIBS -lvhd"
275 +           case $target_os in
276 +           linux*)
277 +           LIBS="$LIBS -luuid"
278 +           esac
279 +           AC_CHECK_LIB(vhd, vhd_open)
280 +           AC_CHECK_LIB(vhd, vhd_io_read)
281 +           AC_CHECK_LIB(vhd, vhd_io_write)
282 +           AC_CHECK_LIB(vhd, vhd_close)
283 + ])
284 +
285 +
286 +
287   dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
288   HAVE_PTHREADS=yes
289   AC_CHECK_LIB(pthread, pthread_create, , [
# Line 250 | Line 344 | UISRCS=../dummy/prefs_editor_dummy.cpp
344   case "x$WANT_GTK" in
345   xgtk2*)
346    AM_PATH_GTK_2_0(1.3.15, [
347 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
348 <    CFLAGS="$CFLAGS $GTK_CFLAGS"
255 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
256 <    LIBS="$LIBS $GTK_LIBS"
257 <    UISRCS=prefs_editor_gtk.cpp
347 >    GUI_CFLAGS="$GTK_CFLAGS"
348 >    GUI_LIBS="$GTK_LIBS"
349      WANT_GTK=gtk2
350    ], [
351      case "x${WANT_GTK}x" in
# Line 272 | Line 363 | xgtk2*)
363   esac
364   if [[ "x$WANT_GTK" = "xgtk" ]]; then
365    AM_PATH_GTK(1.2.0, [
366 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
367 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
277 <    LIBS="$LIBS $GTK_LIBS"
278 <    UISRCS=prefs_editor_gtk.cpp
366 >    GUI_CFLAGS="$GTK_CFLAGS"
367 >    GUI_LIBS="$GTK_LIBS"
368      dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if
369      dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which
370      dnl includes <libintl.h>
371      AM_GNU_GETTEXT
372      B2_PATH_GNOMEUI([
373        AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.])
374 <      CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
375 <      LIBS="$LIBS $GNOMEUI_LIBS"
374 >      GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS"
375 >      GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS"
376      ], [])
377    ], [
378      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
379      WANT_GTK=no
380    ])
381   fi
382 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
383 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
384 +  UISRCS=prefs_editor_gtk.cpp
385 + fi
386 + AC_SUBST(GUI_CFLAGS)
387 + AC_SUBST(GUI_LIBS)
388 +
389 + dnl Build external GUI if requested.
390 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
391 +  WANT_STANDALONE_GUI=no
392 + fi
393 + if [[ "$WANT_GTK" = "no" ]]; then
394 +  WANT_STANDALONE_GUI=no
395 + fi
396 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
397  
398   dnl We use ESD if possible.
399   if [[ "x$WANT_ESD" = "xyes" ]]; then
# Line 325 | Line 429 | AC_CHECK_HEADERS(linux/if.h linux/if_tun
429   ])
430   AC_CHECK_HEADERS(AvailabilityMacros.h)
431   AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
432 + AC_CHECK_HEADERS(sys/stropts.h stropts.h)
433  
434   dnl Checks for typedefs, structures, and compiler characteristics.
435   AC_C_BIGENDIAN
# Line 399 | Line 504 | mips-sony-bsd|mips-sony-newsos4)
504   *-*-cygwin*)
505          no_dev_ptmx=1
506          ;;
507 + *-*-darwin*)
508 +        no_dev_ptmx=1
509 +        ;;
510   esac
511  
512   if test -z "$no_dev_ptmx" ; then
# Line 417 | Line 525 | AC_CHECK_FILE([/dev/ptc],
525                  have_dev_ptc=1
526          ]
527   )
420
528   dnl (end of code from openssh-3.2.2p1 configure.ac)
529  
530 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
531 + dnl doesn't work or is unimplemented. On these systems (mostly older
532 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
533 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
534 +  ac_cv_nonblocking_io, [
535 +  case "$host" in
536 +  *-*-osf*)
537 +    ac_cv_nonblocking_io=FIONBIO
538 +    ;;
539 +  *-*-sunos4*)
540 +    ac_cv_nonblocking_io=FIONBIO
541 +    ;;
542 +  *-*-ultrix*)
543 +    ac_cv_nonblocking_io=FIONBIO
544 +    ;;
545 +  *)
546 +    ac_cv_nonblocking_io=O_NONBLOCK
547 +    ;;
548 +  esac
549 + ])
550 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
551 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
552 + fi
553 +
554 + dnl Check whether compiler supports byte bit-fields
555 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
556 +  ac_cv_have_byte_bitfields, [
557 +  AC_LANG_SAVE
558 +  AC_LANG_CPLUSPLUS
559 +  AC_TRY_RUN([
560 +    struct A {
561 +      unsigned char b1:4;
562 +      unsigned char b2:4;
563 +      unsigned char c;
564 +      unsigned short s;
565 +      unsigned char a[4];
566 +    };
567 +
568 +    int main(void) {
569 +      A a;
570 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
571 +    }],
572 +    [ac_cv_have_byte_bitfields=yes],
573 +    [ac_cv_have_byte_bitfields=no],
574 +    dnl When cross-compiling, assume only GCC supports this
575 +    [if [[ "$GCC" = "yes" ]]; then
576 +      ac_cv_have_byte_bitfields="guessing yes"
577 +    else
578 +      ac_cv_have_byte_bitfields="guessing no"
579 +    fi]
580 +    )
581 +  AC_LANG_RESTORE
582 + ])
583  
584   dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
585   AC_DEFUN([AC_CHECK_FRAMEWORK], [
# Line 429 | Line 589 | AC_DEFUN([AC_CHECK_FRAMEWORK], [
589      saved_LIBS="$LIBS"
590      LIBS="$LIBS -framework $1"
591      AC_TRY_LINK(
592 <      [$2], [int main(void) { return 0; }],
592 >      [$2], [],
593        [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
594      )
595    ])
# Line 440 | Line 600 | AC_DEFUN([AC_CHECK_FRAMEWORK], [
600   ])
601  
602   dnl Check for some MacOS X frameworks
603 + AC_CHECK_FRAMEWORK(AppKit, [])
604   AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
605   AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
606   AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
# Line 490 | Line 651 | solaris*)
651    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
652    ;;
653   irix*)
493  ETHERSRC=ether_unix.cpp
654    AUDIOSRC=Irix/audio_irix.cpp
655    EXTRASYSSRCS=Irix/unaligned.c
496  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
497  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
656    LIBS="$LIBS -laudio"
657    WANT_ESD=no
658  
# Line 504 | Line 662 | irix*)
662    CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"`
663    AC_MSG_CHECKING(if "-IPA" works)
664    dnl Do a test compile of an empty function
665 <  AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
665 >  AC_TRY_COMPILE([#if defined __GNUC__
666 >                  # error GCC does not support IPA yet
667 >                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
668    CFLAGS="$ocflags"
669    ;;
670   darwin*)
# Line 513 | Line 673 | darwin*)
673      EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
674    fi
675    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
676 <    EXTFSSRC=../MacOSX/extfs_macosx.mm
676 >    EXTFSSRC=../MacOSX/extfs_macosx.cpp
677    fi
678    ;;
679   cygwin*)
# Line 523 | Line 683 | cygwin*)
683   esac
684  
685   dnl Is the slirp library supported?
686 < if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
686 > case "$ac_cv_have_byte_bitfields" in
687 > yes|"guessing yes")
688 >  CAN_SLIRP=yes
689 >  ETHERSRC=ether_unix.cpp
690 >  ;;
691 > esac
692 > if [[ -n "$CAN_SLIRP" ]]; then
693    AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
694    SLIRP_SRCS="\
695      ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
# Line 538 | Line 704 | AC_SUBST(SLIRP_SRCS)
704   dnl SDL overrides
705   if [[ "x$WANT_SDL" = "xyes" ]]; then
706    AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
707 +  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
708 +    EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m"
709 +  fi
710   fi
711   if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
712    AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
# Line 545 | Line 714 | if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; th
714    KEYCODES="../SDL/keycodes"
715    if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
716      EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
717 +    EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/utils_macosx.mm"
718 +    CPPFLAGS="$CPPFLAGS -I../MacOSX"
719    else
720      case "$target_os" in
721      cygwin*)
# Line 565 | Line 736 | if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; th
736    AUDIOSRC="../SDL/audio_sdl.cpp"
737   fi
738  
739 + dnl BINCUE overrides
740 +
741 + if [[ "x$have_bincue" = "xyes" ]]; then
742 +  EXTRASYSSRCS="$EXTRASYSSRCS bincue_unix.cpp"
743 + fi
744 +
745 + dnl libvhd overrides
746 +
747 + if [[ "x$have_libvhd" = "xyes" ]]; then
748 +  EXTRASYSSRCS="$EXTRASYSSRCS vhd_unix.cpp"
749 + fi
750 +
751 +
752   dnl Use 68k CPU natively?
753   WANT_NATIVE_M68K=no
754   if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
# Line 797 | Line 981 | AC_CACHE_CHECK([whether we can map Low M
981    ]
982   )
983  
800 dnl Check if we have POSIX shared memory support
801 AC_CACHE_CHECK([whether POSIX shared memory is working],
802  ac_cv_have_posix_shm, [
803  AC_LANG_SAVE
804  AC_LANG_CPLUSPLUS
805  AC_TRY_RUN([
806    #define HAVE_POSIX_SHM
807    #include "vm_alloc.cpp"
808    int main(void) { /* returns 0 if we have working POSIX shm */
809      if (vm_init() < 0) exit(2);
810      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
811      if (m1 == VM_MAP_FAILED) exit(3);
812      vm_exit(); exit(0);
813    }
814  ], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no,
815  dnl When cross-compiling, do not assume anything.
816  ac_cv_have_posix_shm="guessing no"
817  )
818  AC_LANG_RESTORE
819  ]
820 )
821 AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm",
822  [Define if your system supports POSIX shared memory.])
823
824 dnl Check if we have working 33-bit memory addressing
825 AC_CACHE_CHECK([whether 33-bit memory addressing is working],
826  ac_cv_have_33bit_addressing, [
827  AC_LANG_SAVE
828  AC_LANG_CPLUSPLUS
829  AC_TRY_RUN([
830    #define USE_33BIT_ADDRESSING 1
831    #include "vm_alloc.cpp"
832    int main(void) { /* returns 0 if we have working 33-bit addressing */
833      if (sizeof(void *) < 8) exit(1);
834      if (vm_init() < 0) exit(2);
835      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
836      if (m1 == VM_MAP_FAILED) exit(3);
837      char *m2 = m1 + (1L << 32);
838      m1[0] = 0x12; if (m2[0] != 0x12) exit(4);
839      m2[0] = 0x34; if (m1[0] != 0x34) exit(5);
840      vm_exit(); exit(0);
841    }
842  ], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no,
843  dnl When cross-compiling, do not assume anything.
844  ac_cv_have_33bit_addressing="guessing no"
845  )
846  AC_LANG_RESTORE
847  ]
848 )
849
984   dnl Check signal handlers need to be reinstalled
985   AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
986    ac_cv_signal_need_reinstall, [
# Line 914 | Line 1048 | AC_CACHE_CHECK([whether your system supp
1048    AC_LANG_SAVE
1049    AC_LANG_CPLUSPLUS
1050    AC_TRY_RUN([
1051 +    #define HAVE_UNISTD_H 1
1052 +    #define HAVE_MACH_VM 1
1053 +    #define HAVE_MACH_TASK_SELF 1
1054      #define HAVE_MACH_EXCEPTIONS 1
1055      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1056      #include "vm_alloc.cpp"
# Line 1036 | Line 1173 | fi
1173   dnl A dummy program that returns always true
1174   AC_PATH_PROG([BLESS], "true")
1175  
1176 + dnl Check for linker script support
1177 + case $target_os:$target_cpu in
1178 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1179 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1180 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1181 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1182 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1183 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1184 + esac
1185 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1186 +  AC_CACHE_CHECK([whether linker script is usable],
1187 +    ac_cv_linker_script_works, [
1188 +    AC_LANG_SAVE
1189 +    AC_LANG_CPLUSPLUS
1190 +    saved_LDFLAGS="$LDFLAGS"
1191 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1192 +    AC_TRY_RUN(
1193 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1194 +      [ac_cv_linker_script_works=yes],
1195 +      [ac_cv_linker_script_works=no],
1196 +      dnl When cross-compiling, assume it works
1197 +      [ac_cv_linker_script_works="guessing yes"]
1198 +    )
1199 +    AC_LANG_RESTORE
1200 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1201 +      LDFLAGS="$saved_LDFLAGS"
1202 +      LINKER_SCRIPT_FLAGS=""
1203 +    fi
1204 +  ])
1205 + fi
1206 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1207 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1208 +
1209   dnl Determine the addressing mode to use
1210   if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1211    ADDRESSING_MODE="real"
# Line 1194 | Line 1364 | if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1364    CFLAGS="$SAVED_CFLAGS"
1365   fi
1366  
1367 < dnl Add -mdynamic-no-pic for MacOS X
1368 < if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1367 > dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1368 > if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1369    SAVED_CFLAGS="$CFLAGS"
1370    CFLAGS="$CFLAGS -mdynamic-no-pic"
1371    AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
# Line 1235 | Line 1405 | elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HA
1405      DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1406      JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS"
1407      CAN_JIT=yes
1238    WANT_33BIT_ADDRESSING=yes
1408    fi
1409   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1410    dnl SPARC CPU
# Line 1292 | Line 1461 | else
1461    JITSRCS=""
1462   fi
1463  
1295 dnl Use 33-bit memory addressing?
1296 if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then
1297  use_33bit_addressing=yes
1298 fi
1299 AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing",
1300  [Define to use 33-bit memory addressing on 64-bit JIT capable systems.])
1301
1464   dnl Utility macro used by next two tests.
1465   dnl AC_EXAMINE_OBJECT(C source code,
1466   dnl     commands examining object file,
# Line 1523 | Line 1685 | echo
1685   echo Basilisk II configuration summary:
1686   echo
1687   echo SDL support ............................ : $SDL_SUPPORT
1688 + echo BINCUE support ......................... : $have_bincue
1689 + echo LIBVHD support ......................... : $have_libvhd
1690   echo XFree86 DGA support .................... : $WANT_XF86_DGA
1691   echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
1692   echo fbdev DGA support ...................... : $WANT_FBDEV_DGA

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines