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.20 by gbeauche, 2003-08-17T11:58:00Z 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(PACKAGE, PACKAGE_NAME, [Alias to PACKAGE for i18n.])
13 < AC_DEFINE(VERSION, PACKAGE_VERSION, [Alias to VERSION for i18n.])
12 > AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
13 > AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
14 >
15 > dnl Some systems do not put corefiles in the currect directory, avoid saving
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])
# Line 16 | Line 24 | AC_ARG_ENABLE(xf86-vidmode,  [  --enable
24   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])
25   AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
26  
27 + 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])
36   AC_ARG_ENABLE(jit-debug,     [  --enable-jit-debug      activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
# Line 51 | Line 66 | AC_ARG_ENABLE(addressing,
66  
67   dnl External packages.
68   AC_ARG_WITH(esd,             [  --with-esd              support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes])
69 < AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
69 > AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]],
70 >  [case "$withval" in
71 >   gtk1)      WANT_GTK="gtk";;
72 >   gtk|gtk2)  WANT_GTK="$withval";;
73 >   yes)       WANT_GTK="gtk2 gtk";;
74 >   *)         WANT_GTK="no";;
75 >   esac],
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 83 | 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 90 | Line 135 | AC_PROG_CPP
135   AC_PROG_CXX
136   AC_PROG_MAKE_SET
137   AC_PROG_INSTALL
138 + AC_PROG_EGREP
139  
140   dnl We use mon if possible.
141   MONSRCS=
# Line 99 | 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 118 | Line 164 | fi
164   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
202 + if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
203 +  WANT_SDL=yes
204 +  WANT_XF86_DGA=no
205 +  WANT_XF86_VIDMODE=no
206 +  WANT_FBDEV_DGA=no
207 +  SDL_SUPPORT="$SDL_SUPPORT video"
208 + fi
209 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
210 +  WANT_SDL=yes
211 +  SDL_SUPPORT="$SDL_SUPPORT audio"
212 + fi
213 + if [[ "x$WANT_SDL" = "xyes" ]]; then
214 +  if [[ "x$WANT_SDL_FRAMEWORK" = "xyes" ]]; then
215 +    AC_CHECK_SDLFRAMEWORK(SDL, [#include <SDL.h>])
216 +  else
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
246 +  SDL_SUPPORT="none"
247 + fi
248 +
249 + dnl We need X11, if not using SDL.
250 + if [[ "x$WANT_SDL" = "xno" ]]; then
251 +  AC_PATH_XTRA
252 +  if [[ "x$no_x" = "xyes" ]]; then
253 +    AC_MSG_ERROR([You need X11 to run Basilisk II.])
254 +  fi
255 +  CFLAGS="$CFLAGS $X_CFLAGS"
256 +  CXXFLAGS="$CXXFLAGS $X_CFLAGS"
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  
122 dnl We need X11.
123 AC_PATH_XTRA
124 if [[ "x$no_x" = "xyes" ]]; then
125  AC_MSG_ERROR([You need X11 to run Basilisk II.])
126 fi
127 CFLAGS="$CFLAGS $X_CFLAGS"
128 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
129 LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
286  
287   dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
288   HAVE_PTHREADS=yes
# Line 140 | Line 296 | AC_CHECK_LIB(pthread, pthread_create, ,
296   if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
297    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
298   fi
299 < AC_CHECK_FUNCS(pthread_cancel)
299 > AC_CHECK_FUNCS(pthread_cond_init)
300 > AC_CHECK_FUNCS(pthread_cancel pthread_testcancel)
301   AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
302   AC_CHECK_FUNCS(pthread_mutexattr_settype)
303   AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
# Line 184 | Line 341 | fi
341  
342   dnl We use GTK+ if possible.
343   UISRCS=../dummy/prefs_editor_dummy.cpp
344 < if [[ "x$WANT_GTK" = "xyes" ]]; then
344 > case "x$WANT_GTK" in
345 > xgtk2*)
346 >  AM_PATH_GTK_2_0(1.3.15, [
347 >    GUI_CFLAGS="$GTK_CFLAGS"
348 >    GUI_LIBS="$GTK_LIBS"
349 >    WANT_GTK=gtk2
350 >  ], [
351 >    case "x${WANT_GTK}x" in
352 >    *gtkx)
353 >      AC_MSG_WARN([Could not find GTK+ 2.0, trying with GTK+ 1.2.])
354 >      WANT_GTK=gtk
355 >      ;;
356 >    *)
357 >      AC_MSG_WARN([Could not find GTK+, disabling user interface.])
358 >      WANT_GTK=no
359 >      ;;
360 >    esac
361 >  ])
362 >  ;;
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"
191 <    LIBS="$LIBS $GTK_LIBS"
192 <    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 223 | Line 413 | AC_SYS_LARGEFILE
413  
414   dnl Checks for header files.
415   AC_HEADER_STDC
416 < AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h)
416 > AC_CHECK_HEADERS(stdlib.h stdint.h)
417 > AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
418   AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
419 + AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
420 + AC_CHECK_HEADERS(sys/poll.h sys/select.h)
421 + AC_CHECK_HEADERS(arpa/inet.h)
422 + AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
423 + #ifdef HAVE_SYS_TYPES_H
424 + #include <sys/types.h>
425 + #endif
426 + #ifdef HAVE_SYS_SOCKET_H
427 + #include <sys/socket.h>
428 + #endif
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 239 | Line 444 | AC_CHECK_SIZEOF(double, 8)
444   AC_CHECK_SIZEOF(long double, 12)
445   AC_CHECK_SIZEOF(void *, 4)
446   AC_TYPE_OFF_T
447 < AC_CHECK_TYPE(loff_t, off_t)
448 < AC_CHECK_TYPE(caddr_t, [char *])
447 > AC_CHECK_TYPES(loff_t)
448 > AC_CHECK_TYPES(caddr_t)
449   AC_TYPE_SIZE_T
450   AC_TYPE_SIGNAL
451   AC_HEADER_TIME
# Line 264 | Line 469 | if [[ "x$ac_cv_type_socklen_t" != "xyes"
469   fi
470  
471   dnl Checks for library functions.
472 < AC_CHECK_FUNCS(strdup cfmakeraw)
472 > AC_CHECK_FUNCS(strdup strerror cfmakeraw)
473   AC_CHECK_FUNCS(clock_gettime timer_create)
474   AC_CHECK_FUNCS(sigaction signal)
475   AC_CHECK_FUNCS(mmap mprotect munmap)
476   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
477 + AC_CHECK_FUNCS(poll inet_aton)
478  
479   dnl Darwin seems to define mach_task_self() instead of task_self().
480   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 295 | Line 501 | mips-sony-bsd|mips-sony-newsos4)
501   *-*-sco3.2v5*)
502          no_dev_ptmx=1
503          ;;
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 313 | Line 525 | AC_CHECK_FILE([/dev/ptc],
525                  have_dev_ptc=1
526          ]
527   )
316
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], [
586 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
587 +  AC_CACHE_CHECK([whether compiler supports framework $1],
588 +    ac_Framework, [
589 +    saved_LIBS="$LIBS"
590 +    LIBS="$LIBS -framework $1"
591 +    AC_TRY_LINK(
592 +      [$2], [],
593 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
594 +    )
595 +  ])
596 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
597 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
598 +  )
599 +  AS_VAR_POPDEF([ac_Framework])dnl
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>])
607  
608   dnl Select system-dependant source files.
609   SERIALSRC=serial_unix.cpp
610   ETHERSRC=../dummy/ether_dummy.cpp
611   SCSISRC=../dummy/scsi_dummy.cpp
612   AUDIOSRC=../dummy/audio_dummy.cpp
613 + EXTFSSRC=extfs_unix.cpp
614   EXTRASYSSRCS=
615   CAN_NATIVE_M68K=no
616   case "$target_os" in
# Line 355 | Line 644 | freebsd*)
644    ;;
645   netbsd*)
646    CAN_NATIVE_M68K=yes
647 +  ETHERSRC=ether_unix.cpp
648    ;;
649   solaris*)
650    AUDIOSRC=Solaris/audio_solaris.cpp
651    DEFINES="$DEFINES -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS"
652    ;;
653   irix*)
364  ETHERSRC=ether_unix.cpp
654    AUDIOSRC=Irix/audio_irix.cpp
655    EXTRASYSSRCS=Irix/unaligned.c
367  dnl IRIX headers work fine, but somehow don't define or use "STDC_HEADERS"
368  DEFINES="$DEFINES -DCRTSCTS=CNEW_RTSCTS -DB230400=B115200 -DSTDC_HEADERS"
656    LIBS="$LIBS -laudio"
657    WANT_ESD=no
658  
# Line 375 | 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*)
671 +  ETHERSRC=ether_unix.cpp
672 +  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
673 +    EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
674 +  fi
675 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
676 +    EXTFSSRC=../MacOSX/extfs_macosx.cpp
677 +  fi
678 +  ;;
679 + cygwin*)
680 +  SERIALSRC="../dummy/serial_dummy.cpp"
681 +  EXTRASYSSRCS="../Windows/BasiliskII.rc"
682 +  ;;
683 + esac
684  
685 + dnl Is the slirp library supported?
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  \
696 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
697 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
698 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
699 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
700 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
701 + fi
702 + AC_SUBST(SLIRP_SRCS)
703 +
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])
713 +  VIDEOSRCS="../SDL/video_sdl.cpp"
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*)
722 +      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
723 +      ;;
724 +    *)
725 +      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
726 +      ;;
727 +    esac
728 +  fi
729 + else
730 +  VIDEOSRCS="video_x.cpp"
731 +  KEYCODES="keycodes"
732 +  EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
733 + fi
734 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
735 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
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
# Line 395 | Line 763 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
763    ETHERSRC=../dummy/ether_dummy.cpp
764    AUDIOSRC=../dummy/audio_dummy.cpp
765   fi
766 < SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
766 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
767  
768   dnl Define a macro that translates a yesno-variable into a C macro definition
769   dnl to be put into the config.h file
770   dnl $1 -- the macro to define
771   dnl $2 -- the value to translate
772   dnl $3 -- template name
773 < AC_DEFUN(AC_TRANSLATE_DEFINE, [
773 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
774      if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
775          AC_DEFINE($1, 1, $3)
776      fi
777   ])
778  
779 + dnl Check that the host supports TUN/TAP devices
780 + AC_CACHE_CHECK([whether TUN/TAP is supported],
781 +  ac_cv_tun_tap_support, [
782 +  AC_TRY_COMPILE([
783 +    #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
784 +    #include <linux/if.h>
785 +    #include <linux/if_tun.h>
786 +    #endif
787 +    #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
788 +    #include <net/if.h>
789 +    #include <net/if_tun.h>
790 +    #endif
791 +  ], [
792 +    struct ifreq ifr;
793 +    memset(&ifr, 0, sizeof(ifr));
794 +    ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
795 +  ],
796 +  ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
797 +  )
798 + ])
799 + AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support",
800 +  [Define if your system supports TUN/TAP devices.])
801 +
802   dnl Various checks if the system supports vm_allocate() and the like functions.
803   have_mach_vm=no
804   if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
# Line 554 | Line 945 | AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_
945  
946   fi dnl HAVE_MMAP_VM
947  
948 + dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
949 + AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000],
950 +  ac_cv_pagezero_hack, [
951 +  ac_cv_pagezero_hack=no
952 +  if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then
953 +    ac_cv_pagezero_hack=yes
954 +    dnl might as well skip the test for mmap-able low memory
955 +    ac_cv_can_map_lm=no
956 +  fi
957 + ])
958 + AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
959 +  [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
960 +
961   dnl Check if we can mmap 0x2000 bytes from 0x0000
962   AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
963    ac_cv_can_map_lm, [
# Line 638 | Line 1042 | AC_CACHE_CHECK([whether sigaction handle
1042   AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
1043    [Define if your system requires sigactions to be reinstalled.])
1044  
1045 < dnl Check if extended signals are supported.
1046 < AC_CACHE_CHECK([whether your system supports extended signal handlers],
1047 <  ac_cv_have_extended_signals, [
1045 > dnl Check if Mach exceptions supported.
1046 > AC_CACHE_CHECK([whether your system supports Mach exceptions],
1047 >  ac_cv_have_mach_exceptions, [
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"
1057 >    #include "sigsegv.cpp"
1058 >  ], [
1059 >  sigsegv_recovery=mach
1060 >  ac_cv_have_mach_exceptions=yes
1061 >  ],
1062 >  ac_cv_have_mach_exceptions=no,
1063 >  dnl When cross-compiling, do not assume anything.
1064 >  ac_cv_have_mach_exceptions=no
1065 >  )
1066 >  AC_LANG_RESTORE
1067 >  ]
1068 > )
1069 > AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
1070 >  [Define if your system supports Mach exceptions.])
1071 >
1072 > dnl Check if Windows exceptions are supported.
1073 > AC_CACHE_CHECK([whether your system supports Windows exceptions],
1074 >  ac_cv_have_win32_exceptions, [
1075    AC_LANG_SAVE
1076    AC_LANG_CPLUSPLUS
1077    AC_TRY_RUN([
1078 <    #define HAVE_SIGINFO_T 1
1078 >    #define HAVE_WIN32_EXCEPTIONS 1
1079      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1080      #include "vm_alloc.cpp"
1081      #include "sigsegv.cpp"
1082 <  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
1082 >  ], [
1083 >  sigsegv_recovery=win32
1084 >  ac_cv_have_win32_exceptions=yes
1085 >  ],
1086 >  ac_cv_have_win32_exceptions=no,
1087    dnl When cross-compiling, do not assume anything.
1088 <  ac_cv_have_extended_signals=no
1088 >  ac_cv_have_win32_exceptions=no
1089    )
1090    AC_LANG_RESTORE
1091    ]
1092   )
1093 < AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
1094 <  [Define if your system support extended signals.])
1093 > AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
1094 >  [Define if your system supports Windows exceptions.])
1095 >
1096 > dnl Otherwise, check if extended signals are supported.
1097 > if [[ -z "$sigsegv_recovery" ]]; then
1098 >  AC_CACHE_CHECK([whether your system supports extended signal handlers],
1099 >    ac_cv_have_extended_signals, [
1100 >    AC_LANG_SAVE
1101 >    AC_LANG_CPLUSPLUS
1102 >    AC_TRY_RUN([
1103 >      #define HAVE_SIGINFO_T 1
1104 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1105 >      #include "vm_alloc.cpp"
1106 >      #include "sigsegv.cpp"
1107 >    ], [
1108 >    sigsegv_recovery=siginfo
1109 >    ac_cv_have_extended_signals=yes
1110 >    ],
1111 >    ac_cv_have_extended_signals=no,
1112 >    dnl When cross-compiling, do not assume anything.
1113 >    ac_cv_have_extended_signals=no
1114 >    )
1115 >    AC_LANG_RESTORE
1116 >    ]
1117 >  )
1118 >  AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
1119 >    [Define if your system support extended signals.])
1120 > fi
1121  
1122   dnl Otherwise, check for subterfuges.
1123 < if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
1123 > if [[ -z "$sigsegv_recovery" ]]; then
1124    AC_CACHE_CHECK([whether we then have a subterfuge for your system],
1125    ac_cv_have_sigcontext_hack, [
1126      AC_LANG_SAVE
# Line 669 | Line 1130 | if [[ "x$ac_cv_have_extended_signals" =
1130        #define CONFIGURE_TEST_SIGSEGV_RECOVERY
1131        #include "vm_alloc.cpp"
1132        #include "sigsegv.cpp"
1133 <    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
1133 >    ], [
1134 >    sigsegv_recovery=sigcontext
1135 >    ac_cv_have_sigcontext_hack=yes
1136 >    ],
1137 >    ac_cv_have_sigcontext_hack=no,
1138      dnl When cross-compiling, do not assume anything.
1139      ac_cv_have_sigcontext_hack=no
1140      )
# Line 701 | Line 1166 | AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_IN
1166  
1167   dnl Can we do Video on SEGV Signals ?
1168   CAN_VOSF=no
1169 < if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
1169 > if [[ -n "$sigsegv_recovery" ]]; then
1170    CAN_VOSF=yes
1171   fi
1172  
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 715 | Line 1216 | else
1216      case $am in
1217      real)
1218        dnl Requires ability to mmap() Low Memory globals
1219 <      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
1219 >      if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then
1220          continue
1221        fi
1222 <          dnl Requires VOSF screen updates
1222 >      dnl Requires VOSF screen updates
1223        if [[ "x$CAN_VOSF" = "xno" ]]; then
1224          continue
1225        fi
# Line 726 | Line 1227 | else
1227        ADDRESSING_MODE="real"
1228        WANT_VOSF=yes dnl we can use VOSF and we need it actually
1229        DEFINES="$DEFINES -DREAL_ADDRESSING"
1230 +      if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
1231 +        BLESS=Darwin/lowmem
1232 +        LDFLAGS="$LDFLAGS -pagezero_size 0x2000"
1233 +      fi
1234        break
1235        ;;
1236      direct)
# Line 778 | Line 1283 | AC_MSG_RESULT($HAVE_GAS)
1283   dnl Check for GCC 2.7 or higher.
1284   HAVE_GCC27=no
1285   AC_MSG_CHECKING(for GCC 2.7 or higher)
1286 < AC_EGREP_CPP(xyes,
1287 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1288 <  xyes
1289 < #endif
1290 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1286 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5)
1287 >                                     # error gcc < 2.7
1288 >                                     #endif
1289 >                                   ]])],
1290 >                  [AC_MSG_RESULT(yes); HAVE_GCC27=yes],
1291 >                  [AC_MSG_RESULT(no)])
1292  
1293   dnl Check for GCC 3.0 or higher.
1294   HAVE_GCC30=no
1295   AC_MSG_CHECKING(for GCC 3.0 or higher)
1296 < AC_EGREP_CPP(xyes,
1297 < [#if __GNUC__ >= 3
1298 <  xyes
1299 < #endif
1300 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1296 > AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#if ! (__GNUC__ >= 3)
1297 >                                     # error gcc < 3
1298 >                                     #endif
1299 >                                   ]])],
1300 >                  [AC_MSG_RESULT(yes); HAVE_GCC30=yes],
1301 >                  [AC_MSG_RESULT(no)])
1302 >
1303 > dnl Check for ICC.
1304 > AC_MSG_CHECKING(for ICC)
1305 > HAVE_ICC=no
1306 > if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1307 >  HAVE_ICC=yes
1308 > fi
1309 > AC_MSG_RESULT($HAVE_ICC)
1310  
1311   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1312   dnl Also set "-fno-exceptions" for C++ because exception handling requires
# Line 806 | Line 1321 | dnl As of 2001/08/02, this affects the f
1321   dnl Official: probably gcc-3.1 (mainline CVS)
1322   dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1323   dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1324 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1324 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1325    SAVED_CXXFLAGS="$CXXFLAGS"
1326    CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1327    AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
# Line 820 | Line 1335 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1335    fi
1336   fi
1337  
1338 + dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1339 + dnl However, there are some corner cases exposed on x86-64
1340 + if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1341 +  SAVED_CXXFLAGS="$CXXFLAGS"
1342 +  CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1343 +  AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
1344 +    AC_LANG_SAVE
1345 +    AC_LANG_CPLUSPLUS
1346 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no])
1347 +    AC_LANG_RESTORE
1348 +  ])
1349 +  if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then
1350 +    CXXFLAGS="$SAVED_CXXFLAGS"
1351 +  fi
1352 + fi
1353 +
1354 + dnl Add -fno-strict-aliasing for slirp sources
1355 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1356 +  SAVED_CFLAGS="$CFLAGS"
1357 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1358 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1359 +    ac_cv_gcc_no_strict_aliasing, [
1360 +    AC_TRY_COMPILE([],[],
1361 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1362 +      [ac_cv_gcc_no_strict_aliasing=no])
1363 +  ])
1364 +  CFLAGS="$SAVED_CFLAGS"
1365 + fi
1366 +
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],
1372 +    ac_cv_gcc_mdynamic_no_pic, [
1373 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_mdynamic_no_pic=yes],[ac_cv_gcc_mdynamic_no_pic=no])
1374 +  ])
1375 +  if [[ "x$ac_cv_gcc_mdynamic_no_pic" = "xyes" ]]; then
1376 +    CXXFLAGS="$CXXFLAGS -mdynamic-no-pic"
1377 +  else
1378 +    CFLAGS="$SAVED_CFLAGS"
1379 +  fi
1380 + fi
1381 +
1382   dnl Select appropriate CPU source and REGPARAM define.
1383   ASM_OPTIMIZATIONS=none
1384   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
# Line 844 | Line 1403 | elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HA
1403    if [[ "x$HAVE_GAS" = "xyes" ]]; then
1404      ASM_OPTIMIZATIONS="x86-64"
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
1408    fi
1409   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1410    dnl SPARC CPU
# Line 1097 | Line 1658 | fi
1658  
1659   dnl Remove the "-g" option if set for GCC.
1660   if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1661 <  CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'`
1662 <  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'`
1661 >  CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
1662 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
1663   fi
1664  
1665   dnl Or if we have -IPA (MIPSPro compilers)
# Line 1114 | Line 1675 | AC_SUBST(DEFINES)
1675   AC_SUBST(SYSSRCS)
1676   AC_SUBST(CPUINCLUDES)
1677   AC_SUBST(CPUSRCS)
1678 + AC_SUBST(BLESS)
1679 + AC_SUBST(KEYCODES)
1680   AC_CONFIG_FILES([Makefile])
1681   AC_OUTPUT
1682  
# Line 1121 | Line 1684 | dnl Print summary.
1684   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
# Line 1134 | Line 1700 | echo JIT debug mode ....................
1700   echo Floating-Point emulation core .......... : $FPE_CORE
1701   echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
1702   echo Addressing mode ........................ : $ADDRESSING_MODE
1703 + echo Bad memory access recovery type ........ : $sigsegv_recovery
1704   echo
1705   echo "Configuration done. Now type \"make\" (or \"gmake\")."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines