1
1
dnl Mac OS X configuration driver
2
dnl $Id: configure.in,v 1.10 2003/06/03 12:40:02 nigel Exp $
2
dnl $Id: configure.in,v 1.16 2005/06/12 23:36:33 gbeauche Exp $
3
3
dnl Process this file with autoconf to produce a configure script.
4
4
dnl Based on Unix/configure.in
5
5
dnl Written in 1999 by Christian Bauer et al.
7
dnl autoconf on 10.1 doesn't understand these
8
dnl AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII)
9
dnl AC_CONFIG_SRCDIR(main_macosx.mm)
7
10
AC_INIT(main_macosx.mm)
9
12
AC_CONFIG_HEADER(config.h)
14
dnl Aliases for PACKAGE and VERSION macros.
15
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
16
AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
18
dnl Some systems do not put corefiles in the currect directory, avoid saving
19
dnl cores for the configure tests since some are intended to dump core.
12
23
AC_ARG_ENABLE(multiwin,
13
24
[ --enable-multiwin allow multiple emulator windows [default=no]], [ENABLE_MULTIPLE=$enableval], [ENABLE_MULTIPLE=no])
112
dnl We want pthreads.
123
dnl We want pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL.
125
AC_CHECK_LIB(pthread, pthread_create, , [
126
AC_CHECK_LIB(c_r, pthread_create, , [
127
AC_CHECK_LIB(PTL, pthread_create, , [
132
dnl OS X does have pthreads, but not in any of the above locations:
134
if [[ "x$HAVE_PTHREADS" = "xyes" ]]; then
135
AC_DEFINE(HAVE_PTHREADS, 1, [Define if pthreads are available.])
114
137
AC_CHECK_FUNCS(pthread_cancel)
115
138
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol)
116
139
AC_CHECK_FUNCS(pthread_mutexattr_settype)
150
175
AC_CHECK_SIZEOF(long double, 12)
151
176
AC_CHECK_SIZEOF(void *, 4)
153
dnl These two symbols are not defined in 10.1's autoconf files:
178
dnl These two symbols are not defined in 10.1's autoconf:
154
179
dnl AC_CHECK_TYPE(loff_t, off_t)
155
180
dnl AC_CHECK_TYPE(caddr_t, [char *])
156
dnl which causes problems for autoheader.
157
181
dnl We define loff_t as a typedef of off_t in sysdeps.h if we don't have LOFF_T
182
dnl OS X does have caddr_t, but the above check doesn't work, so we have to do:
183
AC_DEFINE(HAVE_CADDR_T, 1, [The type "caddr_t" does exist on MacOS X.])
452
492
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall",
453
493
[Define if your system requires sigactions to be reinstalled.])
455
dnl Check if extended signals are supported.
456
AC_CACHE_CHECK([whether your system supports extended signal handlers],
457
ac_cv_have_extended_signals, [
495
dnl Check if Mach exceptions supported.
496
AC_CACHE_CHECK([whether your system supports Mach exceptions],
497
ac_cv_have_mach_exceptions, [
459
499
AC_LANG_CPLUSPLUS
461
#define HAVE_SIGINFO_T 1
501
#define HAVE_MACH_EXCEPTIONS 1
462
502
#define CONFIGURE_TEST_SIGSEGV_RECOVERY
463
503
#include "../Unix/vm_alloc.cpp"
464
504
#include "../Unix/sigsegv.cpp"
465
], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no,
506
sigsegv_recovery=mach
507
ac_cv_have_mach_exceptions=yes
509
ac_cv_have_mach_exceptions=no,
466
510
dnl When cross-compiling, do not assume anything.
467
ac_cv_have_extended_signals=no
511
ac_cv_have_mach_exceptions=no
472
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
473
[Define if your system support extended signals.])
475
dnl This program never returns (exits) on OS X
516
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions",
517
[Define if your system supports Mach exceptions.])
519
dnl Otherwise, check if extended signals are supported.
520
if [[ -z "$sigsegv_recovery" ]]; then
521
AC_CACHE_CHECK([whether your system supports extended signal handlers],
522
ac_cv_have_extended_signals, [
526
#define HAVE_SIGINFO_T 1
527
#define CONFIGURE_TEST_SIGSEGV_RECOVERY
528
#include "../Unix/vm_alloc.cpp"
529
#include "../Unix/sigsegv.cpp"
531
sigsegv_recovery=siginfo
532
ac_cv_have_extended_signals=yes
534
ac_cv_have_extended_signals=no,
535
dnl When cross-compiling, do not assume anything.
536
ac_cv_have_extended_signals=no
541
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals",
542
[Define if your system support extended signals.])
476
545
dnl Otherwise, check for subterfuges.
477
dnl if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then
478
dnl AC_CACHE_CHECK([whether we then have a subterfuge for your system],
479
dnl ac_cv_have_sigcontext_hack, [
481
dnl AC_LANG_CPLUSPLUS
483
dnl #define HAVE_SIGCONTEXT_SUBTERFUGE 1
484
dnl #define CONFIGURE_TEST_SIGSEGV_RECOVERY
485
dnl #include "../Unix/vm_alloc.cpp"
486
dnl #include "../Unix/sigsegv.cpp"
487
dnl ], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no,
488
dnl dnl When cross-compiling, do not assume anything.
489
dnl ac_cv_have_sigcontext_hack=no
493
dnl AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
494
dnl [Define if we know a hack to replace siginfo_t->si_addr member.])
546
if [[ -z "$sigsegv_recovery" ]]; then
547
AC_CACHE_CHECK([whether we then have a subterfuge for your system],
548
ac_cv_have_sigcontext_hack, [
552
#define HAVE_SIGCONTEXT_SUBTERFUGE 1
553
#define CONFIGURE_TEST_SIGSEGV_RECOVERY
554
#include "../Unix/vm_alloc.cpp"
555
#include "../Unix/sigsegv.cpp"
557
sigsegv_recovery=sigcontext
558
ac_cv_have_sigcontext_hack=yes
560
ac_cv_have_sigcontext_hack=no,
561
dnl When cross-compiling, do not assume anything.
562
ac_cv_have_sigcontext_hack=no
566
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
567
[Define if we know a hack to replace siginfo_t->si_addr member.])
497
570
dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler)
498
571
AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler],