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. |
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]) |
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]) |
98 |
|
AC_PROG_CXX |
99 |
|
AC_PROG_MAKE_SET |
100 |
|
AC_PROG_INSTALL |
101 |
+ |
AC_PROG_EGREP |
102 |
|
|
103 |
|
dnl We use mon if possible. |
104 |
|
MONSRCS= |
127 |
|
dnl Checks for libraries. |
128 |
|
AC_CHECK_LIB(posix4, sem_init) |
129 |
|
AC_CHECK_LIB(rt, timer_create) |
130 |
+ |
AC_CHECK_LIB(rt, shm_open) |
131 |
+ |
|
132 |
+ |
dnl Do we need SDL? |
133 |
+ |
WANT_SDL=no |
134 |
+ |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
135 |
+ |
WANT_SDL=yes |
136 |
+ |
WANT_XF86_DGA=no |
137 |
+ |
WANT_XF86_VIDMODE=no |
138 |
+ |
WANT_FBDEV_DGA=no |
139 |
+ |
SDL_SUPPORT="$SDL_SUPPORT video" |
140 |
+ |
fi |
141 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
142 |
+ |
WANT_SDL=yes |
143 |
+ |
SDL_SUPPORT="$SDL_SUPPORT audio" |
144 |
+ |
fi |
145 |
+ |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
146 |
+ |
AC_PATH_PROG(sdl_config, "sdl-config") |
147 |
+ |
if [[ -n "$sdl_config" ]]; then |
148 |
+ |
case $target_os in |
149 |
+ |
# Special treatment for Cygwin so that we can still use the POSIX layer |
150 |
+ |
*cygwin*) |
151 |
+ |
sdl_cflags="-I`$sdl_config --prefix`/include/SDL" |
152 |
+ |
sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" |
153 |
+ |
;; |
154 |
+ |
*) |
155 |
+ |
sdl_cflags=`$sdl_config --cflags` |
156 |
+ |
sdl_libs=`$sdl_config --libs` |
157 |
+ |
;; |
158 |
+ |
esac |
159 |
+ |
CFLAGS="$CFLAGS $sdl_cflags" |
160 |
+ |
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
161 |
+ |
LIBS="$LIBS $sdl_libs" |
162 |
+ |
else |
163 |
+ |
WANT_SDL=no |
164 |
+ |
fi |
165 |
+ |
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` |
166 |
+ |
else |
167 |
+ |
SDL_SUPPORT="none" |
168 |
+ |
fi |
169 |
|
|
170 |
< |
dnl We need X11. |
171 |
< |
AC_PATH_XTRA |
172 |
< |
if [[ "x$no_x" = "xyes" ]]; then |
173 |
< |
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
174 |
< |
fi |
175 |
< |
CFLAGS="$CFLAGS $X_CFLAGS" |
176 |
< |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
177 |
< |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
170 |
> |
dnl We need X11, if not using SDL. |
171 |
> |
if [[ "x$WANT_SDL" = "xno" ]]; then |
172 |
> |
AC_PATH_XTRA |
173 |
> |
if [[ "x$no_x" = "xyes" ]]; then |
174 |
> |
AC_MSG_ERROR([You need X11 to run Basilisk II.]) |
175 |
> |
fi |
176 |
> |
CFLAGS="$CFLAGS $X_CFLAGS" |
177 |
> |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
178 |
> |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
179 |
> |
fi |
180 |
|
|
181 |
|
dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. |
182 |
|
HAVE_PTHREADS=yes |
273 |
|
|
274 |
|
dnl Checks for header files. |
275 |
|
AC_HEADER_STDC |
276 |
< |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
276 |
> |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/types.h sys/time.h sys/mman.h mach/mach.h) |
277 |
|
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
278 |
+ |
AC_CHECK_HEADERS(sys/socket.h) |
279 |
+ |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [ |
280 |
+ |
#ifdef HAVE_SYS_SOCKET_H |
281 |
+ |
#include <sys/socket.h> |
282 |
+ |
#endif |
283 |
+ |
]) |
284 |
+ |
AC_CHECK_HEADERS(AvailabilityMacros.h) |
285 |
|
|
286 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
287 |
|
AC_C_BIGENDIAN |
296 |
|
AC_CHECK_SIZEOF(long double, 12) |
297 |
|
AC_CHECK_SIZEOF(void *, 4) |
298 |
|
AC_TYPE_OFF_T |
299 |
< |
AC_CHECK_TYPE(loff_t, off_t) |
300 |
< |
AC_CHECK_TYPE(caddr_t, [char *]) |
299 |
> |
AC_CHECK_TYPES(loff_t) |
300 |
> |
AC_CHECK_TYPES(caddr_t) |
301 |
|
AC_TYPE_SIZE_T |
302 |
|
AC_TYPE_SIGNAL |
303 |
|
AC_HEADER_TIME |
352 |
|
*-*-sco3.2v5*) |
353 |
|
no_dev_ptmx=1 |
354 |
|
;; |
355 |
+ |
*-*-cygwin*) |
356 |
+ |
no_dev_ptmx=1 |
357 |
+ |
;; |
358 |
|
esac |
359 |
|
|
360 |
|
if test -z "$no_dev_ptmx" ; then |
377 |
|
dnl (end of code from openssh-3.2.2p1 configure.ac) |
378 |
|
|
379 |
|
|
380 |
+ |
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES) |
381 |
+ |
AC_DEFUN(AC_CHECK_FRAMEWORK, [ |
382 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl |
383 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
384 |
+ |
ac_Framework, [ |
385 |
+ |
saved_LIBS="$LIBS" |
386 |
+ |
LIBS="$LIBS -framework $1" |
387 |
+ |
AC_TRY_LINK( |
388 |
+ |
[$2], [int main(void) { return 0; }], |
389 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"] |
390 |
+ |
) |
391 |
+ |
]) |
392 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
393 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
394 |
+ |
) |
395 |
+ |
AS_VAR_POPDEF([ac_Framework])dnl |
396 |
+ |
]) |
397 |
+ |
|
398 |
+ |
dnl Check for some MacOS X frameworks |
399 |
+ |
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
400 |
+ |
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
401 |
+ |
|
402 |
|
dnl Select system-dependant source files. |
403 |
|
SERIALSRC=serial_unix.cpp |
404 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
459 |
|
dnl Do a test compile of an empty function |
460 |
|
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
461 |
|
CFLAGS="$ocflags" |
462 |
< |
|
462 |
> |
;; |
463 |
> |
darwin*) |
464 |
> |
if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then |
465 |
> |
EXTRASYSSRCS="../MacOSX/sys_darwin.cpp" |
466 |
> |
fi |
467 |
> |
;; |
468 |
> |
cygwin*) |
469 |
> |
SERIALSRC="../dummy/serial_dummy.cpp" |
470 |
|
;; |
471 |
|
esac |
472 |
+ |
dnl SDL overrides |
473 |
+ |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
474 |
+ |
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
475 |
+ |
fi |
476 |
+ |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
477 |
+ |
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support]) |
478 |
+ |
VIDEOSRCS="../SDL/video_sdl.cpp" |
479 |
+ |
KEYCODES="../SDL/keycodes" |
480 |
+ |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
481 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" |
482 |
+ |
else |
483 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
484 |
+ |
fi |
485 |
+ |
else |
486 |
+ |
VIDEOSRCS="video_x.cpp" |
487 |
+ |
KEYCODES="keycodes" |
488 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp" |
489 |
+ |
fi |
490 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
491 |
+ |
AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support]) |
492 |
+ |
AUDIOSRC="../SDL/audio_sdl.cpp" |
493 |
+ |
fi |
494 |
|
|
495 |
|
dnl Use 68k CPU natively? |
496 |
|
WANT_NATIVE_M68K=no |
506 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
507 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
508 |
|
fi |
509 |
< |
SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
509 |
> |
SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
510 |
|
|
511 |
|
dnl Define a macro that translates a yesno-variable into a C macro definition |
512 |
|
dnl to be put into the config.h file |
519 |
|
fi |
520 |
|
]) |
521 |
|
|
522 |
+ |
dnl Check that the host supports TUN/TAP devices |
523 |
+ |
AC_CACHE_CHECK([whether TUN/TAP is supported], |
524 |
+ |
ac_cv_tun_tap_support, [ |
525 |
+ |
AC_TRY_COMPILE([ |
526 |
+ |
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) |
527 |
+ |
#include <linux/if.h> |
528 |
+ |
#include <linux/if_tun.h> |
529 |
+ |
#endif |
530 |
+ |
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H) |
531 |
+ |
#include <net/if.h> |
532 |
+ |
#include <net/if_tun.h> |
533 |
+ |
#endif |
534 |
+ |
], [ |
535 |
+ |
struct ifreq ifr; |
536 |
+ |
memset(&ifr, 0, sizeof(ifr)); |
537 |
+ |
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
538 |
+ |
], |
539 |
+ |
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no |
540 |
+ |
) |
541 |
+ |
]) |
542 |
+ |
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support", |
543 |
+ |
[Define if your system supports TUN/TAP devices.]) |
544 |
+ |
|
545 |
|
dnl Various checks if the system supports vm_allocate() and the like functions. |
546 |
|
have_mach_vm=no |
547 |
|
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \ |
688 |
|
|
689 |
|
fi dnl HAVE_MMAP_VM |
690 |
|
|
691 |
+ |
dnl Check if we can modify the __PAGEZERO segment for use as Low Memory |
692 |
+ |
AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000], |
693 |
+ |
ac_cv_pagezero_hack, [ |
694 |
+ |
ac_cv_pagezero_hack=no |
695 |
+ |
if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then |
696 |
+ |
ac_cv_pagezero_hack=yes |
697 |
+ |
dnl might as well skip the test for mmap-able low memory |
698 |
+ |
ac_cv_can_map_lm=no |
699 |
+ |
fi |
700 |
+ |
]) |
701 |
+ |
AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack", |
702 |
+ |
[Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.]) |
703 |
+ |
|
704 |
|
dnl Check if we can mmap 0x2000 bytes from 0x0000 |
705 |
|
AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000], |
706 |
|
ac_cv_can_map_lm, [ |
724 |
|
] |
725 |
|
) |
726 |
|
|
727 |
+ |
dnl Check if we have POSIX shared memory support |
728 |
+ |
AC_CACHE_CHECK([whether POSIX shared memory is working], |
729 |
+ |
ac_cv_have_posix_shm, [ |
730 |
+ |
AC_LANG_SAVE |
731 |
+ |
AC_LANG_CPLUSPLUS |
732 |
+ |
AC_TRY_RUN([ |
733 |
+ |
#define HAVE_POSIX_SHM |
734 |
+ |
#include "vm_alloc.cpp" |
735 |
+ |
int main(void) { /* returns 0 if we have working POSIX shm */ |
736 |
+ |
if (vm_init() < 0) exit(2); |
737 |
+ |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
738 |
+ |
if (m1 == VM_MAP_FAILED) exit(3); |
739 |
+ |
vm_exit(); exit(0); |
740 |
+ |
} |
741 |
+ |
], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no, |
742 |
+ |
dnl When cross-compiling, do not assume anything. |
743 |
+ |
ac_cv_have_posix_shm="guessing no" |
744 |
+ |
) |
745 |
+ |
AC_LANG_RESTORE |
746 |
+ |
] |
747 |
+ |
) |
748 |
+ |
AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm", |
749 |
+ |
[Define if your system supports POSIX shared memory.]) |
750 |
+ |
|
751 |
+ |
dnl Check if we have working 33-bit memory addressing |
752 |
+ |
AC_CACHE_CHECK([whether 33-bit memory addressing is working], |
753 |
+ |
ac_cv_have_33bit_addressing, [ |
754 |
+ |
AC_LANG_SAVE |
755 |
+ |
AC_LANG_CPLUSPLUS |
756 |
+ |
AC_TRY_RUN([ |
757 |
+ |
#define USE_33BIT_ADDRESSING 1 |
758 |
+ |
#include "vm_alloc.cpp" |
759 |
+ |
int main(void) { /* returns 0 if we have working 33-bit addressing */ |
760 |
+ |
if (sizeof(void *) < 8) exit(1); |
761 |
+ |
if (vm_init() < 0) exit(2); |
762 |
+ |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
763 |
+ |
if (m1 == VM_MAP_FAILED) exit(3); |
764 |
+ |
char *m2 = m1 + (1L << 32); |
765 |
+ |
m1[0] = 0x12; if (m2[0] != 0x12) exit(4); |
766 |
+ |
m2[0] = 0x34; if (m1[0] != 0x34) exit(5); |
767 |
+ |
vm_exit(); exit(0); |
768 |
+ |
} |
769 |
+ |
], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no, |
770 |
+ |
dnl When cross-compiling, do not assume anything. |
771 |
+ |
ac_cv_have_33bit_addressing="guessing no" |
772 |
+ |
) |
773 |
+ |
AC_LANG_RESTORE |
774 |
+ |
] |
775 |
+ |
) |
776 |
+ |
|
777 |
|
dnl Check signal handlers need to be reinstalled |
778 |
|
AC_CACHE_CHECK([whether signal handlers need to be reinstalled], |
779 |
|
ac_cv_signal_need_reinstall, [ |
835 |
|
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall", |
836 |
|
[Define if your system requires sigactions to be reinstalled.]) |
837 |
|
|
838 |
< |
dnl Check if extended signals are supported. |
839 |
< |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
840 |
< |
ac_cv_have_extended_signals, [ |
838 |
> |
dnl Check if Mach exceptions supported. |
839 |
> |
AC_CACHE_CHECK([whether your system supports Mach exceptions], |
840 |
> |
ac_cv_have_mach_exceptions, [ |
841 |
|
AC_LANG_SAVE |
842 |
|
AC_LANG_CPLUSPLUS |
843 |
|
AC_TRY_RUN([ |
844 |
< |
#define HAVE_SIGINFO_T 1 |
844 |
> |
#define HAVE_MACH_EXCEPTIONS 1 |
845 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
846 |
|
#include "vm_alloc.cpp" |
847 |
|
#include "sigsegv.cpp" |
848 |
< |
], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no, |
848 |
> |
], [ |
849 |
> |
sigsegv_recovery=mach |
850 |
> |
ac_cv_have_mach_exceptions=yes |
851 |
> |
], |
852 |
> |
ac_cv_have_mach_exceptions=no, |
853 |
|
dnl When cross-compiling, do not assume anything. |
854 |
< |
ac_cv_have_extended_signals=no |
854 |
> |
ac_cv_have_mach_exceptions=no |
855 |
|
) |
856 |
|
AC_LANG_RESTORE |
857 |
|
] |
858 |
|
) |
859 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
860 |
< |
[Define if your system support extended signals.]) |
859 |
> |
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
860 |
> |
[Define if your system supports Mach exceptions.]) |
861 |
> |
|
862 |
> |
dnl Check if Windows exceptions are supported. |
863 |
> |
AC_CACHE_CHECK([whether your system supports Windows exceptions], |
864 |
> |
ac_cv_have_win32_exceptions, [ |
865 |
> |
AC_LANG_SAVE |
866 |
> |
AC_LANG_CPLUSPLUS |
867 |
> |
AC_TRY_RUN([ |
868 |
> |
#define HAVE_WIN32_EXCEPTIONS 1 |
869 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
870 |
> |
#include "vm_alloc.cpp" |
871 |
> |
#include "sigsegv.cpp" |
872 |
> |
], [ |
873 |
> |
sigsegv_recovery=win32 |
874 |
> |
ac_cv_have_win32_exceptions=yes |
875 |
> |
], |
876 |
> |
ac_cv_have_win32_exceptions=no, |
877 |
> |
dnl When cross-compiling, do not assume anything. |
878 |
> |
ac_cv_have_win32_exceptions=no |
879 |
> |
) |
880 |
> |
AC_LANG_RESTORE |
881 |
> |
] |
882 |
> |
) |
883 |
> |
AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions", |
884 |
> |
[Define if your system supports Windows exceptions.]) |
885 |
> |
|
886 |
> |
dnl Otherwise, check if extended signals are supported. |
887 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
888 |
> |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
889 |
> |
ac_cv_have_extended_signals, [ |
890 |
> |
AC_LANG_SAVE |
891 |
> |
AC_LANG_CPLUSPLUS |
892 |
> |
AC_TRY_RUN([ |
893 |
> |
#define HAVE_SIGINFO_T 1 |
894 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
895 |
> |
#include "vm_alloc.cpp" |
896 |
> |
#include "sigsegv.cpp" |
897 |
> |
], [ |
898 |
> |
sigsegv_recovery=siginfo |
899 |
> |
ac_cv_have_extended_signals=yes |
900 |
> |
], |
901 |
> |
ac_cv_have_extended_signals=no, |
902 |
> |
dnl When cross-compiling, do not assume anything. |
903 |
> |
ac_cv_have_extended_signals=no |
904 |
> |
) |
905 |
> |
AC_LANG_RESTORE |
906 |
> |
] |
907 |
> |
) |
908 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
909 |
> |
[Define if your system support extended signals.]) |
910 |
> |
fi |
911 |
|
|
912 |
|
dnl Otherwise, check for subterfuges. |
913 |
< |
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
913 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
914 |
|
AC_CACHE_CHECK([whether we then have a subterfuge for your system], |
915 |
|
ac_cv_have_sigcontext_hack, [ |
916 |
|
AC_LANG_SAVE |
920 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
921 |
|
#include "vm_alloc.cpp" |
922 |
|
#include "sigsegv.cpp" |
923 |
< |
], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no, |
923 |
> |
], [ |
924 |
> |
sigsegv_recovery=sigcontext |
925 |
> |
ac_cv_have_sigcontext_hack=yes |
926 |
> |
], |
927 |
> |
ac_cv_have_sigcontext_hack=no, |
928 |
|
dnl When cross-compiling, do not assume anything. |
929 |
|
ac_cv_have_sigcontext_hack=no |
930 |
|
) |
956 |
|
|
957 |
|
dnl Can we do Video on SEGV Signals ? |
958 |
|
CAN_VOSF=no |
959 |
< |
if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
959 |
> |
if [[ -n "$sigsegv_recovery" ]]; then |
960 |
|
CAN_VOSF=yes |
961 |
|
fi |
962 |
|
|
963 |
+ |
dnl A dummy program that returns always true |
964 |
+ |
AC_PATH_PROG([BLESS], "true") |
965 |
+ |
|
966 |
|
dnl Determine the addressing mode to use |
967 |
|
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
968 |
|
ADDRESSING_MODE="real" |
973 |
|
case $am in |
974 |
|
real) |
975 |
|
dnl Requires ability to mmap() Low Memory globals |
976 |
< |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
976 |
> |
if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then |
977 |
|
continue |
978 |
|
fi |
979 |
< |
dnl Requires VOSF screen updates |
979 |
> |
dnl Requires VOSF screen updates |
980 |
|
if [[ "x$CAN_VOSF" = "xno" ]]; then |
981 |
|
continue |
982 |
|
fi |
984 |
|
ADDRESSING_MODE="real" |
985 |
|
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
986 |
|
DEFINES="$DEFINES -DREAL_ADDRESSING" |
987 |
+ |
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
988 |
+ |
BLESS=Darwin/lowmem |
989 |
+ |
LDFLAGS="$LDFLAGS -pagezero_size 0x2000" |
990 |
+ |
fi |
991 |
|
break |
992 |
|
;; |
993 |
|
direct) |
1082 |
|
fi |
1083 |
|
fi |
1084 |
|
|
1085 |
+ |
dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4 |
1086 |
+ |
dnl However, there are some corner cases exposed on x86-64 |
1087 |
+ |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1088 |
+ |
SAVED_CXXFLAGS="$CXXFLAGS" |
1089 |
+ |
CXXFLAGS="$CXXFLAGS -fno-gcse-sm" |
1090 |
+ |
AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [ |
1091 |
+ |
AC_LANG_SAVE |
1092 |
+ |
AC_LANG_CPLUSPLUS |
1093 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no]) |
1094 |
+ |
AC_LANG_RESTORE |
1095 |
+ |
]) |
1096 |
+ |
if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then |
1097 |
+ |
CXXFLAGS="$SAVED_CXXFLAGS" |
1098 |
+ |
fi |
1099 |
+ |
fi |
1100 |
+ |
|
1101 |
|
dnl Select appropriate CPU source and REGPARAM define. |
1102 |
|
ASM_OPTIMIZATIONS=none |
1103 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
1122 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
1123 |
|
ASM_OPTIMIZATIONS="x86-64" |
1124 |
|
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1125 |
+ |
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" |
1126 |
+ |
CAN_JIT=yes |
1127 |
+ |
WANT_33BIT_ADDRESSING=yes |
1128 |
|
fi |
1129 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1130 |
|
dnl SPARC CPU |
1181 |
|
JITSRCS="" |
1182 |
|
fi |
1183 |
|
|
1184 |
+ |
dnl Use 33-bit memory addressing? |
1185 |
+ |
if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then |
1186 |
+ |
use_33bit_addressing=yes |
1187 |
+ |
fi |
1188 |
+ |
AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing", |
1189 |
+ |
[Define to use 33-bit memory addressing on 64-bit JIT capable systems.]) |
1190 |
+ |
|
1191 |
|
dnl Utility macro used by next two tests. |
1192 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
1193 |
|
dnl commands examining object file, |
1385 |
|
|
1386 |
|
dnl Remove the "-g" option if set for GCC. |
1387 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1388 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'` |
1389 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1388 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'` |
1389 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'` |
1390 |
|
fi |
1391 |
|
|
1392 |
|
dnl Or if we have -IPA (MIPSPro compilers) |
1402 |
|
AC_SUBST(SYSSRCS) |
1403 |
|
AC_SUBST(CPUINCLUDES) |
1404 |
|
AC_SUBST(CPUSRCS) |
1405 |
+ |
AC_SUBST(BLESS) |
1406 |
+ |
AC_SUBST(KEYCODES) |
1407 |
|
AC_CONFIG_FILES([Makefile]) |
1408 |
|
AC_OUTPUT |
1409 |
|
|
1411 |
|
echo |
1412 |
|
echo Basilisk II configuration summary: |
1413 |
|
echo |
1414 |
+ |
echo SDL support ............................ : $SDL_SUPPORT |
1415 |
|
echo XFree86 DGA support .................... : $WANT_XF86_DGA |
1416 |
|
echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE |
1417 |
|
echo fbdev DGA support ...................... : $WANT_FBDEV_DGA |
1425 |
|
echo Floating-Point emulation core .......... : $FPE_CORE |
1426 |
|
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS |
1427 |
|
echo Addressing mode ........................ : $ADDRESSING_MODE |
1428 |
+ |
echo Bad memory access recovery type ........ : $sigsegv_recovery |
1429 |
|
echo |
1430 |
|
echo "Configuration done. Now type \"make\" (or \"gmake\")." |