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. |
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 mach/mach.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 sys/ioctl.h sys/filio.h sys/bitypes.h sys/wait.h sys/select.h) |
279 |
+ |
AC_CHECK_HEADERS(arpa/inet.h) |
280 |
+ |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h, [], [], [ |
281 |
+ |
#ifdef HAVE_SYS_SOCKET_H |
282 |
+ |
#include <sys/socket.h> |
283 |
+ |
#endif |
284 |
+ |
]) |
285 |
+ |
AC_CHECK_HEADERS(AvailabilityMacros.h) |
286 |
|
|
287 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
288 |
|
AC_C_BIGENDIAN |
297 |
|
AC_CHECK_SIZEOF(long double, 12) |
298 |
|
AC_CHECK_SIZEOF(void *, 4) |
299 |
|
AC_TYPE_OFF_T |
300 |
< |
AC_CHECK_TYPE(loff_t, off_t) |
301 |
< |
AC_CHECK_TYPE(caddr_t, [char *]) |
300 |
> |
AC_CHECK_TYPES(loff_t) |
301 |
> |
AC_CHECK_TYPES(caddr_t) |
302 |
|
AC_TYPE_SIZE_T |
303 |
|
AC_TYPE_SIGNAL |
304 |
|
AC_HEADER_TIME |
322 |
|
fi |
323 |
|
|
324 |
|
dnl Checks for library functions. |
325 |
< |
AC_CHECK_FUNCS(strdup cfmakeraw) |
325 |
> |
AC_CHECK_FUNCS(strdup strerror cfmakeraw) |
326 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
327 |
|
AC_CHECK_FUNCS(sigaction signal) |
328 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
329 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
330 |
+ |
AC_CHECK_FUNCS(inet_aton) |
331 |
|
|
332 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
333 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
354 |
|
*-*-sco3.2v5*) |
355 |
|
no_dev_ptmx=1 |
356 |
|
;; |
357 |
+ |
*-*-cygwin*) |
358 |
+ |
no_dev_ptmx=1 |
359 |
+ |
;; |
360 |
|
esac |
361 |
|
|
362 |
|
if test -z "$no_dev_ptmx" ; then |
379 |
|
dnl (end of code from openssh-3.2.2p1 configure.ac) |
380 |
|
|
381 |
|
|
382 |
+ |
dnl AC_CHECK_FRAMEWORK($1=NAME, $2=INCLUDES) |
383 |
+ |
AC_DEFUN(AC_CHECK_FRAMEWORK, [ |
384 |
+ |
AS_VAR_PUSHDEF([ac_Framework], [ac_cv_framework_$1])dnl |
385 |
+ |
AC_CACHE_CHECK([whether compiler supports framework $1], |
386 |
+ |
ac_Framework, [ |
387 |
+ |
saved_LIBS="$LIBS" |
388 |
+ |
LIBS="$LIBS -framework $1" |
389 |
+ |
AC_TRY_LINK( |
390 |
+ |
[$2], [int main(void) { return 0; }], |
391 |
+ |
[AS_VAR_SET(ac_Framework, yes)], [AS_VAR_SET(ac_Framework, no); LIBS="$saved_LIBS"] |
392 |
+ |
) |
393 |
+ |
]) |
394 |
+ |
AS_IF([test AS_VAR_GET(ac_Framework) = yes], |
395 |
+ |
[AC_DEFINE(AS_TR_CPP(HAVE_FRAMEWORK_$1), 1, [Define if framework $1 is available.])] |
396 |
+ |
) |
397 |
+ |
AS_VAR_POPDEF([ac_Framework])dnl |
398 |
+ |
]) |
399 |
+ |
|
400 |
+ |
dnl Check for some MacOS X frameworks |
401 |
+ |
AC_CHECK_FRAMEWORK(Carbon, [#include <Carbon/Carbon.h>]) |
402 |
+ |
AC_CHECK_FRAMEWORK(IOKit, [#include <IOKit/IOKitLib.h>]) |
403 |
+ |
|
404 |
|
dnl Select system-dependant source files. |
405 |
|
SERIALSRC=serial_unix.cpp |
406 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
461 |
|
dnl Do a test compile of an empty function |
462 |
|
AC_TRY_COMPILE(,, [AC_MSG_RESULT(yes); HAVE_IPA=yes], AC_MSG_RESULT(no)) |
463 |
|
CFLAGS="$ocflags" |
464 |
< |
|
464 |
> |
;; |
465 |
> |
darwin*) |
466 |
> |
if [[ "x$ac_cv_framework_IOKit" = "xyes" ]]; then |
467 |
> |
EXTRASYSSRCS="../MacOSX/sys_darwin.cpp" |
468 |
> |
fi |
469 |
> |
;; |
470 |
> |
cygwin*) |
471 |
> |
SERIALSRC="../dummy/serial_dummy.cpp" |
472 |
> |
EXTRASYSSRCS="../Windows/BasiliskII.rc" |
473 |
|
;; |
474 |
|
esac |
475 |
+ |
dnl SDL overrides |
476 |
+ |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
477 |
+ |
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
478 |
+ |
fi |
479 |
+ |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
480 |
+ |
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support]) |
481 |
+ |
VIDEOSRCS="../SDL/video_sdl.cpp" |
482 |
+ |
KEYCODES="../SDL/keycodes" |
483 |
+ |
if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then |
484 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" |
485 |
+ |
else |
486 |
+ |
case "$target_os" in |
487 |
+ |
cygwin*) |
488 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp" |
489 |
+ |
;; |
490 |
+ |
*) |
491 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" |
492 |
+ |
;; |
493 |
+ |
esac |
494 |
+ |
fi |
495 |
+ |
else |
496 |
+ |
VIDEOSRCS="video_x.cpp" |
497 |
+ |
KEYCODES="keycodes" |
498 |
+ |
EXTRASYSSRCS="$EXTRASYSSRCS clip_unix.cpp" |
499 |
+ |
fi |
500 |
+ |
if [[ "x$WANT_SDL_AUDIO" = "xyes" ]]; then |
501 |
+ |
AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support]) |
502 |
+ |
AUDIOSRC="../SDL/audio_sdl.cpp" |
503 |
+ |
fi |
504 |
|
|
505 |
|
dnl Use 68k CPU natively? |
506 |
|
WANT_NATIVE_M68K=no |
516 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
517 |
|
AUDIOSRC=../dummy/audio_dummy.cpp |
518 |
|
fi |
519 |
< |
SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
519 |
> |
SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
520 |
|
|
521 |
|
dnl Define a macro that translates a yesno-variable into a C macro definition |
522 |
|
dnl to be put into the config.h file |
529 |
|
fi |
530 |
|
]) |
531 |
|
|
532 |
+ |
dnl Check that the host supports TUN/TAP devices |
533 |
+ |
AC_CACHE_CHECK([whether TUN/TAP is supported], |
534 |
+ |
ac_cv_tun_tap_support, [ |
535 |
+ |
AC_TRY_COMPILE([ |
536 |
+ |
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) |
537 |
+ |
#include <linux/if.h> |
538 |
+ |
#include <linux/if_tun.h> |
539 |
+ |
#endif |
540 |
+ |
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H) |
541 |
+ |
#include <net/if.h> |
542 |
+ |
#include <net/if_tun.h> |
543 |
+ |
#endif |
544 |
+ |
], [ |
545 |
+ |
struct ifreq ifr; |
546 |
+ |
memset(&ifr, 0, sizeof(ifr)); |
547 |
+ |
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
548 |
+ |
], |
549 |
+ |
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no |
550 |
+ |
) |
551 |
+ |
]) |
552 |
+ |
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support", |
553 |
+ |
[Define if your system supports TUN/TAP devices.]) |
554 |
+ |
|
555 |
|
dnl Various checks if the system supports vm_allocate() and the like functions. |
556 |
|
have_mach_vm=no |
557 |
|
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \ |
698 |
|
|
699 |
|
fi dnl HAVE_MMAP_VM |
700 |
|
|
701 |
+ |
dnl Check if we can modify the __PAGEZERO segment for use as Low Memory |
702 |
+ |
AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x2000], |
703 |
+ |
ac_cv_pagezero_hack, [ |
704 |
+ |
ac_cv_pagezero_hack=no |
705 |
+ |
if AC_TRY_COMMAND([Darwin/testlmem.sh 0x2000]); then |
706 |
+ |
ac_cv_pagezero_hack=yes |
707 |
+ |
dnl might as well skip the test for mmap-able low memory |
708 |
+ |
ac_cv_can_map_lm=no |
709 |
+ |
fi |
710 |
+ |
]) |
711 |
+ |
AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack", |
712 |
+ |
[Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.]) |
713 |
+ |
|
714 |
|
dnl Check if we can mmap 0x2000 bytes from 0x0000 |
715 |
|
AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000], |
716 |
|
ac_cv_can_map_lm, [ |
734 |
|
] |
735 |
|
) |
736 |
|
|
737 |
+ |
dnl Check if we have POSIX shared memory support |
738 |
+ |
AC_CACHE_CHECK([whether POSIX shared memory is working], |
739 |
+ |
ac_cv_have_posix_shm, [ |
740 |
+ |
AC_LANG_SAVE |
741 |
+ |
AC_LANG_CPLUSPLUS |
742 |
+ |
AC_TRY_RUN([ |
743 |
+ |
#define HAVE_POSIX_SHM |
744 |
+ |
#include "vm_alloc.cpp" |
745 |
+ |
int main(void) { /* returns 0 if we have working POSIX shm */ |
746 |
+ |
if (vm_init() < 0) exit(2); |
747 |
+ |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
748 |
+ |
if (m1 == VM_MAP_FAILED) exit(3); |
749 |
+ |
vm_exit(); exit(0); |
750 |
+ |
} |
751 |
+ |
], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no, |
752 |
+ |
dnl When cross-compiling, do not assume anything. |
753 |
+ |
ac_cv_have_posix_shm="guessing no" |
754 |
+ |
) |
755 |
+ |
AC_LANG_RESTORE |
756 |
+ |
] |
757 |
+ |
) |
758 |
+ |
AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm", |
759 |
+ |
[Define if your system supports POSIX shared memory.]) |
760 |
+ |
|
761 |
+ |
dnl Check if we have working 33-bit memory addressing |
762 |
+ |
AC_CACHE_CHECK([whether 33-bit memory addressing is working], |
763 |
+ |
ac_cv_have_33bit_addressing, [ |
764 |
+ |
AC_LANG_SAVE |
765 |
+ |
AC_LANG_CPLUSPLUS |
766 |
+ |
AC_TRY_RUN([ |
767 |
+ |
#define USE_33BIT_ADDRESSING 1 |
768 |
+ |
#include "vm_alloc.cpp" |
769 |
+ |
int main(void) { /* returns 0 if we have working 33-bit addressing */ |
770 |
+ |
if (sizeof(void *) < 8) exit(1); |
771 |
+ |
if (vm_init() < 0) exit(2); |
772 |
+ |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
773 |
+ |
if (m1 == VM_MAP_FAILED) exit(3); |
774 |
+ |
char *m2 = m1 + (1L << 32); |
775 |
+ |
m1[0] = 0x12; if (m2[0] != 0x12) exit(4); |
776 |
+ |
m2[0] = 0x34; if (m1[0] != 0x34) exit(5); |
777 |
+ |
vm_exit(); exit(0); |
778 |
+ |
} |
779 |
+ |
], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no, |
780 |
+ |
dnl When cross-compiling, do not assume anything. |
781 |
+ |
ac_cv_have_33bit_addressing="guessing no" |
782 |
+ |
) |
783 |
+ |
AC_LANG_RESTORE |
784 |
+ |
] |
785 |
+ |
) |
786 |
+ |
|
787 |
|
dnl Check signal handlers need to be reinstalled |
788 |
|
AC_CACHE_CHECK([whether signal handlers need to be reinstalled], |
789 |
|
ac_cv_signal_need_reinstall, [ |
869 |
|
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
870 |
|
[Define if your system supports Mach exceptions.]) |
871 |
|
|
872 |
+ |
dnl Check if Windows exceptions are supported. |
873 |
+ |
AC_CACHE_CHECK([whether your system supports Windows exceptions], |
874 |
+ |
ac_cv_have_win32_exceptions, [ |
875 |
+ |
AC_LANG_SAVE |
876 |
+ |
AC_LANG_CPLUSPLUS |
877 |
+ |
AC_TRY_RUN([ |
878 |
+ |
#define HAVE_WIN32_EXCEPTIONS 1 |
879 |
+ |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
880 |
+ |
#include "vm_alloc.cpp" |
881 |
+ |
#include "sigsegv.cpp" |
882 |
+ |
], [ |
883 |
+ |
sigsegv_recovery=win32 |
884 |
+ |
ac_cv_have_win32_exceptions=yes |
885 |
+ |
], |
886 |
+ |
ac_cv_have_win32_exceptions=no, |
887 |
+ |
dnl When cross-compiling, do not assume anything. |
888 |
+ |
ac_cv_have_win32_exceptions=no |
889 |
+ |
) |
890 |
+ |
AC_LANG_RESTORE |
891 |
+ |
] |
892 |
+ |
) |
893 |
+ |
AC_TRANSLATE_DEFINE(HAVE_WIN32_EXCEPTIONS, "$ac_cv_have_win32_exceptions", |
894 |
+ |
[Define if your system supports Windows exceptions.]) |
895 |
+ |
|
896 |
|
dnl Otherwise, check if extended signals are supported. |
897 |
|
if [[ -z "$sigsegv_recovery" ]]; then |
898 |
|
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
970 |
|
CAN_VOSF=yes |
971 |
|
fi |
972 |
|
|
973 |
+ |
dnl A dummy program that returns always true |
974 |
+ |
AC_PATH_PROG([BLESS], "true") |
975 |
+ |
|
976 |
|
dnl Determine the addressing mode to use |
977 |
|
if [[ "x$WANT_NATIVE_M68K" = "xyes" ]]; then |
978 |
|
ADDRESSING_MODE="real" |
983 |
|
case $am in |
984 |
|
real) |
985 |
|
dnl Requires ability to mmap() Low Memory globals |
986 |
< |
if [[ "x$ac_cv_can_map_lm" = "xno" ]]; then |
986 |
> |
if [[ "x$ac_cv_can_map_lm$ac_cv_pagezero_hack" = "xnono" ]]; then |
987 |
|
continue |
988 |
|
fi |
989 |
< |
dnl Requires VOSF screen updates |
989 |
> |
dnl Requires VOSF screen updates |
990 |
|
if [[ "x$CAN_VOSF" = "xno" ]]; then |
991 |
|
continue |
992 |
|
fi |
994 |
|
ADDRESSING_MODE="real" |
995 |
|
WANT_VOSF=yes dnl we can use VOSF and we need it actually |
996 |
|
DEFINES="$DEFINES -DREAL_ADDRESSING" |
997 |
+ |
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
998 |
+ |
BLESS=Darwin/lowmem |
999 |
+ |
LDFLAGS="$LDFLAGS -pagezero_size 0x2000" |
1000 |
+ |
fi |
1001 |
|
break |
1002 |
|
;; |
1003 |
|
direct) |
1065 |
|
#endif |
1066 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
1067 |
|
|
1068 |
+ |
dnl Check for ICC. |
1069 |
+ |
AC_MSG_CHECKING(for ICC) |
1070 |
+ |
HAVE_ICC=no |
1071 |
+ |
if $CXX -V -v 2>&1 | grep -q "Intel(R) C++ Compiler"; then |
1072 |
+ |
HAVE_ICC=yes |
1073 |
+ |
fi |
1074 |
+ |
AC_MSG_RESULT($HAVE_ICC) |
1075 |
+ |
|
1076 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
1077 |
|
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
1078 |
|
dnl the frame pointer. |
1086 |
|
dnl Official: probably gcc-3.1 (mainline CVS) |
1087 |
|
dnl Mandrake: gcc-2.96 >= 0.59mdk, gcc-3.0.1 >= 0.1mdk |
1088 |
|
dnl Red Hat : gcc-2.96 >= 89, gcc-3.0 >= 1 |
1089 |
< |
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1089 |
> |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1090 |
|
SAVED_CXXFLAGS="$CXXFLAGS" |
1091 |
|
CXXFLAGS="$CXXFLAGS -fno-merge-constants" |
1092 |
|
AC_CACHE_CHECK([whether GCC supports constants merging], ac_cv_gcc_constants_merging, [ |
1100 |
|
fi |
1101 |
|
fi |
1102 |
|
|
1103 |
+ |
dnl Store motion was introduced in 3.3-hammer branch and any gcc >= 3.4 |
1104 |
+ |
dnl However, there are some corner cases exposed on x86-64 |
1105 |
+ |
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_ICC" = "xno" ]]; then |
1106 |
+ |
SAVED_CXXFLAGS="$CXXFLAGS" |
1107 |
+ |
CXXFLAGS="$CXXFLAGS -fno-gcse-sm" |
1108 |
+ |
AC_CACHE_CHECK([whether GCC supports store motion], ac_cv_gcc_store_motion, [ |
1109 |
+ |
AC_LANG_SAVE |
1110 |
+ |
AC_LANG_CPLUSPLUS |
1111 |
+ |
AC_TRY_COMPILE([],[],[ac_cv_gcc_store_motion=yes],[ac_cv_gcc_store_motion=no]) |
1112 |
+ |
AC_LANG_RESTORE |
1113 |
+ |
]) |
1114 |
+ |
if [[ "x$ac_cv_gcc_store_motion" != "xyes" ]]; then |
1115 |
+ |
CXXFLAGS="$SAVED_CXXFLAGS" |
1116 |
+ |
fi |
1117 |
+ |
fi |
1118 |
+ |
|
1119 |
+ |
dnl Add -fno-strict-aliasing for slirp sources |
1120 |
+ |
if [[ "x$HAVE_GCC30" = "xyes" ]]; then |
1121 |
+ |
SAVED_CXXFLAGS="$CXXFLAGS" |
1122 |
+ |
CFLAGS="$CFLAGS -fno-strict-aliasing" |
1123 |
+ |
AC_CACHE_CHECK([whether the compiler supports -fno-strict-aliasing], |
1124 |
+ |
ac_cv_gcc_no_strict_aliasing, [ |
1125 |
+ |
AC_TRY_COMPILE([],[], |
1126 |
+ |
[ac_cv_gcc_no_strict_aliasing=yes; AC_SUBST(SLIRP_CFLAGS, "$CFLAGS")], |
1127 |
+ |
[ac_cv_gcc_no_strict_aliasing=no]) |
1128 |
+ |
]) |
1129 |
+ |
CFLAGS="$SAVED_CFLAGS" |
1130 |
+ |
fi |
1131 |
+ |
|
1132 |
|
dnl Select appropriate CPU source and REGPARAM define. |
1133 |
|
ASM_OPTIMIZATIONS=none |
1134 |
|
CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp" |
1153 |
|
if [[ "x$HAVE_GAS" = "xyes" ]]; then |
1154 |
|
ASM_OPTIMIZATIONS="x86-64" |
1155 |
|
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1156 |
+ |
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" |
1157 |
+ |
CAN_JIT=yes |
1158 |
+ |
WANT_33BIT_ADDRESSING=yes |
1159 |
|
fi |
1160 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1161 |
|
dnl SPARC CPU |
1212 |
|
JITSRCS="" |
1213 |
|
fi |
1214 |
|
|
1215 |
+ |
dnl Use 33-bit memory addressing? |
1216 |
+ |
if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then |
1217 |
+ |
use_33bit_addressing=yes |
1218 |
+ |
fi |
1219 |
+ |
AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing", |
1220 |
+ |
[Define to use 33-bit memory addressing on 64-bit JIT capable systems.]) |
1221 |
+ |
|
1222 |
|
dnl Utility macro used by next two tests. |
1223 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
1224 |
|
dnl commands examining object file, |
1416 |
|
|
1417 |
|
dnl Remove the "-g" option if set for GCC. |
1418 |
|
if [[ "x$HAVE_GCC27" = "xyes" ]]; then |
1419 |
< |
CFLAGS=`echo $CFLAGS | sed -e 's/-g//g'` |
1420 |
< |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g//g'` |
1419 |
> |
CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'` |
1420 |
> |
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'` |
1421 |
|
fi |
1422 |
|
|
1423 |
|
dnl Or if we have -IPA (MIPSPro compilers) |
1433 |
|
AC_SUBST(SYSSRCS) |
1434 |
|
AC_SUBST(CPUINCLUDES) |
1435 |
|
AC_SUBST(CPUSRCS) |
1436 |
+ |
AC_SUBST(BLESS) |
1437 |
+ |
AC_SUBST(KEYCODES) |
1438 |
|
AC_CONFIG_FILES([Makefile]) |
1439 |
|
AC_OUTPUT |
1440 |
|
|
1442 |
|
echo |
1443 |
|
echo Basilisk II configuration summary: |
1444 |
|
echo |
1445 |
+ |
echo SDL support ............................ : $SDL_SUPPORT |
1446 |
|
echo XFree86 DGA support .................... : $WANT_XF86_DGA |
1447 |
|
echo XFree86 VidMode support ................ : $WANT_XF86_VIDMODE |
1448 |
|
echo fbdev DGA support ...................... : $WANT_FBDEV_DGA |