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.48 by gbeauche, 2005-06-12T23:36:34Z

# 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   dnl Video options.
18   AC_ARG_ENABLE(xf86-dga,      [  --enable-xf86-dga       use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes])
19   AC_ARG_ENABLE(xf86-vidmode,  [  --enable-xf86-vidmode   use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes])
20   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])
21   AC_ARG_ENABLE(vosf,          [  --enable-vosf           enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes])
22  
23 + dnl SDL options.
24 + AC_ARG_ENABLE(sdl-static,    [  --enable-sdl-static     use SDL static libraries for linking [default=no]], [WANT_SDL_STATIC=$enableval], [WANT_SDL_STATIC=no])
25 + AC_ARG_ENABLE(sdl-video,     [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
26 + AC_ARG_ENABLE(sdl-audio,     [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
27 +
28   dnl JIT compiler options.
29   AC_ARG_ENABLE(jit-compiler,  [  --enable-jit-compiler   enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
30   AC_ARG_ENABLE(jit-debug,     [  --enable-jit-debug      activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
# Line 86 | Line 99 | AC_PROG_CPP
99   AC_PROG_CXX
100   AC_PROG_MAKE_SET
101   AC_PROG_INSTALL
102 + AC_PROG_EGREP
103  
104   dnl We use mon if possible.
105   MONSRCS=
# Line 104 | Line 118 | if [[ "x$WANT_MON" = "xyes" ]]; then
118              AC_CHECK_LIB(Hcurses, tgetent, ,
119                AC_CHECK_LIB(curses, tgetent))))))
120      AC_CHECK_LIB(readline, readline)
107    AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
121    else
122      AC_MSG_RESULT(no)
123      AC_MSG_WARN([Could not find mon, ignoring --with-mon.])
# Line 115 | Line 128 | fi
128   dnl Checks for libraries.
129   AC_CHECK_LIB(posix4, sem_init)
130   AC_CHECK_LIB(rt, timer_create)
131 + AC_CHECK_LIB(rt, shm_open)
132 +
133 + dnl Do we need SDL?
134 + WANT_SDL=no
135 + if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
136 +  WANT_SDL=yes
137 +  WANT_XF86_DGA=no
138 +  WANT_XF86_VIDMODE=no
139 +  WANT_FBDEV_DGA=no
140 +  SDL_SUPPORT="$SDL_SUPPORT video"
141 + fi
142 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
143 +  WANT_SDL=yes
144 +  SDL_SUPPORT="$SDL_SUPPORT audio"
145 + fi
146 + if [[ "x$WANT_SDL" = "xyes" ]]; then
147 +  AC_PATH_PROG(sdl_config, "sdl-config")
148 +  if [[ -n "$sdl_config" ]]; then
149 +    case $target_os in
150 +    # Special treatment for Cygwin so that we can still use the POSIX layer
151 +    *cygwin*)
152 +      sdl_cflags="-I`$sdl_config --prefix`/include/SDL"
153 +      sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL"
154 +      ;;
155 +    *)
156 +      sdl_cflags=`$sdl_config --cflags`
157 +      if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
158 +        sdl_libs=`$sdl_config --static-libs`
159 +      else
160 +        sdl_libs=`$sdl_config --libs`
161 +      fi
162 +      ;;
163 +    esac
164 +    CFLAGS="$CFLAGS $sdl_cflags"
165 +    CXXFLAGS="$CXXFLAGS $sdl_cflags"
166 +    LIBS="$LIBS $sdl_libs"
167 +  else
168 +    WANT_SDL=no
169 +  fi
170 +  SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
171 + else
172 +  SDL_SUPPORT="none"
173 + fi
174  
175 < dnl We need X11.
176 < AC_PATH_XTRA
177 < if [[ "x$no_x" = "xyes" ]]; then
178 <  AC_MSG_ERROR([You need X11 to run Basilisk II.])
179 < fi
180 < CFLAGS="$CFLAGS $X_CFLAGS"
181 < CXXFLAGS="$CXXFLAGS $X_CFLAGS"
182 < LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
175 > dnl We need X11, if not using SDL.
176 > if [[ "x$WANT_SDL" = "xno" ]]; then
177 >  AC_PATH_XTRA
178 >  if [[ "x$no_x" = "xyes" ]]; then
179 >    AC_MSG_ERROR([You need X11 to run Basilisk II.])
180 >  fi
181 >  CFLAGS="$CFLAGS $X_CFLAGS"
182 >  CXXFLAGS="$CXXFLAGS $X_CFLAGS"
183 >  LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
184 > fi
185  
186   dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
187   HAVE_PTHREADS=yes
# Line 137 | Line 195 | AC_CHECK_LIB(pthread, pthread_create, ,
195   if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
196    AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
197   fi
198 < AC_CHECK_FUNCS(pthread_cancel)
198 > AC_CHECK_FUNCS(pthread_cancel pthread_testcancel)
199   AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
200   AC_CHECK_FUNCS(pthread_mutexattr_settype)
201   AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
# Line 187 | Line 245 | if [[ "x$WANT_GTK" = "xyes" ]]; then
245      CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
246      LIBS="$LIBS $GTK_LIBS"
247      UISRCS=prefs_editor_gtk.cpp
248 +    dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if
249 +    dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which
250 +    dnl includes <libintl.h>
251 +    AM_GNU_GETTEXT
252      B2_PATH_GNOMEUI([
253        AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.])
254        CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
# Line 216 | Line 278 | AC_SYS_LARGEFILE
278  
279   dnl Checks for header files.
280   AC_HEADER_STDC
281 < AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h)
281 > AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
282 > AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
283 > AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h)
284 > AC_CHECK_HEADERS(sys/poll.h sys/select.h)
285 > AC_CHECK_HEADERS(arpa/inet.h)
286 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [
287 > #ifdef HAVE_SYS_TYPES_H
288 > #include <sys/types.h>
289 > #endif
290 > #ifdef HAVE_SYS_SOCKET_H
291 > #include <sys/socket.h>
292 > #endif
293 > ])
294 > AC_CHECK_HEADERS(AvailabilityMacros.h)
295 > AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDevice.h)
296  
297   dnl Checks for typedefs, structures, and compiler characteristics.
298   AC_C_BIGENDIAN
# Line 231 | Line 307 | AC_CHECK_SIZEOF(double, 8)
307   AC_CHECK_SIZEOF(long double, 12)
308   AC_CHECK_SIZEOF(void *, 4)
309   AC_TYPE_OFF_T
310 < AC_CHECK_TYPE(loff_t, off_t)
311 < AC_CHECK_TYPE(caddr_t, [char *])
310 > AC_CHECK_TYPES(loff_t)
311 > AC_CHECK_TYPES(caddr_t)
312   AC_TYPE_SIZE_T
313   AC_TYPE_SIGNAL
314   AC_HEADER_TIME
# Line 256 | Line 332 | if [[ "x$ac_cv_type_socklen_t" != "xyes"
332   fi
333  
334   dnl Checks for library functions.
335 < AC_CHECK_FUNCS(strdup cfmakeraw)
335 > AC_CHECK_FUNCS(strdup strerror cfmakeraw)
336   AC_CHECK_FUNCS(clock_gettime timer_create)
337   AC_CHECK_FUNCS(sigaction signal)
338   AC_CHECK_FUNCS(mmap mprotect munmap)
339   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
340 + AC_CHECK_FUNCS(poll inet_aton)
341  
342   dnl Darwin seems to define mach_task_self() instead of task_self().
343   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 287 | Line 364 | mips-sony-bsd|mips-sony-newsos4)
364   *-*-sco3.2v5*)
365          no_dev_ptmx=1
366          ;;
367 + *-*-cygwin*)
368 +        no_dev_ptmx=1
369 +        ;;
370   esac
371  
372   if test -z "$no_dev_ptmx" ; then
# Line 309 | Line 389 | AC_CHECK_FILE([/dev/ptc],
389   dnl (end of code from openssh-3.2.2p1 configure.ac)
390  
391  
392 + dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
393 + AC_DEFUN(AC_CHECK_FRAMEWORK, [
394 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
395 +  AC_CACHE_CHECK([whether compiler supports framework $1],
396 +    ac_Framework, [
397 +    saved_LIBS="$LIBS"
398 +    LIBS="$LIBS -framework $1"
399 +    AC_TRY_LINK(
400 +      [$2], [int main(void) { return 0; }],
401 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
402 +    )
403 +  ])
404 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
405 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
406 +  )
407 +  AS_VAR_POPDEF([ac_Framework])dnl
408 + ])
409 +
410 + dnl Check for some MacOS X frameworks
411 + AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
412 + AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
413 + AC_CHECK_FRAMEWORK(CoreFoundation, [#include <CoreFoundation/CoreFoundation.h>])
414 +
415   dnl Select system-dependant source files.
416   SERIALSRC=serial_unix.cpp
417   ETHERSRC=../dummy/ether_dummy.cpp
418   SCSISRC=../dummy/scsi_dummy.cpp
419   AUDIOSRC=../dummy/audio_dummy.cpp
420 + EXTFSSRC=extfs_unix.cpp
421   EXTRASYSSRCS=
422   CAN_NATIVE_M68K=no
423   case "$target_os" in
# Line 347 | Line 451 | freebsd*)
451    ;;
452   netbsd*)
453    CAN_NATIVE_M68K=yes
454 +  ETHERSRC=ether_unix.cpp
455    ;;
456   solaris*)
457    AUDIOSRC=Solaris/audio_solaris.cpp
# Line 369 | Line 474 | irix*)
474    dnl Do a test compile of an empty function
475    AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
476    CFLAGS="$ocflags"
477 <
477 >  ;;
478 > darwin*)
479 >  ETHERSRC=ether_unix.cpp
480 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" -a "x$ac_cv_framework_CoreFoundation" = "xyes" ]]; then
481 >    EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
482 >  fi
483 >  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
484 >    EXTFSSRC=../MacOSX/extfs_macosx.mm
485 >  fi
486 >  ;;
487 > cygwin*)
488 >  SERIALSRC="../dummy/serial_dummy.cpp"
489 >  EXTRASYSSRCS="../Windows/BasiliskII.rc"
490    ;;
491   esac
492  
493 + dnl Is the slirp library supported?
494 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
495 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
496 +  SLIRP_SRCS="\
497 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
498 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
499 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
500 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
501 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
502 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
503 + fi
504 + AC_SUBST(SLIRP_SRCS)
505 +
506 + dnl SDL overrides
507 + if [[ "x$WANT_SDL" = "xyes" ]]; then
508 +  AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
509 + fi
510 + if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
511 +  AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
512 +  VIDEOSRCS="../SDL/video_sdl.cpp"
513 +  KEYCODES="../SDL/keycodes"
514 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
515 +    EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
516 +  else
517 +    case "$target_os" in
518 +    cygwin*)
519 +      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
520 +      ;;
521 +    *)
522 +      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
523 +      ;;
524 +    esac
525 +  fi
526 + else
527 +  VIDEOSRCS="video_x.cpp"
528 +  KEYCODES="keycodes"
529 +  EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
530 + fi
531 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
532 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
533 +  AUDIOSRC="../SDL/audio_sdl.cpp"
534 + fi
535 +
536   dnl Use 68k CPU natively?
537   WANT_NATIVE_M68K=no
538   if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
# Line 387 | Line 547 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
547    ETHERSRC=../dummy/ether_dummy.cpp
548    AUDIOSRC=../dummy/audio_dummy.cpp
549   fi
550 < SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
550 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
551  
552   dnl Define a macro that translates a yesno-variable into a C macro definition
553   dnl to be put into the config.h file
# Line 400 | Line 560 | AC_DEFUN(AC_TRANSLATE_DEFINE, [
560      fi
561   ])
562  
563 + dnl Check that the host supports TUN/TAP devices
564 + AC_CACHE_CHECK([whether TUN/TAP is supported],
565 +  ac_cv_tun_tap_support, [
566 +  AC_TRY_COMPILE([
567 +    #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
568 +    #include <linux/if.h>
569 +    #include <linux/if_tun.h>
570 +    #endif
571 +    #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
572 +    #include <net/if.h>
573 +    #include <net/if_tun.h>
574 +    #endif
575 +  ], [
576 +    struct ifreq ifr;
577 +    memset(&ifr, 0, sizeof(ifr));
578 +    ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
579 +  ],
580 +  ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
581 +  )
582 + ])
583 + AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support",
584 +  [Define if your system supports TUN/TAP devices.])
585 +
586   dnl Various checks if the system supports vm_allocate() and the like functions.
587   have_mach_vm=no
588   if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
# Line 546 | Line 729 | AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_
729  
730   fi dnl HAVE_MMAP_VM
731  
732 + dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
733 + AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000],
734 +  ac_cv_pagezero_hack, [
735 +  ac_cv_pagezero_hack=no
736 +  if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then
737 +    ac_cv_pagezero_hack=yes
738 +    dnl might as well skip the test for mmap-able low memory
739 +    ac_cv_can_map_lm=no
740 +  fi
741 + ])
742 + AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
743 +  [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
744 +
745   dnl Check if we can mmap 0x2000 bytes from 0x0000
746   AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
747    ac_cv_can_map_lm, [
# Line 569 | Line 765 | AC_CACHE_CHECK([whether we can map Low M
765    ]
766   )
767  
768 + dnl Check if we have POSIX shared memory support
769 + AC_CACHE_CHECK([whether POSIX shared memory is working],
770 +  ac_cv_have_posix_shm, [
771 +  AC_LANG_SAVE
772 +  AC_LANG_CPLUSPLUS
773 +  AC_TRY_RUN([
774 +    #define HAVE_POSIX_SHM
775 +    #include "vm_alloc.cpp"
776 +    int main(void) { /* returns 0 if we have working POSIX shm */
777 +      if (vm_init() < 0) exit(2);
778 +      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
779 +      if (m1 == VM_MAP_FAILED) exit(3);
780 +      vm_exit(); exit(0);
781 +    }
782 +  ], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no,
783 +  dnl When cross-compiling, do not assume anything.
784 +  ac_cv_have_posix_shm="guessing no"
785 +  )
786 +  AC_LANG_RESTORE
787 +  ]
788 + )
789 + AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm",
790 +  [Define if your system supports POSIX shared memory.])
791 +
792 + dnl Check if we have working 33-bit memory addressing
793 + AC_CACHE_CHECK([whether 33-bit memory addressing is working],
794 +  ac_cv_have_33bit_addressing, [
795 +  AC_LANG_SAVE
796 +  AC_LANG_CPLUSPLUS
797 +  AC_TRY_RUN([
798 +    #define USE_33BIT_ADDRESSING 1
799 +    #include "vm_alloc.cpp"
800 +    int main(void) { /* returns 0 if we have working 33-bit addressing */
801 +      if (sizeof(void *) < 8) exit(1);
802 +      if (vm_init() < 0) exit(2);
803 +      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
804 +      if (m1 == VM_MAP_FAILED) exit(3);
805 +      char *m2 = m1 + (1L << 32);
806 +      m1[0] = 0x12; if (m2[0] != 0x12) exit(4);
807 +      m2[0] = 0x34; if (m1[0] != 0x34) exit(5);
808 +      vm_exit(); exit(0);
809 +    }
810 +  ], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no,
811 +  dnl When cross-compiling, do not assume anything.
812 +  ac_cv_have_33bit_addressing="guessing no"
813 +  )
814 +  AC_LANG_RESTORE
815 +  ]
816 + )
817 +
818   dnl Check signal handlers need to be reinstalled
819   AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
820    ac_cv_signal_need_reinstall, [
# Line 630 | Line 876 | AC_CACHE_CHECK([whether sigaction handle
876   AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
877    [Define if your system requires sigactions to be reinstalled.])
878  
879 < dnl Check if extended signals are supported.
880 < AC_CACHE_CHECK([whether your system supports extended signal handlers],
881 <  ac_cv_have_extended_signals, [
879 > dnl Check if Mach exceptions supported.
880 > AC_CACHE_CHECK([whether your system supports Mach exceptions],
881 >  ac_cv_have_mach_exceptions, [
882    AC_LANG_SAVE
883    AC_LANG_CPLUSPLUS
884    AC_TRY_RUN([
885 <    #define HAVE_SIGINFO_T 1
885 >    #define HAVE_MACH_EXCEPTIONS 1
886      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
887      #include "vm_alloc.cpp"
888      #include "sigsegv.cpp"
889 <  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
889 >  ], [
890 >  sigsegv_recovery=mach
891 >  ac_cv_have_mach_exceptions=yes
892 >  ],
893 >  ac_cv_have_mach_exceptions=no,
894    dnl When cross-compiling, do not assume anything.
895 <  ac_cv_have_extended_signals=no
895 >  ac_cv_have_mach_exceptions=no
896    )
897    AC_LANG_RESTORE
898    ]
899   )
900 < AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
901 <  [Define if your system support extended signals.])
900 > AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
901 >  [Define if your system supports Mach exceptions.])
902 >
903 > dnl Check if Windows exceptions are supported.
904 > AC_CACHE_CHECK([whether your system supports Windows exceptions],
905 >  ac_cv_have_win32_exceptions, [
906 >  AC_LANG_SAVE
907 >  AC_LANG_CPLUSPLUS
908 >  AC_TRY_RUN([
909 >    #define HAVE_WIN32_EXCEPTIONS 1
910 >    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
911 >    #include "vm_alloc.cpp"
912 >    #include "sigsegv.cpp"
913 >  ], [
914 >  sigsegv_recovery=win32
915 >  ac_cv_have_win32_exceptions=yes
916 >  ],
917 >  ac_cv_have_win32_exceptions=no,
918 >  dnl When cross-compiling, do not assume anything.
919 >  ac_cv_have_win32_exceptions=no
920 >  )
921 >  AC_LANG_RESTORE
922 >  ]
923 > )
924 > AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
925 >  [Define if your system supports Windows exceptions.])
926 >
927 > dnl Otherwise, check if extended signals are supported.
928 > if [[ -z "$sigsegv_recovery" ]]; then
929 >  AC_CACHE_CHECK([whether your system supports extended signal handlers],
930 >    ac_cv_have_extended_signals, [
931 >    AC_LANG_SAVE
932 >    AC_LANG_CPLUSPLUS
933 >    AC_TRY_RUN([
934 >      #define HAVE_SIGINFO_T 1
935 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
936 >      #include "vm_alloc.cpp"
937 >      #include "sigsegv.cpp"
938 >    ], [
939 >    sigsegv_recovery=siginfo
940 >    ac_cv_have_extended_signals=yes
941 >    ],
942 >    ac_cv_have_extended_signals=no,
943 >    dnl When cross-compiling, do not assume anything.
944 >    ac_cv_have_extended_signals=no
945 >    )
946 >    AC_LANG_RESTORE
947 >    ]
948 >  )
949 >  AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
950 >    [Define if your system support extended signals.])
951 > fi
952  
953   dnl Otherwise, check for subterfuges.
954 < if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
954 > if [[ -z "$sigsegv_recovery" ]]; then
955    AC_CACHE_CHECK([whether we then have a subterfuge for your system],
956    ac_cv_have_sigcontext_hack, [
957      AC_LANG_SAVE
# Line 661 | Line 961 | if [[ "x$ac_cv_have_extended_signals" =
961        #define CONFIGURE_TEST_SIGSEGV_RECOVERY
962        #include "vm_alloc.cpp"
963        #include "sigsegv.cpp"
964 <    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
964 >    ], [
965 >    sigsegv_recovery=sigcontext
966 >    ac_cv_have_sigcontext_hack=yes
967 >    ],
968 >    ac_cv_have_sigcontext_hack=no,
969      dnl When cross-compiling, do not assume anything.
970      ac_cv_have_sigcontext_hack=no
971      )
# Line 693 | Line 997 | AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_IN
997  
998   dnl Can we do Video on SEGV Signals ?
999   CAN_VOSF=no
1000 < if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
1000 > if [[ -n "$sigsegv_recovery" ]]; then
1001    CAN_VOSF=yes
1002   fi
1003  
1004 + dnl A dummy program that returns always true
1005 + AC_PATH_PROG([BLESS], "true")
1006 +
1007   dnl Determine the addressing mode to use
1008   if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1009    ADDRESSING_MODE="real"
# Line 707 | Line 1014 | else
1014      case $am in
1015      real)
1016        dnl Requires ability to mmap() Low Memory globals
1017 <      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
1017 >      if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then
1018          continue
1019        fi
1020 <          dnl Requires VOSF screen updates
1020 >      dnl Requires VOSF screen updates
1021        if [[ "x$CAN_VOSF" = "xno" ]]; then
1022          continue
1023        fi
# Line 718 | Line 1025 | else
1025        ADDRESSING_MODE="real"
1026        WANT_VOSF=yes dnl we can use VOSF and we need it actually
1027        DEFINES="$DEFINES -DREAL_ADDRESSING"
1028 +      if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
1029 +        BLESS=Darwin/lowmem
1030 +        LDFLAGS="$LDFLAGS -pagezero_size 0x2000"
1031 +      fi
1032        break
1033        ;;
1034      direct)
# Line 785 | Line 1096 | AC_EGREP_CPP(xyes,
1096   #endif
1097   ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1098  
1099 + dnl Check for ICC.
1100 + AC_MSG_CHECKING(for ICC)
1101 + HAVE_ICC=no
1102 + if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1103 +  HAVE_ICC=yes
1104 + fi
1105 + AC_MSG_RESULT($HAVE_ICC)
1106 +
1107   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1108   dnl Also set "-fno-exceptions" for C++ because exception handling requires
1109   dnl the frame pointer.
# Line 798 | Line 1117 | dnl As of 2001/08/02, this affects the f
1117   dnl Official: probably gcc-3.1 (mainline CVS)
1118   dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1119   dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1120 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1120 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1121    SAVED_CXXFLAGS="$CXXFLAGS"
1122    CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1123    AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
# Line 812 | Line 1131 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1131    fi
1132   fi
1133  
1134 + dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1135 + dnl However, there are some corner cases exposed on x86-64
1136 + if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1137 +  SAVED_CXXFLAGS="$CXXFLAGS"
1138 +  CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1139 +  AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
1140 +    AC_LANG_SAVE
1141 +    AC_LANG_CPLUSPLUS
1142 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no])
1143 +    AC_LANG_RESTORE
1144 +  ])
1145 +  if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then
1146 +    CXXFLAGS="$SAVED_CXXFLAGS"
1147 +  fi
1148 + fi
1149 +
1150 + dnl Add -fno-strict-aliasing for slirp sources
1151 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1152 +  SAVED_CFLAGS="$CFLAGS"
1153 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1154 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1155 +    ac_cv_gcc_no_strict_aliasing, [
1156 +    AC_TRY_COMPILE([],[],
1157 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "-fno-strict-aliasing")],
1158 +      [ac_cv_gcc_no_strict_aliasing=no])
1159 +  ])
1160 +  CFLAGS="$SAVED_CFLAGS"
1161 + fi
1162 +
1163   dnl Select appropriate CPU source and REGPARAM define.
1164   ASM_OPTIMIZATIONS=none
1165   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
# Line 836 | Line 1184 | elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HA
1184    if [[ "x$HAVE_GAS" = "xyes" ]]; then
1185      ASM_OPTIMIZATIONS="x86-64"
1186      DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1187 +    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"
1188 +    CAN_JIT=yes
1189 +    WANT_33BIT_ADDRESSING=yes
1190    fi
1191   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1192    dnl SPARC CPU
# Line 892 | Line 1243 | else
1243    JITSRCS=""
1244   fi
1245  
1246 + dnl Use 33-bit memory addressing?
1247 + if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then
1248 +  use_33bit_addressing=yes
1249 + fi
1250 + AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing",
1251 +  [Define to use 33-bit memory addressing on 64-bit JIT capable systems.])
1252 +
1253   dnl Utility macro used by next two tests.
1254   dnl AC_EXAMINE_OBJECT(C source code,
1255   dnl     commands examining object file,
# Line 1089 | Line 1447 | fi
1447  
1448   dnl Remove the "-g" option if set for GCC.
1449   if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1450 <  CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'`
1451 <  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'`
1450 >  CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
1451 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
1452   fi
1453  
1454   dnl Or if we have -IPA (MIPSPro compilers)
# Line 1106 | Line 1464 | AC_SUBST(DEFINES)
1464   AC_SUBST(SYSSRCS)
1465   AC_SUBST(CPUINCLUDES)
1466   AC_SUBST(CPUSRCS)
1467 + AC_SUBST(BLESS)
1468 + AC_SUBST(KEYCODES)
1469   AC_CONFIG_FILES([Makefile])
1470   AC_OUTPUT
1471  
# Line 1113 | Line 1473 | dnl Print summary.
1473   echo
1474   echo Basilisk II configuration summary:
1475   echo
1476 + echo SDL support ............................ : $SDL_SUPPORT
1477   echo XFree86 DGA support .................... : $WANT_XF86_DGA
1478   echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
1479   echo fbdev DGA support ...................... : $WANT_FBDEV_DGA
# Line 1126 | Line 1487 | echo JIT debug mode ....................
1487   echo Floating-Point emulation core .......... : $FPE_CORE
1488   echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
1489   echo Addressing mode ........................ : $ADDRESSING_MODE
1490 + echo Bad memory access recovery type ........ : $sigsegv_recovery
1491   echo
1492   echo "Configuration done. Now type \"make\" (or \"gmake\")."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines