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.17 by cebix, 2003-07-25T13:45:25Z vs.
Revision 1.78 by asvitkine, 2010-07-28T01:07:45Z

# Line 6 | Line 6 | AC_CONFIG_SRCDIR(main_unix.cpp)
6   AC_PREREQ(2.52)
7   AC_CONFIG_HEADER(config.h)
8  
9 + dnl Aliases for PACKAGE and VERSION macros.
10 + AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
11 + AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
12 +
13 + dnl Some systems do not put corefiles in the currect directory, avoid saving
14 + dnl cores for the configure tests since some are intended to dump core.
15 + ulimit -c 0
16 +
17 + AC_ARG_ENABLE(standalone-gui,[  --enable-standalone-gui enable a standalone GUI prefs editor [default=no]], [WANT_STANDALONE_GUI=$enableval], [WANT_STANDALONE_GUI=no])
18 +
19   dnl Video options.
20   AC_ARG_ENABLE(xf86-dga,      [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
21   AC_ARG_ENABLE(xf86-vidmode,  [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
22   AC_ARG_ENABLE(fbdev-dga,     [  --enable-fbdev-dga      use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], [WANT_FBDEV_DGA=yes])
23   AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
24  
25 + dnl SDL options.
26 + AC_ARG_ENABLE(sdl-static,    [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
27 + AC_ARG_ENABLE(sdl-video,     [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
28 + AC_ARG_ENABLE(sdl-audio,     [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
29 + AC_ARG_ENABLE(sdl-framework,    [  --enable-sdl-framework  use SDL framework [default=no]], [WANT_SDL_FRAMEWORK=$enableval], [WANT_SDL_FRAMEWORK=no])
30 + AC_ARG_ENABLE(sdl-framework-prefix,    [  --enable-sdl-framework-prefix=PFX    default=/Library/Frameworks], [SDL_FRAMEWORK="$enableval"], [SDL_FRAMEWORK=/Library/Frameworks])
31 +
32   dnl JIT compiler options.
33   AC_ARG_ENABLE(jit-compiler,  [  --enable-jit-compiler   enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
34   AC_ARG_ENABLE(jit-debug,     [  --enable-jit-debug      activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
# Line 47 | Line 64 | AC_ARG_ENABLE(addressing,
64  
65   dnl External packages.
66   AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
67 < AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
67 > AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]],
68 >  [case "$withval" in
69 >   gtk1)      WANT_GTK="gtk";;
70 >   gtk|gtk2)  WANT_GTK="$withval";;
71 >   yes)       WANT_GTK="gtk2 gtk";;
72 >   *)         WANT_GTK="no";;
73 >   esac],
74 >  [WANT_GTK="gtk2 gtk"])
75   AC_ARG_WITH(mon,             [  --with-mon              use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes])
76  
77   dnl Canonical system information.
# Line 79 | Line 103 | case "$target_cpu" in
103    x86_64* ) HAVE_X86_64=yes;;
104   esac
105  
106 + dnl Check if we should really be assuming x86_64 even if we detected HAVE_I386 above.
107 + if [[ "x$HAVE_I386" = "xyes" ]]; then
108 +  AC_TRY_RUN([
109 +    int main(void) {
110 +        #if defined(__x86_64__)
111 +                return 0;
112 +        #else
113 +                return 1;
114 +        #endif
115 +    }
116 +  ], [
117 +    HAVE_I386=no
118 +    HAVE_X86_64=yes
119 +  ])
120 + fi
121 +
122 + dnl Check if we should really be assuming x86_64 even if we detected HAVE_I386 above.
123 + if [[ "x$HAVE_I386" = "xyes" ]]; then
124 +  AC_TRY_RUN([
125 +    int main(void) {
126 +        #if defined(__x86_64__)
127 +                return 0;
128 +        #else
129 +                return 1;
130 +        #endif
131 +    }
132 +  ], [
133 +    HAVE_I386=no
134 +    HAVE_X86_64=yes
135 +  ])
136 + fi
137 +
138   dnl Checks for programs.
139   AC_PROG_CC
140   AC_PROG_CC_C_O
# Line 86 | Line 142 | AC_PROG_CPP
142   AC_PROG_CXX
143   AC_PROG_MAKE_SET
144   AC_PROG_INSTALL
145 + AC_PROG_EGREP
146  
147   dnl We use mon if possible.
148   MONSRCS=
# Line 95 | Line 152 | if [[ "x$WANT_MON" = "xyes" ]]; then
152    if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then
153      AC_MSG_RESULT(yes)
154      AC_DEFINE(ENABLE_MON, 1, [Define if using "mon".])
155 <    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"
155 >    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"
156      CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass"
157      AC_CHECK_LIB(ncurses, tgetent, ,
158 <      AC_CHECK_LIB(termcap, tgetent, ,
159 <        AC_CHECK_LIB(termlib, tgetent, ,
160 <          AC_CHECK_LIB(terminfo, tgetent, ,
161 <            AC_CHECK_LIB(Hcurses, tgetent, ,
162 <              AC_CHECK_LIB(curses, tgetent))))))
158 >      [AC_CHECK_LIB(termcap, tgetent, ,
159 >        [AC_CHECK_LIB(termlib, tgetent, ,
160 >          [AC_CHECK_LIB(terminfo, tgetent, ,
161 >            [AC_CHECK_LIB(Hcurses, tgetent, ,
162 >              [AC_CHECK_LIB(curses, tgetent)])])])])])
163      AC_CHECK_LIB(readline, readline)
107    AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
164    else
165      AC_MSG_RESULT(no)
166      AC_MSG_WARN([Could not find mon, ignoring --with-mon.])
# Line 115 | Line 171 | fi
171   dnl Checks for libraries.
172   AC_CHECK_LIB(posix4, sem_init)
173   AC_CHECK_LIB(rt, timer_create)
174 + AC_CHECK_LIB(rt, shm_open)
175 + AC_CHECK_LIB(m, cos)
176 +
177 + dnl AC_CHECK_SDLFRAMEWORK($1=NAME, $2=INCLUDES)
178 + dnl AC_TRY_LINK uses main() but SDL needs main to take args,
179 + dnl therefore main is undefined with #undef.
180 + dnl Framework can be in an custom location.
181 + AC_DEFUN([AC_CHECK_SDLFRAMEWORK], [
182 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])
183 +  AC_CACHE_CHECK([whether compiler supports framework $1],
184 +    ac_Framework, [
185 +    saved_LIBS="$LIBS"
186 +    LIBS="$LIBS -framework $1"
187 +    if [[ "x$SDL_FRAMEWORK" != "x/Library/Frameworks" ]]; then
188 +      if [[ "x$SDL_FRAMEWORK" != "x/System/Library/Frameworks" ]]; then
189 +        LIBS="$saved_LIBS -F$SDL_FRAMEWORK -framework $1"
190 +      fi
191 +    fi
192 +    saved_CPPFLAGS="$CPPFLAGS"
193 +    CPPFLAGS="$CPPFLAGS -I$SDL_FRAMEWORK/SDL.framework/Headers"
194 +    AC_TRY_LINK(
195 +      [$2
196 + #undef main], [],
197 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no);
198 + LIBS="$saved_LIBS"; CPPFLAGS="$saved_CPPFLAGS"]
199 +    )
200 +  ])
201 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
202 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
203 +  )
204 +  AS_VAR_POPDEF([ac_Framework])
205 + ])
206  
207 < dnl We need X11.
208 < AC_PATH_XTRA
209 < if [[ "x$no_x" = "xyes" ]]; then
210 <  AC_MSG_ERROR([You need X11 to run Basilisk II.])
211 < fi
212 < CFLAGS="$CFLAGS $X_CFLAGS"
213 < CXXFLAGS="$CXXFLAGS $X_CFLAGS"
214 < LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
207 > dnl Do we need SDL?
208 > WANT_SDL=no
209 > if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
210 >  WANT_SDL=yes
211 >  WANT_XF86_DGA=no
212 >  WANT_XF86_VIDMODE=no
213 >  WANT_FBDEV_DGA=no
214 >  SDL_SUPPORT="$SDL_SUPPORT video"
215 > fi
216 > if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
217 >  WANT_SDL=yes
218 >  SDL_SUPPORT="$SDL_SUPPORT audio"
219 > fi
220 > if [[ "x$WANT_SDL" = "xyes" ]]; then
221 >  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
222 >    AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>])
223 >  else
224 >    ac_cv_framework_SDL=no
225 >  fi
226 >  if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
227 >    AC_PATH_PROG(sdl_config, "sdl-config")
228 >    if [[ -n "$sdl_config" ]]; then
229 >      case $target_os in
230 >      # Special treatment for Cygwin so that we can still use the POSIX layer
231 >      *cygwin*)
232 >        sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
233 >        sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
234 >        ;;
235 >      *)
236 >        sdl_cflags=`$sdl_config --cflags`
237 >        if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
238 >          sdl_libs=`$sdl_config --static-libs`
239 >        else
240 >          sdl_libs=`$sdl_config --libs`
241 >        fi
242 >        ;;
243 >      esac
244 >      CFLAGS="$CFLAGS $sdl_cflags"
245 >      CXXFLAGS="$CXXFLAGS $sdl_cflags"
246 >      LIBS="$LIBS $sdl_libs"
247 >    else
248 >      WANT_SDL=no
249 >    fi
250 >  fi
251 >  SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
252 > else
253 >  SDL_SUPPORT="none"
254 > fi
255 >
256 > dnl We need X11, if not using SDL.
257 > if [[ "x$WANT_SDL" = "xno" ]]; then
258 >  AC_PATH_XTRA
259 >  if [[ "x$no_x" = "xyes" ]]; then
260 >    AC_MSG_ERROR([You need X11 to run Basilisk II.])
261 >  fi
262 >  CFLAGS="$CFLAGS $X_CFLAGS"
263 >  CXXFLAGS="$CXXFLAGS $X_CFLAGS"
264 >  LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
265 > fi
266  
267   dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
268   HAVE_PTHREADS=yes
# Line 137 | Line 276 | AC_CHECK_LIB(pthread, pthread_create, ,
276   if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
277    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
278   fi
279 < AC_CHECK_FUNCS(pthread_cancel)
279 > AC_CHECK_FUNCS(pthread_cond_init)
280 > AC_CHECK_FUNCS(pthread_cancel pthread_testcancel)
281   AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
282   AC_CHECK_FUNCS(pthread_mutexattr_settype)
283   AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
# Line 181 | Line 321 | fi
321  
322   dnl We use GTK+ if possible.
323   UISRCS=../dummy/prefs_editor_dummy.cpp
324 < if [[ "x$WANT_GTK" = "xyes" ]]; then
324 > case "x$WANT_GTK" in
325 > xgtk2*)
326 >  AM_PATH_GTK_2_0(1.3.15, [
327 >    GUI_CFLAGS="$GTK_CFLAGS"
328 >    GUI_LIBS="$GTK_LIBS"
329 >    WANT_GTK=gtk2
330 >  ], [
331 >    case "x${WANT_GTK}x" in
332 >    *gtkx)
333 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
334 >      WANT_GTK=gtk
335 >      ;;
336 >    *)
337 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
338 >      WANT_GTK=no
339 >      ;;
340 >    esac
341 >  ])
342 >  ;;
343 > esac
344 > if [[ "x$WANT_GTK" = "xgtk" ]]; then
345    AM_PATH_GTK(1.2.0, [
346 <    AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
347 <    CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
348 <    LIBS="$LIBS $GTK_LIBS"
349 <    UISRCS=prefs_editor_gtk.cpp
346 >    GUI_CFLAGS="$GTK_CFLAGS"
347 >    GUI_LIBS="$GTK_LIBS"
348 >    dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if
349 >    dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which
350 >    dnl includes <libintl.h>
351 >    AM_GNU_GETTEXT
352      B2_PATH_GNOMEUI([
353        AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.])
354 <      CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
355 <      LIBS="$LIBS $GNOMEUI_LIBS"
354 >      GUI_CFLAGS="$GUI_CFLAGS $GNOMEUI_CFLAGS"
355 >      GUI_LIBS="$GUI_LIBS $GNOMEUI_LIBS"
356      ], [])
357    ], [
358      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
359      WANT_GTK=no
360    ])
361   fi
362 + if [[ "x$WANT_GTK" != "xno" -a "x$WANT_STANDALONE_GUI" = "xno" ]]; then
363 +  AC_DEFINE(ENABLE_GTK, 1, [Define if using GTK.])
364 +  UISRCS=prefs_editor_gtk.cpp
365 + fi
366 + AC_SUBST(GUI_CFLAGS)
367 + AC_SUBST(GUI_LIBS)
368 +
369 + dnl Build external GUI if requested.
370 + if [[ "$WANT_STANDALONE_GUI" != "yes" ]]; then
371 +  WANT_STANDALONE_GUI=no
372 + fi
373 + if [[ "$WANT_GTK" = "no" ]]; then
374 +  WANT_STANDALONE_GUI=no
375 + fi
376 + AC_SUBST(STANDALONE_GUI, [$WANT_STANDALONE_GUI])
377  
378   dnl We use ESD if possible.
379   if [[ "x$WANT_ESD" = "xyes" ]]; then
# Line 216 | Line 393 | AC_SYS_LARGEFILE
393  
394   dnl Checks for header files.
395   AC_HEADER_STDC
396 < AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h)
396 > AC_CHECK_HEADERS(stdlib.h stdint.h)
397 > AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
398 > AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
399 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
400 > AC_CHECK_HEADERS(sys/poll.h sys/select.h)
401 > AC_CHECK_HEADERS(arpa/inet.h)
402 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
403 > #ifdef HAVE_SYS_TYPES_H
404 > #include <sys/types.h>
405 > #endif
406 > #ifdef HAVE_SYS_SOCKET_H
407 > #include <sys/socket.h>
408 > #endif
409 > ])
410 > AC_CHECK_HEADERS(AvailabilityMacros.h)
411 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
412  
413   dnl Checks for typedefs, structures, and compiler characteristics.
414   AC_C_BIGENDIAN
# Line 231 | Line 423 | AC_CHECK_SIZEOF(double, 8)
423   AC_CHECK_SIZEOF(long double, 12)
424   AC_CHECK_SIZEOF(void *, 4)
425   AC_TYPE_OFF_T
426 < AC_CHECK_TYPE(loff_t, off_t)
427 < AC_CHECK_TYPE(caddr_t, [char *])
426 > AC_CHECK_TYPES(loff_t)
427 > AC_CHECK_TYPES(caddr_t)
428   AC_TYPE_SIZE_T
429   AC_TYPE_SIGNAL
430   AC_HEADER_TIME
# Line 256 | Line 448 | if [[ "x$ac_cv_type_socklen_t" != "xyes"
448   fi
449  
450   dnl Checks for library functions.
451 < AC_CHECK_FUNCS(strdup cfmakeraw)
451 > AC_CHECK_FUNCS(strdup strerror cfmakeraw)
452   AC_CHECK_FUNCS(clock_gettime timer_create)
453   AC_CHECK_FUNCS(sigaction signal)
454   AC_CHECK_FUNCS(mmap mprotect munmap)
455   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
456 + AC_CHECK_FUNCS(poll inet_aton)
457  
458   dnl Darwin seems to define mach_task_self() instead of task_self().
459   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 287 | Line 480 | mips-sony-bsd|mips-sony-newsos4)
480   *-*-sco3.2v5*)
481          no_dev_ptmx=1
482          ;;
483 + *-*-cygwin*)
484 +        no_dev_ptmx=1
485 +        ;;
486 + *-*-darwin*)
487 +        no_dev_ptmx=1
488 +        ;;
489   esac
490  
491   if test -z "$no_dev_ptmx" ; then
# Line 305 | Line 504 | AC_CHECK_FILE([/dev/ptc],
504                  have_dev_ptc=1
505          ]
506   )
308
507   dnl (end of code from openssh-3.2.2p1 configure.ac)
508  
509 + dnl Check for systems where POSIX-style non-blocking I/O (O_NONBLOCK)
510 + dnl doesn't work or is unimplemented. On these systems (mostly older
511 + dnl ones), use the old BSD-style FIONBIO approach instead. [tcl.m4]
512 + AC_CACHE_CHECK([FIONBIO vs. O_NONBLOCK for non-blocking I/O],
513 +  ac_cv_nonblocking_io, [
514 +  case "$host" in
515 +  *-*-osf*)
516 +    ac_cv_nonblocking_io=FIONBIO
517 +    ;;
518 +  *-*-sunos4*)
519 +    ac_cv_nonblocking_io=FIONBIO
520 +    ;;
521 +  *-*-ultrix*)
522 +    ac_cv_nonblocking_io=FIONBIO
523 +    ;;
524 +  *)
525 +    ac_cv_nonblocking_io=O_NONBLOCK
526 +    ;;
527 +  esac
528 + ])
529 + if [[ "$ac_cv_nonblocking_io" = "FIONBIO" ]]; then
530 +  AC_DEFINE(USE_FIONBIO, 1, [Define if BSD-style non-blocking I/O is to be used])
531 + fi
532 +
533 + dnl Check whether compiler supports byte bit-fields
534 + AC_CACHE_CHECK([whether compiler supports byte bit-fields],
535 +  ac_cv_have_byte_bitfields, [
536 +  AC_LANG_SAVE
537 +  AC_LANG_CPLUSPLUS
538 +  AC_TRY_RUN([
539 +    struct A {
540 +      unsigned char b1:4;
541 +      unsigned char b2:4;
542 +      unsigned char c;
543 +      unsigned short s;
544 +      unsigned char a[4];
545 +    };
546 +
547 +    int main(void) {
548 +      A a;
549 +      return ! (sizeof(A) == 8 && &a.c == ((unsigned char *)&a + 1));
550 +    }],
551 +    [ac_cv_have_byte_bitfields=yes],
552 +    [ac_cv_have_byte_bitfields=no],
553 +    dnl When cross-compiling, assume only GCC supports this
554 +    [if [[ "$GCC" = "yes" ]]; then
555 +      ac_cv_have_byte_bitfields="guessing yes"
556 +    else
557 +      ac_cv_have_byte_bitfields="guessing no"
558 +    fi]
559 +    )
560 +  AC_LANG_RESTORE
561 + ])
562 +
563 + dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
564 + AC_DEFUN([AC_CHECK_FRAMEWORK], [
565 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
566 +  AC_CACHE_CHECK([whether compiler supports framework $1],
567 +    ac_Framework, [
568 +    saved_LIBS="$LIBS"
569 +    LIBS="$LIBS -framework $1"
570 +    AC_TRY_LINK(
571 +      [$2], [],
572 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
573 +    )
574 +  ])
575 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
576 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
577 +  )
578 +  AS_VAR_POPDEF([ac_Framework])dnl
579 + ])
580 +
581 + dnl Check for some MacOS X frameworks
582 + AC_CHECK_FRAMEWORK(AppKit, [])
583 + AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
584 + AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
585 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
586  
587   dnl Select system-dependant source files.
588   SERIALSRC=serial_unix.cpp
589   ETHERSRC=../dummy/ether_dummy.cpp
590   SCSISRC=../dummy/scsi_dummy.cpp
591   AUDIOSRC=../dummy/audio_dummy.cpp
592 + EXTFSSRC=extfs_unix.cpp
593   EXTRASYSSRCS=
594   CAN_NATIVE_M68K=no
595   case "$target_os" in
# Line 347 | Line 623 | freebsd*)
623    ;;
624   netbsd*)
625    CAN_NATIVE_M68K=yes
626 +  ETHERSRC=ether_unix.cpp
627    ;;
628   solaris*)
629    AUDIOSRC=Solaris/audio_solaris.cpp
630    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
631    ;;
632   irix*)
356  ETHERSRC=ether_unix.cpp
633    AUDIOSRC=Irix/audio_irix.cpp
634    EXTRASYSSRCS=Irix/unaligned.c
359  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
360  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
635    LIBS="$LIBS -laudio"
636    WANT_ESD=no
637  
# Line 367 | Line 641 | irix*)
641    CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"`
642    AC_MSG_CHECKING(if "-IPA" works)
643    dnl Do a test compile of an empty function
644 <  AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
644 >  AC_TRY_COMPILE([#if defined __GNUC__
645 >                  # error GCC does not support IPA yet
646 >                  #endif],, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
647    CFLAGS="$ocflags"
648 +  ;;
649 + darwin*)
650 +  ETHERSRC=ether_unix.cpp
651 +  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
652 +    EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
653 +  fi
654 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
655 +    EXTFSSRC=../MacOSX/extfs_macosx.cpp
656 +  fi
657 +  ;;
658 + cygwin*)
659 +  SERIALSRC="../dummy/serial_dummy.cpp"
660 +  EXTRASYSSRCS="../Windows/BasiliskII.rc"
661 +  ;;
662 + esac
663  
664 + dnl Is the slirp library supported?
665 + case "$ac_cv_have_byte_bitfields" in
666 + yes|"guessing yes")
667 +  CAN_SLIRP=yes
668 +  ETHERSRC=ether_unix.cpp
669    ;;
670   esac
671 + if [[ -n "$CAN_SLIRP" ]]; then
672 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
673 +  SLIRP_SRCS="\
674 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
675 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
676 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
677 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
678 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
679 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
680 + fi
681 + AC_SUBST(SLIRP_SRCS)
682 +
683 + dnl SDL overrides
684 + if [[ "x$WANT_SDL" = "xyes" ]]; then
685 +  AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
686 +  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
687 +    EXTRASYSSRCS="$EXTRASYSSRCS ../SDL/SDLMain.m"
688 +  fi
689 + fi
690 + if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
691 +  AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
692 +  VIDEOSRCS="../SDL/video_sdl.cpp"
693 +  KEYCODES="../SDL/keycodes"
694 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
695 +    EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
696 +  else
697 +    case "$target_os" in
698 +    cygwin*)
699 +      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
700 +      ;;
701 +    *)
702 +      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
703 +      ;;
704 +    esac
705 +  fi
706 + else
707 +  VIDEOSRCS="video_x.cpp"
708 +  KEYCODES="keycodes"
709 +  EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
710 + fi
711 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
712 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
713 +  AUDIOSRC="../SDL/audio_sdl.cpp"
714 + fi
715  
716   dnl Use 68k CPU natively?
717   WANT_NATIVE_M68K=no
# Line 387 | Line 727 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
727    ETHERSRC=../dummy/ether_dummy.cpp
728    AUDIOSRC=../dummy/audio_dummy.cpp
729   fi
730 < SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
730 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $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
741   ])
742  
743 + dnl Check that the host supports TUN/TAP devices
744 + AC_CACHE_CHECK([whether TUN/TAP is supported],
745 +  ac_cv_tun_tap_support, [
746 +  AC_TRY_COMPILE([
747 +    #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
748 +    #include <linux/if.h>
749 +    #include <linux/if_tun.h>
750 +    #endif
751 +    #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
752 +    #include <net/if.h>
753 +    #include <net/if_tun.h>
754 +    #endif
755 +  ], [
756 +    struct ifreq ifr;
757 +    memset(&ifr, 0, sizeof(ifr));
758 +    ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
759 +  ],
760 +  ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
761 +  )
762 + ])
763 + AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support",
764 +  [Define if your system supports TUN/TAP devices.])
765 +
766   dnl Various checks if the system supports vm_allocate() and the like functions.
767   have_mach_vm=no
768   if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
# Line 546 | Line 909 | AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_
909  
910   fi dnl HAVE_MMAP_VM
911  
912 + dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
913 + AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000],
914 +  ac_cv_pagezero_hack, [
915 +  ac_cv_pagezero_hack=no
916 +  if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then
917 +    ac_cv_pagezero_hack=yes
918 +    dnl might as well skip the test for mmap-able low memory
919 +    ac_cv_can_map_lm=no
920 +  fi
921 + ])
922 + AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
923 +  [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
924 +
925   dnl Check if we can mmap 0x2000 bytes from 0x0000
926   AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
927    ac_cv_can_map_lm, [
# Line 630 | Line 1006 | AC_CACHE_CHECK([whether sigaction handle
1006   AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
1007    [Define if your system requires sigactions to be reinstalled.])
1008  
1009 < dnl Check if extended signals are supported.
1010 < AC_CACHE_CHECK([whether your system supports extended signal handlers],
1011 <  ac_cv_have_extended_signals, [
1009 > dnl Check if Mach exceptions supported.
1010 > AC_CACHE_CHECK([whether your system supports Mach exceptions],
1011 >  ac_cv_have_mach_exceptions, [
1012    AC_LANG_SAVE
1013    AC_LANG_CPLUSPLUS
1014    AC_TRY_RUN([
1015 <    #define HAVE_SIGINFO_T 1
1015 >    #define HAVE_MACH_VM 1
1016 >    #define HAVE_MACH_TASK_SELF 1
1017 >    #define HAVE_MACH_EXCEPTIONS 1
1018      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1019      #include "vm_alloc.cpp"
1020      #include "sigsegv.cpp"
1021 <  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
1021 >  ], [
1022 >  sigsegv_recovery=mach
1023 >  ac_cv_have_mach_exceptions=yes
1024 >  ],
1025 >  ac_cv_have_mach_exceptions=no,
1026 >  dnl When cross-compiling, do not assume anything.
1027 >  ac_cv_have_mach_exceptions=no
1028 >  )
1029 >  AC_LANG_RESTORE
1030 >  ]
1031 > )
1032 > AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
1033 >  [Define if your system supports Mach exceptions.])
1034 >
1035 > dnl Check if Windows exceptions are supported.
1036 > AC_CACHE_CHECK([whether your system supports Windows exceptions],
1037 >  ac_cv_have_win32_exceptions, [
1038 >  AC_LANG_SAVE
1039 >  AC_LANG_CPLUSPLUS
1040 >  AC_TRY_RUN([
1041 >    #define HAVE_WIN32_EXCEPTIONS 1
1042 >    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1043 >    #include "vm_alloc.cpp"
1044 >    #include "sigsegv.cpp"
1045 >  ], [
1046 >  sigsegv_recovery=win32
1047 >  ac_cv_have_win32_exceptions=yes
1048 >  ],
1049 >  ac_cv_have_win32_exceptions=no,
1050    dnl When cross-compiling, do not assume anything.
1051 <  ac_cv_have_extended_signals=no
1051 >  ac_cv_have_win32_exceptions=no
1052    )
1053    AC_LANG_RESTORE
1054    ]
1055   )
1056 < AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
1057 <  [Define if your system support extended signals.])
1056 > AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
1057 >  [Define if your system supports Windows exceptions.])
1058 >
1059 > dnl Otherwise, check if extended signals are supported.
1060 > if [[ -z "$sigsegv_recovery" ]]; then
1061 >  AC_CACHE_CHECK([whether your system supports extended signal handlers],
1062 >    ac_cv_have_extended_signals, [
1063 >    AC_LANG_SAVE
1064 >    AC_LANG_CPLUSPLUS
1065 >    AC_TRY_RUN([
1066 >      #define HAVE_SIGINFO_T 1
1067 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1068 >      #include "vm_alloc.cpp"
1069 >      #include "sigsegv.cpp"
1070 >    ], [
1071 >    sigsegv_recovery=siginfo
1072 >    ac_cv_have_extended_signals=yes
1073 >    ],
1074 >    ac_cv_have_extended_signals=no,
1075 >    dnl When cross-compiling, do not assume anything.
1076 >    ac_cv_have_extended_signals=no
1077 >    )
1078 >    AC_LANG_RESTORE
1079 >    ]
1080 >  )
1081 >  AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
1082 >    [Define if your system support extended signals.])
1083 > fi
1084  
1085   dnl Otherwise, check for subterfuges.
1086 < if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
1086 > if [[ -z "$sigsegv_recovery" ]]; then
1087    AC_CACHE_CHECK([whether we then have a subterfuge for your system],
1088    ac_cv_have_sigcontext_hack, [
1089      AC_LANG_SAVE
# Line 661 | Line 1093 | if [[ "x$ac_cv_have_extended_signals" =
1093        #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1094        #include "vm_alloc.cpp"
1095        #include "sigsegv.cpp"
1096 <    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
1096 >    ], [
1097 >    sigsegv_recovery=sigcontext
1098 >    ac_cv_have_sigcontext_hack=yes
1099 >    ],
1100 >    ac_cv_have_sigcontext_hack=no,
1101      dnl When cross-compiling, do not assume anything.
1102      ac_cv_have_sigcontext_hack=no
1103      )
# Line 693 | Line 1129 | AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_IN
1129  
1130   dnl Can we do Video on SEGV Signals ?
1131   CAN_VOSF=no
1132 < if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
1132 > if [[ -n "$sigsegv_recovery" ]]; then
1133    CAN_VOSF=yes
1134   fi
1135  
1136 + dnl A dummy program that returns always true
1137 + AC_PATH_PROG([BLESS], "true")
1138 +
1139 + dnl Check for linker script support
1140 + case $target_os:$target_cpu in
1141 + linux*:i?86)    LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1142 + linux*:x86_64)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-x86_64.ld";;
1143 + linux*:powerpc) LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-ppc.ld";;
1144 + netbsd*:i?86)   LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/linux-i386.ld";;
1145 + freebsd*:i?86)  LINKER_SCRIPT_FLAGS="-Wl,-T,ldscripts/freebsd-i386.ld";;
1146 + darwin*:*)      LINKER_SCRIPT_FLAGS="-Wl,-seg1addr,0x78048000";;
1147 + esac
1148 + if [[ -n "$LINKER_SCRIPT_FLAGS" ]]; then
1149 +  AC_CACHE_CHECK([whether linker script is usable],
1150 +    ac_cv_linker_script_works, [
1151 +    AC_LANG_SAVE
1152 +    AC_LANG_CPLUSPLUS
1153 +    saved_LDFLAGS="$LDFLAGS"
1154 +    LDFLAGS="$LDFLAGS $LINKER_SCRIPT_FLAGS"
1155 +    AC_TRY_RUN(
1156 +      [int main() {if ((char *)&main < (char *)0x70000000) return 1;}],
1157 +      [ac_cv_linker_script_works=yes],
1158 +      [ac_cv_linker_script_works=no],
1159 +      dnl When cross-compiling, assume it works
1160 +      [ac_cv_linker_script_works="guessing yes"]
1161 +    )
1162 +    AC_LANG_RESTORE
1163 +    if [[ "$ac_cv_linker_script_works" = "no" ]]; then
1164 +      LDFLAGS="$saved_LDFLAGS"
1165 +      LINKER_SCRIPT_FLAGS=""
1166 +    fi
1167 +  ])
1168 + fi
1169 + AC_TRANSLATE_DEFINE(HAVE_LINKER_SCRIPT, "$ac_cv_linker_script_works",
1170 +  [Define if there is a linker script to relocate the executable above 0x70000000.])
1171 +
1172   dnl Determine the addressing mode to use
1173   if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1174    ADDRESSING_MODE="real"
# Line 707 | Line 1179 | else
1179      case $am in
1180      real)
1181        dnl Requires ability to mmap() Low Memory globals
1182 <      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
1182 >      if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then
1183          continue
1184        fi
1185 <          dnl Requires VOSF screen updates
1185 >      dnl Requires VOSF screen updates
1186        if [[ "x$CAN_VOSF" = "xno" ]]; then
1187          continue
1188        fi
# Line 718 | Line 1190 | else
1190        ADDRESSING_MODE="real"
1191        WANT_VOSF=yes dnl we can use VOSF and we need it actually
1192        DEFINES="$DEFINES -DREAL_ADDRESSING"
1193 +      if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
1194 +        BLESS=Darwin/lowmem
1195 +        LDFLAGS="$LDFLAGS -pagezero_size 0x2000"
1196 +      fi
1197        break
1198        ;;
1199      direct)
# Line 770 | Line 1246 | AC_MSG_RESULT($HAVE_GAS)
1246   dnl Check for GCC 2.7 or higher.
1247   HAVE_GCC27=no
1248   AC_MSG_CHECKING(for GCC 2.7 or higher)
1249 < AC_EGREP_CPP(xyes,
1250 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1251 <  xyes
1252 < #endif
1253 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1249 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1250 >                                     # error gcc < 2.7
1251 >                                     #endif
1252 >                                   ]])],
1253 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1254 >                  [AC_MSG_RESULT(no)])
1255  
1256   dnl Check for GCC 3.0 or higher.
1257   HAVE_GCC30=no
1258   AC_MSG_CHECKING(for GCC 3.0 or higher)
1259 < AC_EGREP_CPP(xyes,
1260 < [#if __GNUC__ >= 3
1261 <  xyes
1262 < #endif
1263 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1259 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1260 >                                     # error gcc < 3
1261 >                                     #endif
1262 >                                   ]])],
1263 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1264 >                  [AC_MSG_RESULT(no)])
1265 >
1266 > dnl Check for ICC.
1267 > AC_MSG_CHECKING(for ICC)
1268 > HAVE_ICC=no
1269 > if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1270 >  HAVE_ICC=yes
1271 > fi
1272 > AC_MSG_RESULT($HAVE_ICC)
1273  
1274   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1275   dnl Also set "-fno-exceptions" for C++ because exception handling requires
# Line 798 | Line 1284 | dnl As of 2001/08/02, this affects the f
1284   dnl Official: probably gcc-3.1 (mainline CVS)
1285   dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1286   dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1287 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1287 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1288    SAVED_CXXFLAGS="$CXXFLAGS"
1289    CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1290    AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
# Line 812 | Line 1298 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1298    fi
1299   fi
1300  
1301 + dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1302 + dnl However, there are some corner cases exposed on x86-64
1303 + if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1304 +  SAVED_CXXFLAGS="$CXXFLAGS"
1305 +  CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1306 +  AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
1307 +    AC_LANG_SAVE
1308 +    AC_LANG_CPLUSPLUS
1309 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no])
1310 +    AC_LANG_RESTORE
1311 +  ])
1312 +  if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then
1313 +    CXXFLAGS="$SAVED_CXXFLAGS"
1314 +  fi
1315 + fi
1316 +
1317 + dnl Add -fno-strict-aliasing for slirp sources
1318 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1319 +  SAVED_CFLAGS="$CFLAGS"
1320 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1321 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1322 +    ac_cv_gcc_no_strict_aliasing, [
1323 +    AC_TRY_COMPILE([],[],
1324 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1325 +      [ac_cv_gcc_no_strict_aliasing=no])
1326 +  ])
1327 +  CFLAGS="$SAVED_CFLAGS"
1328 + fi
1329 +
1330 + dnl Add -mdynamic-no-pic for MacOS X (XXX icc10 will support MacOS X)
1331 + if [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1332 +  SAVED_CFLAGS="$CFLAGS"
1333 +  CFLAGS="$CFLAGS -mdynamic-no-pic"
1334 +  AC_CACHE_CHECK([whether the compiler supports -mdynamic-no-pic],
1335 +    ac_cv_gcc_mdynamic_no_pic, [
1336 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1337 +  ])
1338 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1339 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1340 +  else
1341 +    CFLAGS="$SAVED_CFLAGS"
1342 +  fi
1343 + fi
1344 +
1345   dnl Select appropriate CPU source and REGPARAM define.
1346   ASM_OPTIMIZATIONS=none
1347   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
# Line 826 | Line 1356 | if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE
1356    DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\""
1357    if [[ "x$HAVE_GAS" = "xyes" ]]; then
1358      ASM_OPTIMIZATIONS=i386
1359 <    DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE"
1359 >    DEFINES="-m32 $DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE"
1360      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"
1361      CAN_JIT=yes
1362    fi
# Line 835 | Line 1365 | elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HA
1365    DEFINES="$DEFINES -DUNALIGNED_PROFITABLE"
1366    if [[ "x$HAVE_GAS" = "xyes" ]]; then
1367      ASM_OPTIMIZATIONS="x86-64"
1368 <    DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1368 >    DEFINES="-m64 $DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1369 >    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"
1370 >    CAN_JIT=yes
1371    fi
1372   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1373    dnl SPARC CPU
# Line 1089 | Line 1621 | fi
1621  
1622   dnl Remove the "-g" option if set for GCC.
1623   if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1624 <  CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'`
1625 <  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'`
1624 >  CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
1625 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
1626   fi
1627  
1628   dnl Or if we have -IPA (MIPSPro compilers)
# Line 1106 | Line 1638 | AC_SUBST(DEFINES)
1638   AC_SUBST(SYSSRCS)
1639   AC_SUBST(CPUINCLUDES)
1640   AC_SUBST(CPUSRCS)
1641 + AC_SUBST(BLESS)
1642 + AC_SUBST(KEYCODES)
1643   AC_CONFIG_FILES([Makefile])
1644   AC_OUTPUT
1645  
# Line 1113 | Line 1647 | dnl Print summary.
1647   echo
1648   echo Basilisk II configuration summary:
1649   echo
1650 + echo SDL support ............................ : $SDL_SUPPORT
1651   echo XFree86 DGA support .................... : $WANT_XF86_DGA
1652   echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
1653   echo fbdev DGA support ...................... : $WANT_FBDEV_DGA
# Line 1126 | Line 1661 | echo JIT debug mode ....................
1661   echo Floating-Point emulation core .......... : $FPE_CORE
1662   echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
1663   echo Addressing mode ........................ : $ADDRESSING_MODE
1664 + echo Bad memory access recovery type ........ : $sigsegv_recovery
1665   echo
1666   echo "Configuration done. Now type \"make\" (or \"gmake\")."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines