34 |
|
#ifdef __powerpc__ |
35 |
|
yes |
36 |
|
#endif |
37 |
+ |
#ifdef __ppc__ |
38 |
+ |
yes |
39 |
+ |
#endif |
40 |
|
], [AC_MSG_RESULT(yes); HAVE_PPC=yes], AC_MSG_RESULT(no)) |
41 |
|
|
42 |
|
dnl We use native CPU if possible. |
96 |
|
|
97 |
|
dnl We need pthreads on non-PowerPC systems. Try libpthread first, then libc_r (FreeBSD), then PTL. |
98 |
|
HAVE_PTHREADS=yes |
99 |
< |
if [[ "x$EMULATED_PPC" = "xyes" ]]; then |
99 |
> |
case $EMULATED_PPC:$target_os in |
100 |
> |
no:linux*) |
101 |
> |
dnl We do have our own pthread_cancel() implementation |
102 |
> |
AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.]) |
103 |
> |
;; |
104 |
> |
*:*) |
105 |
|
AC_CHECK_LIB(pthread, pthread_create, , [ |
106 |
|
AC_CHECK_LIB(c_r, pthread_create, , [ |
107 |
|
AC_CHECK_LIB(PTL, pthread_create, , [ |
116 |
|
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then |
117 |
|
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.]) |
118 |
|
fi |
119 |
< |
else |
120 |
< |
dnl We do have our own pthread_cancel() implementation |
121 |
< |
AC_DEFINE(HAVE_PTHREAD_CANCEL, 1, [Define if you have the pthread_cancel function.]) |
114 |
< |
fi |
115 |
< |
|
116 |
< |
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
117 |
< |
SEMSRC= |
118 |
< |
AC_CHECK_FUNCS(sem_init, , [ |
119 |
> |
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
120 |
> |
SEMSRC= |
121 |
> |
AC_CHECK_FUNCS(sem_init, , [ |
122 |
|
if test "x$HAVE_PTHREADS" = "xyes"; then |
123 |
|
SEMSRC=posix_sem.cpp |
124 |
|
fi |
125 |
< |
]) |
125 |
> |
]) |
126 |
> |
;; |
127 |
> |
esac |
128 |
|
|
129 |
|
dnl We use XFree86 DGA if possible. |
130 |
|
if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then |
149 |
|
fi |
150 |
|
|
151 |
|
dnl We use GTK+ if possible. |
152 |
< |
UISRCS= |
152 |
> |
UISRCS=../dummy/prefs_editor_dummy.cpp |
153 |
|
if [[ "x$WANT_GTK" = "xyes" ]]; then |
154 |
|
AM_PATH_GTK(1.2.0, [ |
155 |
|
AC_DEFINE(ENABLE_GTK) |
201 |
|
AC_HEADER_TIME |
202 |
|
AC_STRUCT_TM |
203 |
|
|
204 |
+ |
dnl Check whether struct sigaction has sa_restorer member. |
205 |
+ |
AC_CACHE_CHECK([whether struct sigaction has sa_restorer], |
206 |
+ |
ac_cv_signal_sa_restorer, [ |
207 |
+ |
AC_TRY_COMPILE([ |
208 |
+ |
#include <signal.h> |
209 |
+ |
], [struct sigaction sa; sa.sa_restorer = 0;], |
210 |
+ |
ac_cv_signal_sa_restorer=yes, ac_cv_signal_sa_restorer=no, |
211 |
+ |
dnl When cross-compiling, do not assume anything. |
212 |
+ |
ac_cv_signal_sa_restorer=no |
213 |
+ |
) |
214 |
+ |
]) |
215 |
+ |
if [[ "x$ac_cv_signal_sa_restorer" = "xyes" ]]; then |
216 |
+ |
AC_DEFINE(HAVE_SIGNAL_SA_RESTORER) |
217 |
+ |
fi |
218 |
+ |
|
219 |
|
dnl Checks for library functions. |
220 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
221 |
|
AC_CHECK_FUNCS(nanosleep) |
222 |
|
AC_CHECK_FUNCS(sigaction signal) |
223 |
|
AC_CHECK_FUNCS(mmap mprotect munmap) |
224 |
|
AC_CHECK_FUNCS(vm_allocate vm_deallocate vm_protect) |
225 |
+ |
|
226 |
+ |
dnl Darwin seems to define mach_task_self() instead of task_self(). |
227 |
+ |
AC_CHECK_FUNCS(mach_task_self task_self) |
228 |
+ |
|
229 |
|
dnl We need clock_gettime() for better performance but it may drag |
230 |
|
dnl libpthread in, which we don't want for native ppc mode |
231 |
< |
if [[ "x$EMULATED_PPC" = "xyes" ]]; then |
231 |
> |
case $EMULATED_PPC:$target_os in |
232 |
> |
no:linux*) |
233 |
> |
;; |
234 |
> |
*:*) |
235 |
|
AC_SEARCH_LIBS(clock_gettime, [rt posix4]) |
236 |
|
AC_CHECK_FUNCS(clock_gettime) |
237 |
< |
fi |
237 |
> |
;; |
238 |
> |
esac |
239 |
|
|
240 |
|
dnl Select system-dependant sources. |
241 |
< |
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
242 |
< |
SYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S" |
243 |
< |
fi |
244 |
< |
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS" |
241 |
> |
SERIALSRC=serial_unix.cpp |
242 |
> |
ETHERSRC=../dummy/ether_dummy.cpp |
243 |
> |
SCSISRC=../dummy/scsi_dummy.cpp |
244 |
> |
AUDIOSRC=../dummy/audio_dummy.cpp |
245 |
> |
EXTRASYSSRCS= |
246 |
> |
case "$target_os" in |
247 |
> |
linux*) |
248 |
> |
ETHERSRC=Linux/ether_linux.cpp |
249 |
> |
AUDIOSRC=audio_oss_esd.cpp |
250 |
> |
SCSISRC=Linux/scsi_linux.cpp |
251 |
> |
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
252 |
> |
EXTRASYSSRCS="Linux/paranoia.cpp Linux/sheepthreads.c Linux/asm_linux.S" |
253 |
> |
fi |
254 |
> |
;; |
255 |
> |
darwin*) |
256 |
> |
if [[ "x$EMULATED_PPC" = "xno" ]]; then |
257 |
> |
EXTRASYSSRCS="Darwin/paranoia.cpp Linux/asm_linux.S" |
258 |
> |
fi |
259 |
> |
;; |
260 |
> |
esac |
261 |
> |
SYSSRCS="$SERIALSRC $ETHERSRC $SCSISRC $AUDIOSRC $SEMSRC $UISRCS $MONSRCS $EXTRASYSSRCS" |
262 |
|
|
263 |
|
dnl Define a macro that translates a yesno-variable into a C macro definition |
264 |
|
dnl to be put into the config.h file |
417 |
|
|
418 |
|
fi dnl HAVE_MMAP_VM |
419 |
|
|
420 |
< |
dnl Check if we can mmap 0x2000 bytes from 0x0000 |
421 |
< |
AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x2000], |
420 |
> |
dnl Check if we can modify the __PAGEZERO segment for use as Low Memory |
421 |
> |
AC_CACHE_CHECK([whether __PAGEZERO can be Low Memory area 0x0000-0x3000], |
422 |
> |
ac_cv_pagezero_hack, [ |
423 |
> |
ac_cv_pagezero_hack=no |
424 |
> |
if AC_TRY_COMMAND([Darwin/testlmem.sh 0x3000]); then |
425 |
> |
ac_cv_pagezero_hack=yes |
426 |
> |
dnl might as well skip the test for mmap-able low memory |
427 |
> |
ac_cv_can_map_lm=no |
428 |
> |
fi |
429 |
> |
]) |
430 |
> |
AC_TRANSLATE_DEFINE(PAGEZERO_HACK, "$ac_cv_pagezero_hack", |
431 |
> |
[Define if the __PAGEZERO Mach-O Low Memory Globals hack works on this system.]) |
432 |
> |
|
433 |
> |
dnl Check if we can mmap 0x3000 bytes from 0x0000 |
434 |
> |
AC_CACHE_CHECK([whether we can map Low Memory area 0x0000-0x3000], |
435 |
|
ac_cv_can_map_lm, [ |
436 |
|
AC_LANG_SAVE |
437 |
|
AC_LANG_CPLUSPLUS |
514 |
|
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall", |
515 |
|
[Define if your system requires sigactions to be reinstalled.]) |
516 |
|
|
517 |
< |
dnl Check if extended signals are supported. |
518 |
< |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
519 |
< |
ac_cv_have_extended_signals, [ |
517 |
> |
dnl Check if Mach exceptions supported. |
518 |
> |
AC_CACHE_CHECK([whether your system supports Mach exceptions], |
519 |
> |
ac_cv_have_mach_exceptions, [ |
520 |
|
AC_LANG_SAVE |
521 |
|
AC_LANG_CPLUSPLUS |
522 |
|
AC_TRY_RUN([ |
523 |
< |
#define HAVE_SIGINFO_T 1 |
523 |
> |
#define HAVE_MACH_EXCEPTIONS 1 |
524 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
525 |
|
#include "vm_alloc.cpp" |
526 |
|
#include "sigsegv.cpp" |
527 |
< |
], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no, |
527 |
> |
], [ |
528 |
> |
sigsegv_recovery=mach |
529 |
> |
ac_cv_have_mach_exceptions=yes |
530 |
> |
], |
531 |
> |
ac_cv_have_mach_exceptions=no, |
532 |
|
dnl When cross-compiling, do not assume anything. |
533 |
< |
ac_cv_have_extended_signals=no |
533 |
> |
ac_cv_have_mach_exceptions=no |
534 |
|
) |
535 |
|
AC_LANG_RESTORE |
536 |
|
] |
537 |
|
) |
538 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
539 |
< |
[Define if your system support extended signals.]) |
538 |
> |
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
539 |
> |
[Define if your system supports Mach exceptions.]) |
540 |
> |
|
541 |
> |
dnl Otherwise, check if extended signals are supported. |
542 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
543 |
> |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
544 |
> |
ac_cv_have_extended_signals, [ |
545 |
> |
AC_LANG_SAVE |
546 |
> |
AC_LANG_CPLUSPLUS |
547 |
> |
AC_TRY_RUN([ |
548 |
> |
#define HAVE_SIGINFO_T 1 |
549 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
550 |
> |
#include "vm_alloc.cpp" |
551 |
> |
#include "sigsegv.cpp" |
552 |
> |
], [ |
553 |
> |
sigsegv_recovery=siginfo |
554 |
> |
ac_cv_have_extended_signals=yes |
555 |
> |
], |
556 |
> |
ac_cv_have_extended_signals=no, |
557 |
> |
dnl When cross-compiling, do not assume anything. |
558 |
> |
ac_cv_have_extended_signals=no |
559 |
> |
) |
560 |
> |
AC_LANG_RESTORE |
561 |
> |
] |
562 |
> |
) |
563 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
564 |
> |
[Define if your system support extended signals.]) |
565 |
> |
fi |
566 |
|
|
567 |
|
dnl Otherwise, check for subterfuges. |
568 |
< |
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
568 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
569 |
|
AC_CACHE_CHECK([whether we then have a subterfuge for your system], |
570 |
|
ac_cv_have_sigcontext_hack, [ |
571 |
|
AC_LANG_SAVE |
575 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
576 |
|
#include "vm_alloc.cpp" |
577 |
|
#include "sigsegv.cpp" |
578 |
< |
], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no, |
578 |
> |
], [ |
579 |
> |
sigsegv_recovery=sigcontext |
580 |
> |
ac_cv_have_sigcontext_hack=yes |
581 |
> |
], |
582 |
> |
ac_cv_have_sigcontext_hack=no, |
583 |
|
dnl When cross-compiling, do not assume anything. |
584 |
|
ac_cv_have_sigcontext_hack=no |
585 |
|
) |
611 |
|
|
612 |
|
dnl Can we do Video on SEGV Signals ? |
613 |
|
CAN_VOSF=no |
614 |
< |
if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
614 |
> |
if [[ -n "$sigsegv_recovery" ]]; then |
615 |
|
CAN_VOSF=yes |
616 |
|
fi |
617 |
|
|
622 |
|
WANT_VOSF=no |
623 |
|
fi |
624 |
|
|
625 |
+ |
dnl Platform specific binary postprocessor |
626 |
+ |
BLESS=/bin/true |
627 |
+ |
if [[ "x$ac_cv_pagezero_hack" = "xyes" ]]; then |
628 |
+ |
BLESS=Darwin/lowmem |
629 |
+ |
LDFLAGS="$LDFLAGS -pagezero_size 0x3000" |
630 |
+ |
fi |
631 |
+ |
|
632 |
|
dnl Check for GCC 2.7 or higher. |
633 |
|
HAVE_GCC27=no |
634 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
757 |
|
AC_SUBST(DYNGEN_OP_FLAGS) |
758 |
|
AC_SUBST(SYSSRCS) |
759 |
|
AC_SUBST(CPUSRCS) |
760 |
+ |
AC_SUBST(BLESS) |
761 |
|
AC_OUTPUT(Makefile) |
762 |
|
|
763 |
|
dnl Print summary. |
772 |
|
echo ESD sound support ................ : $WANT_ESD |
773 |
|
echo GTK user interface ............... : $WANT_GTK |
774 |
|
echo mon debugger support ............. : $WANT_MON |
775 |
+ |
echo Bad memory access recovery type .. : $sigsegv_recovery |
776 |
|
echo |
777 |
|
echo "Configuration done. Now type \"make\"." |