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.21 by gbeauche, 2003-10-12T15:56:00Z vs.
Revision 1.46 by gbeauche, 2005-05-15T17:22:12Z

# Line 7 | Line 7 | AC_PREREQ(2.52)
7   AC_CONFIG_HEADER(config.h)
8  
9   dnl Aliases for PACKAGE and VERSION macros.
10 < AC_DEFINE(PACKAGE, PACKAGE_NAME, [Alias to PACKAGE for i18n.])
11 < AC_DEFINE(VERSION, PACKAGE_VERSION, [Alias to VERSION for i18n.])
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.
# Line 20 | Line 20 | AC_ARG_ENABLE(xf86-vidmode,  [  --enable
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 94 | 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 122 | 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 144 | 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 227 | 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 mach/mach.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  
296   dnl Checks for typedefs, structures, and compiler characteristics.
297   AC_C_BIGENDIAN
# Line 243 | Line 306 | AC_CHECK_SIZEOF(double, 8)
306   AC_CHECK_SIZEOF(long double, 12)
307   AC_CHECK_SIZEOF(void *, 4)
308   AC_TYPE_OFF_T
309 < AC_CHECK_TYPE(loff_t, off_t)
310 < AC_CHECK_TYPE(caddr_t, [char *])
309 > AC_CHECK_TYPES(loff_t)
310 > AC_CHECK_TYPES(caddr_t)
311   AC_TYPE_SIZE_T
312   AC_TYPE_SIGNAL
313   AC_HEADER_TIME
# Line 268 | Line 331 | if [[ "x$ac_cv_type_socklen_t" != "xyes"
331   fi
332  
333   dnl Checks for library functions.
334 < AC_CHECK_FUNCS(strdup cfmakeraw)
334 > AC_CHECK_FUNCS(strdup strerror cfmakeraw)
335   AC_CHECK_FUNCS(clock_gettime timer_create)
336   AC_CHECK_FUNCS(sigaction signal)
337   AC_CHECK_FUNCS(mmap mprotect munmap)
338   AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect)
339 + AC_CHECK_FUNCS(poll inet_aton)
340  
341   dnl Darwin seems to define mach_task_self() instead of task_self().
342   AC_CHECK_FUNCS(mach_task_self task_self)
# Line 299 | Line 363 | mips-sony-bsd|mips-sony-newsos4)
363   *-*-sco3.2v5*)
364          no_dev_ptmx=1
365          ;;
366 + *-*-cygwin*)
367 +        no_dev_ptmx=1
368 +        ;;
369   esac
370  
371   if test -z "$no_dev_ptmx" ; then
# Line 321 | Line 388 | AC_CHECK_FILE([/dev/ptc],
388   dnl (end of code from openssh-3.2.2p1 configure.ac)
389  
390  
391 + dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
392 + AC_DEFUN(AC_CHECK_FRAMEWORK, [
393 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
394 +  AC_CACHE_CHECK([whether compiler supports framework $1],
395 +    ac_Framework, [
396 +    saved_LIBS="$LIBS"
397 +    LIBS="$LIBS -framework $1"
398 +    AC_TRY_LINK(
399 +      [$2], [int main(void) { return 0; }],
400 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
401 +    )
402 +  ])
403 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
404 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
405 +  )
406 +  AS_VAR_POPDEF([ac_Framework])dnl
407 + ])
408 +
409 + dnl Check for some MacOS X frameworks
410 + AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
411 + AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
412 +
413   dnl Select system-dependant source files.
414   SERIALSRC=serial_unix.cpp
415   ETHERSRC=../dummy/ether_dummy.cpp
416   SCSISRC=../dummy/scsi_dummy.cpp
417   AUDIOSRC=../dummy/audio_dummy.cpp
418 + EXTFSSRC=extfs_unix.cpp
419   EXTRASYSSRCS=
420   CAN_NATIVE_M68K=no
421   case "$target_os" in
# Line 359 | Line 449 | freebsd*)
449    ;;
450   netbsd*)
451    CAN_NATIVE_M68K=yes
452 +  ETHERSRC=ether_unix.cpp
453    ;;
454   solaris*)
455    AUDIOSRC=Solaris/audio_solaris.cpp
# Line 381 | Line 472 | irix*)
472    dnl Do a test compile of an empty function
473    AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
474    CFLAGS="$ocflags"
475 <
475 >  ;;
476 > darwin*)
477 >  ETHERSRC=ether_unix.cpp
478 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
479 >    EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
480 >  fi
481 >  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
482 >    EXTFSSRC=../MacOSX/extfs_macosx.mm
483 >  fi
484 >  ;;
485 > cygwin*)
486 >  SERIALSRC="../dummy/serial_dummy.cpp"
487 >  EXTRASYSSRCS="../Windows/BasiliskII.rc"
488    ;;
489   esac
490  
491 + dnl Is the slirp library supported?
492 + if [[ "x$ETHERSRC" = "xether_unix.cpp" ]]; then
493 +  AC_DEFINE(HAVE_SLIRP, 1, [Define if slirp library is supported])
494 +  SLIRP_SRCS="\
495 +    ../slirp/bootp.c     ../slirp/ip_output.c  ../slirp/tcp_input.c  \
496 +    ../slirp/cksum.c     ../slirp/mbuf.c       ../slirp/tcp_output.c \
497 +    ../slirp/debug.c     ../slirp/misc.c       ../slirp/tcp_subr.c   \
498 +    ../slirp/if.c        ../slirp/sbuf.c       ../slirp/tcp_timer.c  \
499 +    ../slirp/ip_icmp.c   ../slirp/slirp.c      ../slirp/tftp.c       \
500 +    ../slirp/ip_input.c  ../slirp/socket.c     ../slirp/udp.c"
501 + fi
502 + AC_SUBST(SLIRP_SRCS)
503 +
504 + dnl SDL overrides
505 + if [[ "x$WANT_SDL" = "xyes" ]]; then
506 +  AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
507 + fi
508 + if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
509 +  AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
510 +  VIDEOSRCS="../SDL/video_sdl.cpp"
511 +  KEYCODES="../SDL/keycodes"
512 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
513 +    EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
514 +  else
515 +    case "$target_os" in
516 +    cygwin*)
517 +      EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp"
518 +      ;;
519 +    *)
520 +      EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
521 +      ;;
522 +    esac
523 +  fi
524 + else
525 +  VIDEOSRCS="video_x.cpp"
526 +  KEYCODES="keycodes"
527 +  EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
528 + fi
529 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
530 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
531 +  AUDIOSRC="../SDL/audio_sdl.cpp"
532 + fi
533 +
534   dnl Use 68k CPU natively?
535   WANT_NATIVE_M68K=no
536   if [[ "x$HAVE_M68K" = "xyes" -a "x$CAN_NATIVE_M68K" = "xyes" ]]; then
# Line 399 | Line 545 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
545    ETHERSRC=../dummy/ether_dummy.cpp
546    AUDIOSRC=../dummy/audio_dummy.cpp
547   fi
548 < SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
548 > SYSSRCS="$VIDEOSRCS $EXTFSSRC $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
549  
550   dnl Define a macro that translates a yesno-variable into a C macro definition
551   dnl to be put into the config.h file
# Line 412 | Line 558 | AC_DEFUN(AC_TRANSLATE_DEFINE, [
558      fi
559   ])
560  
561 + dnl Check that the host supports TUN/TAP devices
562 + AC_CACHE_CHECK([whether TUN/TAP is supported],
563 +  ac_cv_tun_tap_support, [
564 +  AC_TRY_COMPILE([
565 +    #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
566 +    #include <linux/if.h>
567 +    #include <linux/if_tun.h>
568 +    #endif
569 +    #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
570 +    #include <net/if.h>
571 +    #include <net/if_tun.h>
572 +    #endif
573 +  ], [
574 +    struct ifreq ifr;
575 +    memset(&ifr, 0, sizeof(ifr));
576 +    ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
577 +  ],
578 +  ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
579 +  )
580 + ])
581 + AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support",
582 +  [Define if your system supports TUN/TAP devices.])
583 +
584   dnl Various checks if the system supports vm_allocate() and the like functions.
585   have_mach_vm=no
586   if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
# Line 558 | Line 727 | AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_
727  
728   fi dnl HAVE_MMAP_VM
729  
730 + dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
731 + AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000],
732 +  ac_cv_pagezero_hack, [
733 +  ac_cv_pagezero_hack=no
734 +  if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then
735 +    ac_cv_pagezero_hack=yes
736 +    dnl might as well skip the test for mmap-able low memory
737 +    ac_cv_can_map_lm=no
738 +  fi
739 + ])
740 + AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
741 +  [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
742 +
743   dnl Check if we can mmap 0x2000 bytes from 0x0000
744   AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
745    ac_cv_can_map_lm, [
# Line 581 | Line 763 | AC_CACHE_CHECK([whether we can map Low M
763    ]
764   )
765  
766 + dnl Check if we have POSIX shared memory support
767 + AC_CACHE_CHECK([whether POSIX shared memory is working],
768 +  ac_cv_have_posix_shm, [
769 +  AC_LANG_SAVE
770 +  AC_LANG_CPLUSPLUS
771 +  AC_TRY_RUN([
772 +    #define HAVE_POSIX_SHM
773 +    #include "vm_alloc.cpp"
774 +    int main(void) { /* returns 0 if we have working POSIX shm */
775 +      if (vm_init() < 0) exit(2);
776 +      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
777 +      if (m1 == VM_MAP_FAILED) exit(3);
778 +      vm_exit(); exit(0);
779 +    }
780 +  ], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no,
781 +  dnl When cross-compiling, do not assume anything.
782 +  ac_cv_have_posix_shm="guessing no"
783 +  )
784 +  AC_LANG_RESTORE
785 +  ]
786 + )
787 + AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm",
788 +  [Define if your system supports POSIX shared memory.])
789 +
790 + dnl Check if we have working 33-bit memory addressing
791 + AC_CACHE_CHECK([whether 33-bit memory addressing is working],
792 +  ac_cv_have_33bit_addressing, [
793 +  AC_LANG_SAVE
794 +  AC_LANG_CPLUSPLUS
795 +  AC_TRY_RUN([
796 +    #define USE_33BIT_ADDRESSING 1
797 +    #include "vm_alloc.cpp"
798 +    int main(void) { /* returns 0 if we have working 33-bit addressing */
799 +      if (sizeof(void *) < 8) exit(1);
800 +      if (vm_init() < 0) exit(2);
801 +      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
802 +      if (m1 == VM_MAP_FAILED) exit(3);
803 +      char *m2 = m1 + (1L << 32);
804 +      m1[0] = 0x12; if (m2[0] != 0x12) exit(4);
805 +      m2[0] = 0x34; if (m1[0] != 0x34) exit(5);
806 +      vm_exit(); exit(0);
807 +    }
808 +  ], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no,
809 +  dnl When cross-compiling, do not assume anything.
810 +  ac_cv_have_33bit_addressing="guessing no"
811 +  )
812 +  AC_LANG_RESTORE
813 +  ]
814 + )
815 +
816   dnl Check signal handlers need to be reinstalled
817   AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
818    ac_cv_signal_need_reinstall, [
# Line 666 | Line 898 | AC_CACHE_CHECK([whether your system supp
898   AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
899    [Define if your system supports Mach exceptions.])
900  
901 + dnl Check if Windows exceptions are supported.
902 + AC_CACHE_CHECK([whether your system supports Windows exceptions],
903 +  ac_cv_have_win32_exceptions, [
904 +  AC_LANG_SAVE
905 +  AC_LANG_CPLUSPLUS
906 +  AC_TRY_RUN([
907 +    #define HAVE_WIN32_EXCEPTIONS 1
908 +    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
909 +    #include "vm_alloc.cpp"
910 +    #include "sigsegv.cpp"
911 +  ], [
912 +  sigsegv_recovery=win32
913 +  ac_cv_have_win32_exceptions=yes
914 +  ],
915 +  ac_cv_have_win32_exceptions=no,
916 +  dnl When cross-compiling, do not assume anything.
917 +  ac_cv_have_win32_exceptions=no
918 +  )
919 +  AC_LANG_RESTORE
920 +  ]
921 + )
922 + AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions",
923 +  [Define if your system supports Windows exceptions.])
924 +
925   dnl Otherwise, check if extended signals are supported.
926   if [[ -z "$sigsegv_recovery" ]]; then
927    AC_CACHE_CHECK([whether your system supports extended signal handlers],
# Line 743 | Line 999 | if [[ -n "$sigsegv_recovery" ]]; then
999    CAN_VOSF=yes
1000   fi
1001  
1002 + dnl A dummy program that returns always true
1003 + AC_PATH_PROG([BLESS], "true")
1004 +
1005   dnl Determine the addressing mode to use
1006   if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
1007    ADDRESSING_MODE="real"
# Line 753 | Line 1012 | else
1012      case $am in
1013      real)
1014        dnl Requires ability to mmap() Low Memory globals
1015 <      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
1015 >      if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then
1016          continue
1017        fi
1018 <          dnl Requires VOSF screen updates
1018 >      dnl Requires VOSF screen updates
1019        if [[ "x$CAN_VOSF" = "xno" ]]; then
1020          continue
1021        fi
# Line 764 | Line 1023 | else
1023        ADDRESSING_MODE="real"
1024        WANT_VOSF=yes dnl we can use VOSF and we need it actually
1025        DEFINES="$DEFINES -DREAL_ADDRESSING"
1026 +      if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
1027 +        BLESS=Darwin/lowmem
1028 +        LDFLAGS="$LDFLAGS -pagezero_size 0x2000"
1029 +      fi
1030        break
1031        ;;
1032      direct)
# Line 831 | Line 1094 | AC_EGREP_CPP(xyes,
1094   #endif
1095   ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1096  
1097 + dnl Check for ICC.
1098 + AC_MSG_CHECKING(for ICC)
1099 + HAVE_ICC=no
1100 + if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then
1101 +  HAVE_ICC=yes
1102 + fi
1103 + AC_MSG_RESULT($HAVE_ICC)
1104 +
1105   dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher.
1106   dnl Also set "-fno-exceptions" for C++ because exception handling requires
1107   dnl the frame pointer.
# Line 844 | Line 1115 | dnl As of 2001/08/02, this affects the f
1115   dnl Official: probably gcc-3.1 (mainline CVS)
1116   dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk
1117   dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1
1118 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1118 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1119    SAVED_CXXFLAGS="$CXXFLAGS"
1120    CXXFLAGS="$CXXFLAGS -fno-merge-constants"
1121    AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [
# Line 858 | Line 1129 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1129    fi
1130   fi
1131  
1132 + dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1133 + dnl However, there are some corner cases exposed on x86-64
1134 + if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then
1135 +  SAVED_CXXFLAGS="$CXXFLAGS"
1136 +  CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1137 +  AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
1138 +    AC_LANG_SAVE
1139 +    AC_LANG_CPLUSPLUS
1140 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no])
1141 +    AC_LANG_RESTORE
1142 +  ])
1143 +  if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then
1144 +    CXXFLAGS="$SAVED_CXXFLAGS"
1145 +  fi
1146 + fi
1147 +
1148 + dnl Add -fno-strict-aliasing for slirp sources
1149 + if [[ "x$HAVE_GCC30" = "xyes" ]]; then
1150 +  SAVED_CFLAGS="$CFLAGS"
1151 +  CFLAGS="$CFLAGS -fno-strict-aliasing"
1152 +  AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing],
1153 +    ac_cv_gcc_no_strict_aliasing, [
1154 +    AC_TRY_COMPILE([],[],
1155 +      [ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "$CFLAGS")],
1156 +      [ac_cv_gcc_no_strict_aliasing=no])
1157 +  ])
1158 +  CFLAGS="$SAVED_CFLAGS"
1159 + fi
1160 +
1161   dnl Select appropriate CPU source and REGPARAM define.
1162   ASM_OPTIMIZATIONS=none
1163   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
# Line 882 | Line 1182 | elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HA
1182    if [[ "x$HAVE_GAS" = "xyes" ]]; then
1183      ASM_OPTIMIZATIONS="x86-64"
1184      DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1185 +    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"
1186 +    CAN_JIT=yes
1187 +    WANT_33BIT_ADDRESSING=yes
1188    fi
1189   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1190    dnl SPARC CPU
# Line 938 | Line 1241 | else
1241    JITSRCS=""
1242   fi
1243  
1244 + dnl Use 33-bit memory addressing?
1245 + if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then
1246 +  use_33bit_addressing=yes
1247 + fi
1248 + AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing",
1249 +  [Define to use 33-bit memory addressing on 64-bit JIT capable systems.])
1250 +
1251   dnl Utility macro used by next two tests.
1252   dnl AC_EXAMINE_OBJECT(C source code,
1253   dnl     commands examining object file,
# Line 1135 | Line 1445 | fi
1445  
1446   dnl Remove the "-g" option if set for GCC.
1447   if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1448 <  CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'`
1449 <  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'`
1448 >  CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
1449 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
1450   fi
1451  
1452   dnl Or if we have -IPA (MIPSPro compilers)
# Line 1152 | Line 1462 | AC_SUBST(DEFINES)
1462   AC_SUBST(SYSSRCS)
1463   AC_SUBST(CPUINCLUDES)
1464   AC_SUBST(CPUSRCS)
1465 + AC_SUBST(BLESS)
1466 + AC_SUBST(KEYCODES)
1467   AC_CONFIG_FILES([Makefile])
1468   AC_OUTPUT
1469  
# Line 1159 | Line 1471 | dnl Print summary.
1471   echo
1472   echo Basilisk II configuration summary:
1473   echo
1474 + echo SDL support ............................ : $SDL_SUPPORT
1475   echo XFree86 DGA support .................... : $WANT_XF86_DGA
1476   echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
1477   echo fbdev DGA support ...................... : $WANT_FBDEV_DGA

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines