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.1 by gbeauche, 2002-09-16T13:29:33Z vs.
Revision 1.34 by gbeauche, 2004-11-08T21:07:07Z

# Line 1 | Line 1
1   dnl Process this file with autoconf to produce a configure script.
2   dnl Written in 2002 by Christian Bauer et al.
3  
4 < AC_INIT(main_unix.cpp)
4 > AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII)
5 > AC_CONFIG_SRCDIR(main_unix.cpp)
6   AC_PREREQ(2.52)
7   AC_CONFIG_HEADER(config.h)
8  
9 < dnl Options.
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-video,     [  --enable-sdl-video      use SDL for video graphics [default=no]], [WANT_SDL_VIDEO=$enableval], [WANT_SDL_VIDEO=no])
25 + AC_ARG_ENABLE(sdl-audio,     [  --enable-sdl-audio      use SDL for audio [default=no]], [WANT_SDL_AUDIO=$enableval], [WANT_SDL_AUDIO=no])
26 +
27 + dnl JIT compiler options.
28 + AC_ARG_ENABLE(jit-compiler,  [  --enable-jit-compiler   enable JIT compiler [default=no]], [WANT_JIT=$enableval], [WANT_JIT=no])
29 + AC_ARG_ENABLE(jit-debug,     [  --enable-jit-debug      activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
30 +
31   dnl FPU emulation core.
32   AC_ARG_ENABLE(fpe,
33   [  --enable-fpe=FPE        specify which fpu emulator to use [default=auto]],
# Line 65 | Line 82 | HAVE_I386=no
82   HAVE_M68K=no
83   HAVE_SPARC=no
84   HAVE_POWERPC=no
85 + HAVE_X86_64=no
86   case "$target_cpu" in
87 <  i386* | i486* | i586* | i686* | i786* ) CPU_TYPE=i386 HAVE_I386=yes;;
88 <  m68k* ) CPU_TYPE=m68k HAVE_M68K=yes;;
89 <  sparc* ) CPU_TYPE=sparc HAVE_SPARC=yes;;
90 <  powerpc* ) CPU_TYPE=powerpc HAVE_POWERPC=yes;;
91 <  *) CPU_TYPE=`echo $target_cpu | sed -e 's/-/_/g'`;;
87 >  i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;;
88 >  m68k* ) HAVE_M68K=yes;;
89 >  sparc* ) HAVE_SPARC=yes;;
90 >  powerpc* ) HAVE_POWERPC=yes;;
91 >  x86_64* ) HAVE_X86_64=yes;;
92   esac
75 DEFINES="$DEFINES -DCPU_$CPU_TYPE"
93  
94   dnl Checks for programs.
95   AC_PROG_CC
# Line 99 | Line 116 | if [[ "x$WANT_MON" = "xyes" ]]; then
116              AC_CHECK_LIB(Hcurses, tgetent, ,
117                AC_CHECK_LIB(curses, tgetent))))))
118      AC_CHECK_LIB(readline, readline)
102    AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
119    else
120      AC_MSG_RESULT(no)
121      AC_MSG_WARN([Could not find mon, ignoring --with-mon.])
# Line 110 | Line 126 | fi
126   dnl Checks for libraries.
127   AC_CHECK_LIB(posix4, sem_init)
128   AC_CHECK_LIB(rt, timer_create)
129 + AC_CHECK_LIB(rt, shm_open)
130  
131 < dnl We need X11.
132 < AC_PATH_XTRA
133 < if [[ "x$no_x" = "xyes" ]]; then
134 <  AC_MSG_ERROR([You need X11 to run Basilisk II.])
135 < fi
136 < CFLAGS="$CFLAGS $X_CFLAGS"
137 < CXXFLAGS="$CXXFLAGS $X_CFLAGS"
138 < LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
131 > dnl Do we need SDL?
132 > WANT_SDL=no
133 > if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
134 >  WANT_SDL=yes
135 >  WANT_XF86_DGA=no
136 >  WANT_XF86_VIDMODE=no
137 >  WANT_FBDEV_DGA=no
138 >  SDL_SUPPORT="$SDL_SUPPORT video"
139 > fi
140 > if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
141 >  WANT_SDL=yes
142 >  SDL_SUPPORT="$SDL_SUPPORT audio"
143 > fi
144 > if [[ "x$WANT_SDL" = "xyes" ]]; then
145 >  AC_PATH_PROG(sdl_config, "sdl-config")
146 >  if [[ -n "$sdl_config" ]]; then
147 >    sdl_cflags=`$sdl_config --cflags`
148 >    sdl_libs=`$sdl_config --libs`
149 >    CFLAGS="$CFLAGS $sdl_cflags"
150 >    CXXFLAGS="$CXXFLAGS $sdl_cflags"
151 >    LIBS="$LIBS $sdl_libs"
152 >  else
153 >    WANT_SDL=no
154 >  fi
155 >  SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
156 > else
157 >  SDL_SUPPORT="none"
158 > fi
159 >
160 > dnl We need X11, if not using SDL.
161 > if [[ "x$WANT_SDL" = "xno" ]]; then
162 >  AC_PATH_XTRA
163 >  if [[ "x$no_x" = "xyes" ]]; then
164 >    AC_MSG_ERROR([You need X11 to run Basilisk II.])
165 >  fi
166 >  CFLAGS="$CFLAGS $X_CFLAGS"
167 >  CXXFLAGS="$CXXFLAGS $X_CFLAGS"
168 >  LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
169 > fi
170  
171   dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
172   HAVE_PTHREADS=yes
# Line 135 | Line 183 | fi
183   AC_CHECK_FUNCS(pthread_cancel)
184   AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
185   AC_CHECK_FUNCS(pthread_mutexattr_settype)
186 + AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
187  
188   dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes.
189   SEMSRC=
# Line 181 | Line 230 | if [[ "x$WANT_GTK" = "xyes" ]]; then
230      CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
231      LIBS="$LIBS $GTK_LIBS"
232      UISRCS=prefs_editor_gtk.cpp
233 +    dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if
234 +    dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which
235 +    dnl includes <libintl.h>
236 +    AM_GNU_GETTEXT
237      B2_PATH_GNOMEUI([
238        AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.])
239        CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS"
# Line 210 | Line 263 | AC_SYS_LARGEFILE
263  
264   dnl Checks for header files.
265   AC_HEADER_STDC
266 < AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h)
266 > AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h)
267 > AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h)
268 > AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h)
269 > AC_CHECK_HEADERS(AvailabilityMacros.h)
270  
271   dnl Checks for typedefs, structures, and compiler characteristics.
272   AC_C_BIGENDIAN
# Line 225 | Line 281 | AC_CHECK_SIZEOF(double, 8)
281   AC_CHECK_SIZEOF(long double, 12)
282   AC_CHECK_SIZEOF(void *, 4)
283   AC_TYPE_OFF_T
284 < AC_CHECK_TYPE(loff_t, off_t)
285 < AC_CHECK_TYPE(caddr_t, [char *])
284 > AC_CHECK_TYPES(loff_t)
285 > AC_CHECK_TYPES(caddr_t)
286   AC_TYPE_SIZE_T
287   AC_TYPE_SIGNAL
288   AC_HEADER_TIME
# Line 303 | Line 359 | AC_CHECK_FILE([/dev/ptc],
359   dnl (end of code from openssh-3.2.2p1 configure.ac)
360  
361  
362 + dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES)
363 + AC_DEFUN(AC_CHECK_FRAMEWORK, [
364 +  AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl
365 +  AC_CACHE_CHECK([whether compiler supports framework $1],
366 +    ac_Framework, [
367 +    saved_LIBS="$LIBS"
368 +    LIBS="$LIBS -framework $1"
369 +    AC_TRY_LINK(
370 +      [$2], [int main(void) { return 0; }],
371 +      [AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"]
372 +    )
373 +  ])
374 +  AS_IF([test AS_VAR_GET(ac_Framework) = yes],
375 +    [AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])]
376 +  )
377 +  AS_VAR_POPDEF([ac_Framework])dnl
378 + ])
379 +
380 + dnl Check for some MacOS X frameworks
381 + AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>])
382 + AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>])
383 +
384   dnl Select system-dependant source files.
385   SERIALSRC=serial_unix.cpp
386   ETHERSRC=../dummy/ether_dummy.cpp
# Line 355 | Line 433 | irix*)
433    LIBS="$LIBS -laudio"
434    WANT_ESD=no
435  
436 <  dnl Check if our compiler supports -Ofast (MIPSPro)
437 <  HAVE_OFAST=no
436 >  dnl Check if our compiler supports -IPA (MIPSPro)
437 >  HAVE_IPA=no
438    ocflags="$CFLAGS"
439 <  CFLAGS=`echo $CFLAGS | sed -e 's/ -g / -Ofast /;s/^-g /-Ofast /;s/-g$/ -Ofast/;s/^-g$/-Ofast/'`
440 <  AC_MSG_CHECKING(if "-Ofast" works)
439 >  CFLAGS=`echo "$CFLAGS -IPA" | sed -e "s/-g//g"`
440 >  AC_MSG_CHECKING(if "-IPA" works)
441    dnl Do a test compile of an empty function
442 <  AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_OFAST=yes], AC_MSG_RESULT(no))
442 >  AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no))
443    CFLAGS="$ocflags"
444 <
444 >  ;;
445 > darwin*)
446 >  if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then
447 >    EXTRASYSSRCS="../MacOSX/sys_darwin.cpp"
448 >  fi
449    ;;
450   esac
451 + dnl SDL overrides
452 + if [[ "x$WANT_SDL" = "xyes" ]]; then
453 +  AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
454 + fi
455 + if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then
456 +  AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
457 +  VIDEOSRCS="../SDL/video_sdl.cpp"
458 +  KEYCODES="../SDL/keycodes"
459 +  if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then
460 +    EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp"
461 +  else
462 +    EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp"
463 +  fi
464 + else
465 +  VIDEOSRCS="video_x.cpp"
466 +  KEYCODES="keycodes"
467 +  EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp"
468 + fi
469 + if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then
470 +  AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
471 +  AUDIOSRC="../SDL/audio_sdl.cpp"
472 + fi
473  
474   dnl Use 68k CPU natively?
475   WANT_NATIVE_M68K=no
# Line 381 | Line 485 | if [[ "x$HAVE_PTHREADS" = "xno" ]]; then
485    ETHERSRC=../dummy/ether_dummy.cpp
486    AUDIOSRC=../dummy/audio_dummy.cpp
487   fi
488 < SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
488 > SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS"
489  
490   dnl Define a macro that translates a yesno-variable into a C macro definition
491   dnl to be put into the config.h file
# Line 394 | Line 498 | AC_DEFUN(AC_TRANSLATE_DEFINE, [
498      fi
499   ])
500  
501 + dnl Check that the host supports TUN/TAP devices
502 + AC_CACHE_CHECK([whether TUN/TAP is supported],
503 +  ac_cv_tun_tap_support, [
504 +  AC_TRY_COMPILE([
505 +    #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
506 +    #include <linux/if.h>
507 +    #include <linux/if_tun.h>
508 +    #endif
509 +    #if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H)
510 +    #include <net/if.h>
511 +    #include <net/if_tun.h>
512 +    #endif
513 +  ], [
514 +    struct ifreq ifr;
515 +    memset(&ifr, 0, sizeof(ifr));
516 +    ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
517 +  ],
518 +  ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no
519 +  )
520 + ])
521 + AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support",
522 +  [Define if your system supports TUN/TAP devices.])
523 +
524   dnl Various checks if the system supports vm_allocate() and the like functions.
525   have_mach_vm=no
526   if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \
# Line 540 | Line 667 | AC_TRANSLATE_DEFINE(HAVE_MMAP_VM, $have_
667  
668   fi dnl HAVE_MMAP_VM
669  
670 + dnl Check if we can modify the __PAGEZERO segment for use as Low Memory
671 + AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000],
672 +  ac_cv_pagezero_hack, [
673 +  ac_cv_pagezero_hack=no
674 +  if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then
675 +    ac_cv_pagezero_hack=yes
676 +    dnl might as well skip the test for mmap-able low memory
677 +    ac_cv_can_map_lm=no
678 +  fi
679 + ])
680 + AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack",
681 +  [Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.])
682 +
683   dnl Check if we can mmap 0x2000 bytes from 0x0000
684   AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000],
685    ac_cv_can_map_lm, [
# Line 548 | Line 688 | AC_CACHE_CHECK([whether we can map Low M
688    AC_TRY_RUN([
689      #include "vm_alloc.cpp"
690      int main(void) { /* returns 0 if we could map the lowmem globals */
691 <      volatile char * lm;
691 >      volatile char * lm = 0;
692        if (vm_init() < 0) exit(1);
693 <      if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1);
693 >      if (vm_acquire_fixed(0, 0x2000) < 0) exit(1);
694        lm[0] = 'z';
695        if (vm_release((char *)lm, 0x2000) < 0) exit(1);
696        vm_exit(); exit(0);
# Line 563 | Line 703 | AC_CACHE_CHECK([whether we can map Low M
703    ]
704   )
705  
706 + dnl Check if we have POSIX shared memory support
707 + AC_CACHE_CHECK([whether POSIX shared memory is working],
708 +  ac_cv_have_posix_shm, [
709 +  AC_LANG_SAVE
710 +  AC_LANG_CPLUSPLUS
711 +  AC_TRY_RUN([
712 +    #define HAVE_POSIX_SHM
713 +    #include "vm_alloc.cpp"
714 +    int main(void) { /* returns 0 if we have working POSIX shm */
715 +      if (vm_init() < 0) exit(2);
716 +      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
717 +      if (m1 == VM_MAP_FAILED) exit(3);
718 +      vm_exit(); exit(0);
719 +    }
720 +  ], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no,
721 +  dnl When cross-compiling, do not assume anything.
722 +  ac_cv_have_posix_shm="guessing no"
723 +  )
724 +  AC_LANG_RESTORE
725 +  ]
726 + )
727 + AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm",
728 +  [Define if your system supports POSIX shared memory.])
729 +
730 + dnl Check if we have working 33-bit memory addressing
731 + AC_CACHE_CHECK([whether 33-bit memory addressing is working],
732 +  ac_cv_have_33bit_addressing, [
733 +  AC_LANG_SAVE
734 +  AC_LANG_CPLUSPLUS
735 +  AC_TRY_RUN([
736 +    #define USE_33BIT_ADDRESSING 1
737 +    #include "vm_alloc.cpp"
738 +    int main(void) { /* returns 0 if we have working 33-bit addressing */
739 +      if (sizeof(void *) < 8) exit(1);
740 +      if (vm_init() < 0) exit(2);
741 +      char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT);
742 +      if (m1 == VM_MAP_FAILED) exit(3);
743 +      char *m2 = m1 + (1L << 32);
744 +      m1[0] = 0x12; if (m2[0] != 0x12) exit(4);
745 +      m2[0] = 0x34; if (m1[0] != 0x34) exit(5);
746 +      vm_exit(); exit(0);
747 +    }
748 +  ], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no,
749 +  dnl When cross-compiling, do not assume anything.
750 +  ac_cv_have_33bit_addressing="guessing no"
751 +  )
752 +  AC_LANG_RESTORE
753 +  ]
754 + )
755 +
756   dnl Check signal handlers need to be reinstalled
757   AC_CACHE_CHECK([whether signal handlers need to be reinstalled],
758    ac_cv_signal_need_reinstall, [
# Line 624 | Line 814 | AC_CACHE_CHECK([whether sigaction handle
814   AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
815    [Define if your system requires sigactions to be reinstalled.])
816  
817 < dnl Check if extended signals are supported.
818 < AC_CACHE_CHECK([whether your system supports extended signal handlers],
819 <  ac_cv_have_extended_signals, [
817 > dnl Check if Mach exceptions supported.
818 > AC_CACHE_CHECK([whether your system supports Mach exceptions],
819 >  ac_cv_have_mach_exceptions, [
820    AC_LANG_SAVE
821    AC_LANG_CPLUSPLUS
822    AC_TRY_RUN([
823 <    #define HAVE_SIGINFO_T 1
823 >    #define HAVE_MACH_EXCEPTIONS 1
824      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
825      #include "vm_alloc.cpp"
826      #include "sigsegv.cpp"
827 <  ], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
827 >  ], [
828 >  sigsegv_recovery=mach
829 >  ac_cv_have_mach_exceptions=yes
830 >  ],
831 >  ac_cv_have_mach_exceptions=no,
832    dnl When cross-compiling, do not assume anything.
833 <  ac_cv_have_extended_signals=no
833 >  ac_cv_have_mach_exceptions=no
834    )
835    AC_LANG_RESTORE
836    ]
837   )
838 < AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
839 <  [Define if your system support extended signals.])
838 > AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
839 >  [Define if your system supports Mach exceptions.])
840 >
841 > dnl Otherwise, check if extended signals are supported.
842 > if [[ -z "$sigsegv_recovery" ]]; then
843 >  AC_CACHE_CHECK([whether your system supports extended signal handlers],
844 >    ac_cv_have_extended_signals, [
845 >    AC_LANG_SAVE
846 >    AC_LANG_CPLUSPLUS
847 >    AC_TRY_RUN([
848 >      #define HAVE_SIGINFO_T 1
849 >      #define CONFIGURE_TEST_SIGSEGV_RECOVERY
850 >      #include "vm_alloc.cpp"
851 >      #include "sigsegv.cpp"
852 >    ], [
853 >    sigsegv_recovery=siginfo
854 >    ac_cv_have_extended_signals=yes
855 >    ],
856 >    ac_cv_have_extended_signals=no,
857 >    dnl When cross-compiling, do not assume anything.
858 >    ac_cv_have_extended_signals=no
859 >    )
860 >    AC_LANG_RESTORE
861 >    ]
862 >  )
863 >  AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
864 >    [Define if your system support extended signals.])
865 > fi
866  
867   dnl Otherwise, check for subterfuges.
868 < if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
868 > if [[ -z "$sigsegv_recovery" ]]; then
869    AC_CACHE_CHECK([whether we then have a subterfuge for your system],
870    ac_cv_have_sigcontext_hack, [
871      AC_LANG_SAVE
# Line 655 | Line 875 | if [[ "x$ac_cv_have_extended_signals" =
875        #define CONFIGURE_TEST_SIGSEGV_RECOVERY
876        #include "vm_alloc.cpp"
877        #include "sigsegv.cpp"
878 <    ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
878 >    ], [
879 >    sigsegv_recovery=sigcontext
880 >    ac_cv_have_sigcontext_hack=yes
881 >    ],
882 >    ac_cv_have_sigcontext_hack=no,
883      dnl When cross-compiling, do not assume anything.
884      ac_cv_have_sigcontext_hack=no
885      )
# Line 687 | Line 911 | AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_IN
911  
912   dnl Can we do Video on SEGV Signals ?
913   CAN_VOSF=no
914 < if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then
914 > if [[ -n "$sigsegv_recovery" ]]; then
915    CAN_VOSF=yes
916   fi
917  
918 + dnl A dummy program that returns always true
919 + AC_PATH_PROG([BLESS], "true")
920 +
921   dnl Determine the addressing mode to use
922   if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then
923    ADDRESSING_MODE="real"
# Line 701 | Line 928 | else
928      case $am in
929      real)
930        dnl Requires ability to mmap() Low Memory globals
931 <      if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then
931 >      if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then
932          continue
933        fi
934 <          dnl Requires VOSF screen updates
934 >      dnl Requires VOSF screen updates
935        if [[ "x$CAN_VOSF" = "xno" ]]; then
936          continue
937        fi
# Line 712 | Line 939 | else
939        ADDRESSING_MODE="real"
940        WANT_VOSF=yes dnl we can use VOSF and we need it actually
941        DEFINES="$DEFINES -DREAL_ADDRESSING"
942 +      if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then
943 +        BLESS=Darwin/lowmem
944 +        LDFLAGS="$LDFLAGS -pagezero_size 0x2000"
945 +      fi
946        break
947        ;;
948      direct)
# Line 739 | Line 970 | else
970    fi
971   fi
972  
973 + dnl Banked Memory Addressing mode is not supported by the JIT compiler
974 + if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then
975 +  AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least])
976 + fi
977 +
978   dnl Enable VOSF screen updates with this feature is requested and feasible
979   if [[ "x$WANT_VOSF" = "xyes" -a "x$CAN_VOSF" = "xyes" ]]; then
980      AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.])
# Line 759 | Line 995 | AC_MSG_RESULT($HAVE_GAS)
995   dnl Check for GCC 2.7 or higher.
996   HAVE_GCC27=no
997   AC_MSG_CHECKING(for GCC 2.7 or higher)
998 < AC_EGREP_CPP(yes,
998 > AC_EGREP_CPP(xyes,
999   [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
1000 <  yes
1000 >  xyes
1001   #endif
1002   ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
1003  
1004   dnl Check for GCC 3.0 or higher.
1005   HAVE_GCC30=no
1006   AC_MSG_CHECKING(for GCC 3.0 or higher)
1007 < AC_EGREP_CPP(yes,
1007 > AC_EGREP_CPP(xyes,
1008   [#if __GNUC__ >= 3
1009 <  yes
1009 >  xyes
1010   #endif
1011   ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
1012  
# Line 801 | Line 1037 | if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1037    fi
1038   fi
1039  
1040 + dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4
1041 + dnl However, there are some corner cases exposed on x86-64
1042 + if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1043 +  SAVED_CXXFLAGS="$CXXFLAGS"
1044 +  CXXFLAGS="$CXXFLAGS -fno-gcse-sm"
1045 +  AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [
1046 +    AC_LANG_SAVE
1047 +    AC_LANG_CPLUSPLUS
1048 +    AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no])
1049 +    AC_LANG_RESTORE
1050 +  ])
1051 +  if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then
1052 +    CXXFLAGS="$SAVED_CXXFLAGS"
1053 +  fi
1054 + fi
1055 +
1056   dnl Select appropriate CPU source and REGPARAM define.
1057   ASM_OPTIMIZATIONS=none
1058   CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
1059 < if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" -a "x$OS_TYPE" != "xfreebsd" ]]; then
1059 >
1060 > dnl (gb) JITSRCS will be emptied later if the JIT is not available
1061 > dnl Other platforms should define their own set of noflags file variants
1062 > CAN_JIT=no
1063 > JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp"
1064 >
1065 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
1066    dnl i386 CPU
1067 <  DEFINES="$DEFINES -DREGPARAM=\"__attribute__((regparm(3)))\""
1067 >  DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\""
1068    if [[ "x$HAVE_GAS" = "xyes" ]]; then
1069      ASM_OPTIMIZATIONS=i386
1070 <    DEFINES="$DEFINES -DX86_ASSEMBLY -DUNALIGNED_PROFITABLE -DOPTIMIZED_FLAGS"
1071 <    CPUSRCS="cpufast1.s cpufast2.s cpufast3.s cpufast4.s cpufast5.s cpufast6.s cpufast7.s cpufast8.s"
1070 >    DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE"
1071 >    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"
1072 >    CAN_JIT=yes
1073 >  fi
1074 > elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then
1075 >  dnl x86-64 CPU
1076 >  DEFINES="$DEFINES -DUNALIGNED_PROFITABLE"
1077 >  if [[ "x$HAVE_GAS" = "xyes" ]]; then
1078 >    ASM_OPTIMIZATIONS="x86-64"
1079 >    DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
1080 >    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"
1081 >    CAN_JIT=yes
1082 >    WANT_33BIT_ADDRESSING=yes
1083    fi
1084   elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then
1085    dnl SPARC CPU
# Line 841 | Line 1110 | elif [[ "x$WANT_NATIVE_M68K" = "xyes" ]]
1110    CPUSRCS="asm_support.s"
1111   fi
1112  
1113 + dnl Enable JIT compiler, if possible.
1114 + if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then
1115 +  JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o"
1116 +  DEFINES="$DEFINES -DUSE_JIT -DUSE_JIT_FPU"
1117 +  
1118 +  if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then
1119 +    if [[ "x$WANT_MON" = "xyes" ]]; then
1120 +      DEFINES="$DEFINES -DJIT_DEBUG=1"
1121 +    else
1122 +      AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug])
1123 +      WANT_JIT_DEBUG=no
1124 +    fi
1125 +  fi
1126 +
1127 +  dnl IEEE core is the only FPU emulator to use with the JIT compiler
1128 +  case $FPE_CORE_TEST_ORDER in
1129 +  ieee*) ;;
1130 +  *) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;;
1131 +  esac
1132 +  FPE_CORE_TEST_ORDER="ieee"
1133 + else
1134 +  WANT_JIT=no
1135 +  WANT_JIT_DEBUG=no
1136 +  JITSRCS=""
1137 + fi
1138 +
1139 + dnl Use 33-bit memory addressing?
1140 + if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then
1141 +  use_33bit_addressing=yes
1142 + fi
1143 + AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing",
1144 +  [Define to use 33-bit memory addressing on 64-bit JIT capable systems.])
1145 +
1146   dnl Utility macro used by next two tests.
1147   dnl AC_EXAMINE_OBJECT(C source code,
1148   dnl     commands examining object file,
# Line 985 | Line 1287 | AC_CHECK_HEADERS(ieee754.h ieeefp.h floa
1287   for fpe in $FPE_CORE_TEST_ORDER; do
1288    case $fpe in
1289    ieee)
1290 <    if echo "$ac_cv_c_float_format" | grep -q IEEE; then
1290 >    case $ac_cv_c_float_format in
1291 >    IEEE*)
1292        FPE_CORE="IEEE fpu core"
1293        DEFINES="$DEFINES -DFPU_IEEE"
1294        FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp"
1295 +      dnl Math functions not mandated by C99 standard
1296 +      AC_CHECK_FUNCS(isnanl isinfl)
1297 +      dnl Math functions required by C99 standard, but probably not
1298 +      dnl implemented everywhere. In that case, we fall back to the
1299 +      dnl regular variant for doubles.
1300 +      AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl)
1301 +      AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl)
1302 +      AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl)
1303 +      AC_CHECK_FUNCS(floorl ceill)
1304        break
1305 <    fi
1305 >      ;;
1306 >    esac
1307      ;;
1308    x86)
1309      if [[ ":$HAVE_GCC27:$HAVE_I386:$HAVE_GAS:" = ":yes:yes:yes:" ]]; then
# Line 1017 | Line 1330 | fi
1330  
1331   dnl Check for certain math functions
1332   AC_CHECK_FUNCS(atanh)
1333 < AC_CHECK_FUNCS(isnan isinf)             dnl C99
1021 < AC_CHECK_FUNCS(isnanl isinfl)   dnl IEEE ?
1333 > AC_CHECK_FUNCS(isnan isinf finite isnormal signbit)
1334  
1335   dnl UAE CPU sources for all non-m68k-native architectures.
1336   if [[ "x$WANT_NATIVE_M68K" = "xno" ]]; then
1337    CPUINCLUDES="-I../uae_cpu"
1338 <  CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS"
1338 >  CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS $JITSRCS"
1339   fi
1340  
1341   dnl Remove the "-g" option if set for GCC.
1342   if [[ "x$HAVE_GCC27" = "xyes" ]]; then
1343 <  CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'`
1344 <  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'`
1343 >  CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
1344 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
1345   fi
1346  
1347 < dnl Or if we have -Ofast
1348 < if [[ "x$HAVE_OFAST" = "xyes" ]]; then
1349 <  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast"
1350 <  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast"
1347 > dnl Or if we have -IPA (MIPSPro compilers)
1348 > if [[ "x$HAVE_IPA" = "xyes" ]]; then
1349 >  CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1350 >  CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -O3 -OPT:Olimit=0 -IPA"
1351    CXXFLAGS="-LANG:std $CXXFLAGS"
1352 <  LDFLAGS="$LDFLAGS -ipa"
1352 >  LDFLAGS="$LDFLAGS -O3 -OPT:Olimit=0 -IPA"
1353   fi
1354  
1355   dnl Generate Makefile.
# Line 1045 | Line 1357 | AC_SUBST(DEFINES)
1357   AC_SUBST(SYSSRCS)
1358   AC_SUBST(CPUINCLUDES)
1359   AC_SUBST(CPUSRCS)
1360 < AC_OUTPUT(Makefile)
1360 > AC_SUBST(BLESS)
1361 > AC_SUBST(KEYCODES)
1362 > AC_CONFIG_FILES([Makefile])
1363 > AC_OUTPUT
1364  
1365   dnl Print summary.
1366   echo
1367   echo Basilisk II configuration summary:
1368   echo
1369 + echo SDL support ............................ : $SDL_SUPPORT
1370   echo XFree86 DGA support .................... : $WANT_XF86_DGA
1371   echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE
1372   echo fbdev DGA support ...................... : $WANT_FBDEV_DGA
# Line 1059 | Line 1375 | echo ESD sound support .................
1375   echo GTK user interface ..................... : $WANT_GTK
1376   echo mon debugger support ................... : $WANT_MON
1377   echo Running m68k code natively ............. : $WANT_NATIVE_M68K
1378 + echo Use JIT compiler ....................... : $WANT_JIT
1379 + echo JIT debug mode ......................... : $WANT_JIT_DEBUG
1380   echo Floating-Point emulation core .......... : $FPE_CORE
1381   echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
1382   echo Addressing mode ........................ : $ADDRESSING_MODE
1383 + echo Bad memory access recovery type ........ : $sigsegv_recovery
1384   echo
1385   echo "Configuration done. Now type \"make\" (or \"gmake\")."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines