13 |
|
AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes]) |
14 |
|
AC_ARG_ENABLE(ppc-emulator, [ --enable-ppc-emulator use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto]) |
15 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
16 |
< |
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
16 |
> |
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=no]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=no]) |
17 |
|
AC_ARG_ENABLE(vosf, [ --enable-vosf enable video on SEGV signals [default=yes]], [WANT_VOSF=$enableval], [WANT_VOSF=yes]) |
18 |
|
AC_ARG_WITH(esd, [ --with-esd support ESD for sound under Linux/FreeBSD [default=yes]], [WANT_ESD=$withval], [WANT_ESD=yes]) |
19 |
|
AC_ARG_WITH(gtk, [ --with-gtk use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes]) |
20 |
|
AC_ARG_WITH(mon, [ --with-mon use mon as debugger [default=yes]], [WANT_MON=$withval], [WANT_MON=yes]) |
21 |
|
AC_ARG_WITH(dgcc, [ --with-dgcc=COMPILER use C++ COMPILER to compile synthetic opcodes], [DYNGEN_CC=$withval]) |
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 |
+ |
|
27 |
|
dnl Checks for programs. |
28 |
|
AC_PROG_CC |
29 |
|
AC_PROG_CPP |
90 |
|
dnl Checks for libraries. |
91 |
|
AC_CHECK_LIB(posix4, sem_init) |
92 |
|
|
93 |
< |
dnl We need X11. |
94 |
< |
AC_PATH_XTRA |
95 |
< |
if [[ "x$no_x" = "xyes" ]]; then |
96 |
< |
AC_MSG_ERROR([You need X11 to run SheepShaver.]) |
97 |
< |
fi |
98 |
< |
CFLAGS="$CFLAGS $X_CFLAGS" |
99 |
< |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
100 |
< |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
93 |
> |
dnl Do we need SDL? |
94 |
> |
WANT_SDL=no |
95 |
> |
SDL_SUPPORT="none" |
96 |
> |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
97 |
> |
WANT_SDL=yes |
98 |
> |
WANT_XF86_DGA=no |
99 |
> |
WANT_XF86_VIDMODE=no |
100 |
> |
WANT_FBDEV_DGA=no |
101 |
> |
SDL_SUPPORT="video" |
102 |
> |
fi |
103 |
> |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
104 |
> |
AC_PATH_PROG(sdl_config, "sdl-config") |
105 |
> |
if [[ -n "$sdl_config" ]]; then |
106 |
> |
sdl_cflags=`$sdl_config --cflags` |
107 |
> |
if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then |
108 |
> |
sdl_libs=`$sdl_config --static-libs` |
109 |
> |
else |
110 |
> |
sdl_libs=`$sdl_config --libs` |
111 |
> |
fi |
112 |
> |
CFLAGS="$CFLAGS $sdl_cflags" |
113 |
> |
CXXFLAGS="$CXXFLAGS $sdl_cflags" |
114 |
> |
LIBS="$LIBS $sdl_libs" |
115 |
> |
else |
116 |
> |
WANT_SDL=no |
117 |
> |
fi |
118 |
> |
fi |
119 |
> |
|
120 |
> |
dnl We need X11, if not using SDL. |
121 |
> |
if [[ "x$WANT_SDL" = "xno" ]]; then |
122 |
> |
AC_PATH_XTRA |
123 |
> |
if [[ "x$no_x" = "xyes" ]]; then |
124 |
> |
AC_MSG_ERROR([You need X11 to run SheepShaver.]) |
125 |
> |
fi |
126 |
> |
CFLAGS="$CFLAGS $X_CFLAGS" |
127 |
> |
CXXFLAGS="$CXXFLAGS $X_CFLAGS" |
128 |
> |
LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" |
129 |
> |
fi |
130 |
|
|
131 |
|
dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL. |
132 |
|
HAVE_PTHREADS=yes |
216 |
|
AC_CHECK_HEADERS(mach/vm_map.h mach/mach_init.h sys/mman.h) |
217 |
|
AC_CHECK_HEADERS(sys/time.h sys/times.h) |
218 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h byteswap.h) |
219 |
< |
AC_CHECK_HEADER(mmintrin.h, [have_mmintrin_h=yes]) |
187 |
< |
AC_CHECK_HEADER(xmmintrin.h, [have_xmmintrin_h=yes]) |
188 |
< |
AC_CHECK_HEADER(emmintrin.h, [have_emmintrin_h=yes]) |
219 |
> |
AC_CHECK_HEADERS(linux/if.h linux/if_tun.h net/if.h net/if_tun.h) |
220 |
|
|
221 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
222 |
|
AC_C_BIGENDIAN |
252 |
|
fi |
253 |
|
|
254 |
|
dnl Checks for library functions. |
255 |
< |
AC_CHECK_FUNCS(strdup cfmakeraw) |
255 |
> |
AC_CHECK_FUNCS(strdup strlcpy cfmakeraw) |
256 |
|
AC_CHECK_FUNCS(nanosleep) |
257 |
|
AC_CHECK_FUNCS(sigaction signal) |
258 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
259 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
260 |
+ |
AC_CHECK_FUNCS(posix_memalign memalign valloc) |
261 |
|
|
262 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
263 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
294 |
|
fi |
295 |
|
;; |
296 |
|
esac |
297 |
< |
SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
297 |
> |
|
298 |
> |
dnl SDL overrides |
299 |
> |
if [[ "x$WANT_SDL" = "xyes" ]]; then |
300 |
> |
AC_DEFINE(USE_SDL, 1, [Define to enble SDL support]) |
301 |
> |
fi |
302 |
> |
if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then |
303 |
> |
VIDEOSRCS="../SDL/video_sdl.cpp ../dummy/clip_dummy.cpp" |
304 |
> |
AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support]) |
305 |
> |
else |
306 |
> |
VIDEOSRCS="video_x.cpp clip_unix.cpp" |
307 |
> |
fi |
308 |
> |
|
309 |
> |
SYSSRCS="$VIDEOSRCS $SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
310 |
|
|
311 |
|
dnl Define a macro that translates a yesno-variable into a C macro definition |
312 |
|
dnl to be put into the config.h file |
319 |
|
fi |
320 |
|
]) |
321 |
|
|
322 |
+ |
dnl Check that the host supports TUN/TAP devices |
323 |
+ |
AC_CACHE_CHECK([whether TUN/TAP is supported], |
324 |
+ |
ac_cv_tun_tap_support, [ |
325 |
+ |
AC_TRY_COMPILE([ |
326 |
+ |
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) |
327 |
+ |
#include <linux/if.h> |
328 |
+ |
#include <linux/if_tun.h> |
329 |
+ |
#endif |
330 |
+ |
#if defined(HAVE_NET_IF_H) && defined(HAVE_NET_IF_TUN_H) |
331 |
+ |
#include <net/if.h> |
332 |
+ |
#include <net/if_tun.h> |
333 |
+ |
#endif |
334 |
+ |
], [ |
335 |
+ |
struct ifreq ifr; |
336 |
+ |
memset(&ifr, 0, sizeof(ifr)); |
337 |
+ |
ifr.ifr_flags = IFF_TAP | IFF_NO_PI; |
338 |
+ |
], |
339 |
+ |
ac_cv_tun_tap_support=yes, ac_cv_tun_tap_support=no |
340 |
+ |
) |
341 |
+ |
]) |
342 |
+ |
AC_TRANSLATE_DEFINE(ENABLE_TUNTAP, "$ac_cv_tun_tap_support", |
343 |
+ |
[Define if your system supports TUN/TAP devices.]) |
344 |
+ |
|
345 |
|
dnl Various checks if the system supports vm_allocate() and the like functions. |
346 |
|
have_mach_vm=no |
347 |
|
if [[ "x$ac_cv_func_vm_allocate" = "xyes" -a "x$ac_cv_func_vm_deallocate" = "xyes" -a \ |
595 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
596 |
|
#include "vm_alloc.cpp" |
597 |
|
#include "sigsegv.cpp" |
531 |
– |
], [ |
532 |
– |
sigsegv_recovery=mach |
533 |
– |
ac_cv_have_mach_exceptions=yes |
598 |
|
], |
599 |
+ |
ac_cv_have_mach_exceptions=yes, |
600 |
|
ac_cv_have_mach_exceptions=no, |
601 |
|
dnl When cross-compiling, do not assume anything. |
602 |
|
ac_cv_have_mach_exceptions=no |
604 |
|
AC_LANG_RESTORE |
605 |
|
] |
606 |
|
) |
607 |
+ |
if [[ "$ac_cv_have_mach_exceptions" = "yes" ]]; then |
608 |
+ |
sigsegv_recovery=mach |
609 |
+ |
fi |
610 |
|
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
611 |
|
[Define if your system supports Mach exceptions.]) |
612 |
|
|
621 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
622 |
|
#include "vm_alloc.cpp" |
623 |
|
#include "sigsegv.cpp" |
556 |
– |
], [ |
557 |
– |
sigsegv_recovery=siginfo |
558 |
– |
ac_cv_have_extended_signals=yes |
624 |
|
], |
625 |
+ |
ac_cv_have_extended_signals=yes, |
626 |
|
ac_cv_have_extended_signals=no, |
627 |
|
dnl When cross-compiling, do not assume anything. |
628 |
|
ac_cv_have_extended_signals=no |
630 |
|
AC_LANG_RESTORE |
631 |
|
] |
632 |
|
) |
633 |
+ |
if [[ "$ac_cv_have_extended_signals" = "yes" ]]; then |
634 |
+ |
sigsegv_recovery=siginfo |
635 |
+ |
fi |
636 |
|
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
637 |
|
[Define if your system support extended signals.]) |
638 |
|
fi |
648 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
649 |
|
#include "vm_alloc.cpp" |
650 |
|
#include "sigsegv.cpp" |
582 |
– |
], [ |
583 |
– |
sigsegv_recovery=sigcontext |
584 |
– |
ac_cv_have_sigcontext_hack=yes |
651 |
|
], |
652 |
+ |
ac_cv_have_sigcontext_hack=yes, |
653 |
|
ac_cv_have_sigcontext_hack=no, |
654 |
|
dnl When cross-compiling, do not assume anything. |
655 |
|
ac_cv_have_sigcontext_hack=no |
656 |
|
) |
657 |
|
AC_LANG_RESTORE |
658 |
|
]) |
659 |
+ |
if [[ "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
660 |
+ |
sigsegv_recovery=sigcontext |
661 |
+ |
fi |
662 |
|
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack", |
663 |
|
[Define if we know a hack to replace siginfo_t->si_addr member.]) |
664 |
|
fi |
697 |
|
fi |
698 |
|
|
699 |
|
dnl Platform specific binary postprocessor |
700 |
< |
BLESS=/bin/true |
700 |
> |
AC_PATH_PROG(BLESS, "true") |
701 |
|
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
702 |
|
BLESS=Darwin/lowmem |
703 |
|
LDFLAGS="$LDFLAGS -pagezero_size 0x3000" |
798 |
|
else |
799 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -malign-functions=0" |
800 |
|
fi |
801 |
< |
if [[ "x$have_mmintrin_h" = "xyes" ]]; then |
802 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx" |
803 |
< |
fi |
804 |
< |
if [[ "x$have_xmmintrin_h" = "xyes" ]]; then |
805 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse" |
806 |
< |
fi |
807 |
< |
if [[ "x$have_emmintrin_h" = "xyes" ]]; then |
808 |
< |
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2" |
809 |
< |
fi |
801 |
> |
saved_CPPFLAGS=$CPPFLAGS |
802 |
> |
CPPFLAGS="$CPPFLAGS -mmmx" |
803 |
> |
AC_CHECK_HEADERS(mmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -mmmx"]) |
804 |
> |
CPPFLAGS="$CPPFLAGS -msse" |
805 |
> |
AC_CHECK_HEADERS(xmmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse"]) |
806 |
> |
CPPFLAGS="$CPPFLAGS -msse2" |
807 |
> |
AC_CHECK_HEADERS(emmintrin.h, [DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -msse2"]) |
808 |
> |
CPPFLAGS=$saved_CPPFLAGS |
809 |
> |
;; |
810 |
> |
x86_64) |
811 |
> |
AC_CHECK_HEADERS(mmintrin.h xmmintrin.h emmintrin.h) |
812 |
|
;; |
813 |
|
esac |
814 |
|
DYNGEN_OP_FLAGS="$DYNGEN_OP_FLAGS -finline-limit=10000" |
874 |
|
echo |
875 |
|
echo SheepShaver configuration summary: |
876 |
|
echo |
877 |
+ |
echo SDL support ...................... : $SDL_SUPPORT |
878 |
|
echo XFree86 DGA support .............. : $WANT_XF86_DGA |
879 |
|
echo XFree86 VidMode support .......... : $WANT_XF86_VIDMODE |
880 |
|
echo Using PowerPC emulator ........... : $EMULATED_PPC |