1 |
|
dnl Process this file with autoconf to produce a configure script. |
2 |
|
dnl Written in 2002 by Christian Bauer et al. |
3 |
|
|
4 |
< |
AC_INIT(main_unix.cpp) |
4 |
> |
AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII) |
5 |
> |
AC_CONFIG_SRCDIR(main_unix.cpp) |
6 |
|
AC_PREREQ(2.52) |
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.]) |
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]) |
19 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=yes]) |
112 |
|
AC_CHECK_LIB(Hcurses, tgetent, , |
113 |
|
AC_CHECK_LIB(curses, tgetent)))))) |
114 |
|
AC_CHECK_LIB(readline, readline) |
106 |
– |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
115 |
|
else |
116 |
|
AC_MSG_RESULT(no) |
117 |
|
AC_MSG_WARN([Could not find mon, ignoring --with-mon.]) |
194 |
|
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
195 |
|
LIBS="$LIBS $GTK_LIBS" |
196 |
|
UISRCS=prefs_editor_gtk.cpp |
197 |
+ |
dnl somehow, <gnome-i18n.h> would redefine gettext() to nothing if |
198 |
+ |
dnl ENABLE_NLS is not set, thusly conflicting with C++ <string> which |
199 |
+ |
dnl includes <libintl.h> |
200 |
+ |
AM_GNU_GETTEXT |
201 |
|
B2_PATH_GNOMEUI([ |
202 |
|
AC_DEFINE(HAVE_GNOMEUI, 1, [Define if libgnomeui is available.]) |
203 |
|
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
227 |
|
|
228 |
|
dnl Checks for header files. |
229 |
|
AC_HEADER_STDC |
230 |
< |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
230 |
> |
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h mach/mach.h) |
231 |
> |
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
232 |
|
|
233 |
|
dnl Checks for typedefs, structures, and compiler characteristics. |
234 |
|
AC_C_BIGENDIAN |
566 |
|
AC_TRY_RUN([ |
567 |
|
#include "vm_alloc.cpp" |
568 |
|
int main(void) { /* returns 0 if we could map the lowmem globals */ |
569 |
< |
volatile char * lm; |
569 |
> |
volatile char * lm = 0; |
570 |
|
if (vm_init() < 0) exit(1); |
571 |
< |
if ((lm = (volatile char *)vm_acquire_fixed(0, 0x2000)) == VM_MAP_FAILED) exit(1); |
571 |
> |
if (vm_acquire_fixed(0, 0x2000) < 0) exit(1); |
572 |
|
lm[0] = 'z'; |
573 |
|
if (vm_release((char *)lm, 0x2000) < 0) exit(1); |
574 |
|
vm_exit(); exit(0); |
642 |
|
AC_TRANSLATE_DEFINE(SIGACTION_NEED_REINSTALL, "$ac_cv_sigaction_need_reinstall", |
643 |
|
[Define if your system requires sigactions to be reinstalled.]) |
644 |
|
|
645 |
< |
dnl Check if extended signals are supported. |
646 |
< |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
647 |
< |
ac_cv_have_extended_signals, [ |
645 |
> |
dnl Check if Mach exceptions supported. |
646 |
> |
AC_CACHE_CHECK([whether your system supports Mach exceptions], |
647 |
> |
ac_cv_have_mach_exceptions, [ |
648 |
|
AC_LANG_SAVE |
649 |
|
AC_LANG_CPLUSPLUS |
650 |
|
AC_TRY_RUN([ |
651 |
< |
#define HAVE_SIGINFO_T 1 |
651 |
> |
#define HAVE_MACH_EXCEPTIONS 1 |
652 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
653 |
|
#include "vm_alloc.cpp" |
654 |
|
#include "sigsegv.cpp" |
655 |
< |
], ac_cv_have_extended_signals=yes, ac_cv_have_extended_signals=no, |
655 |
> |
], [ |
656 |
> |
sigsegv_recovery=mach |
657 |
> |
ac_cv_have_mach_exceptions=yes |
658 |
> |
], |
659 |
> |
ac_cv_have_mach_exceptions=no, |
660 |
|
dnl When cross-compiling, do not assume anything. |
661 |
< |
ac_cv_have_extended_signals=no |
661 |
> |
ac_cv_have_mach_exceptions=no |
662 |
|
) |
663 |
|
AC_LANG_RESTORE |
664 |
|
] |
665 |
|
) |
666 |
< |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
667 |
< |
[Define if your system support extended signals.]) |
666 |
> |
AC_TRANSLATE_DEFINE(HAVE_MACH_EXCEPTIONS, "$ac_cv_have_mach_exceptions", |
667 |
> |
[Define if your system supports Mach exceptions.]) |
668 |
> |
|
669 |
> |
dnl Otherwise, check if extended signals are supported. |
670 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
671 |
> |
AC_CACHE_CHECK([whether your system supports extended signal handlers], |
672 |
> |
ac_cv_have_extended_signals, [ |
673 |
> |
AC_LANG_SAVE |
674 |
> |
AC_LANG_CPLUSPLUS |
675 |
> |
AC_TRY_RUN([ |
676 |
> |
#define HAVE_SIGINFO_T 1 |
677 |
> |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
678 |
> |
#include "vm_alloc.cpp" |
679 |
> |
#include "sigsegv.cpp" |
680 |
> |
], [ |
681 |
> |
sigsegv_recovery=siginfo |
682 |
> |
ac_cv_have_extended_signals=yes |
683 |
> |
], |
684 |
> |
ac_cv_have_extended_signals=no, |
685 |
> |
dnl When cross-compiling, do not assume anything. |
686 |
> |
ac_cv_have_extended_signals=no |
687 |
> |
) |
688 |
> |
AC_LANG_RESTORE |
689 |
> |
] |
690 |
> |
) |
691 |
> |
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals", |
692 |
> |
[Define if your system support extended signals.]) |
693 |
> |
fi |
694 |
|
|
695 |
|
dnl Otherwise, check for subterfuges. |
696 |
< |
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
696 |
> |
if [[ -z "$sigsegv_recovery" ]]; then |
697 |
|
AC_CACHE_CHECK([whether we then have a subterfuge for your system], |
698 |
|
ac_cv_have_sigcontext_hack, [ |
699 |
|
AC_LANG_SAVE |
703 |
|
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
704 |
|
#include "vm_alloc.cpp" |
705 |
|
#include "sigsegv.cpp" |
706 |
< |
], ac_cv_have_sigcontext_hack=yes, ac_cv_have_sigcontext_hack=no, |
706 |
> |
], [ |
707 |
> |
sigsegv_recovery=sigcontext |
708 |
> |
ac_cv_have_sigcontext_hack=yes |
709 |
> |
], |
710 |
> |
ac_cv_have_sigcontext_hack=no, |
711 |
|
dnl When cross-compiling, do not assume anything. |
712 |
|
ac_cv_have_sigcontext_hack=no |
713 |
|
) |
739 |
|
|
740 |
|
dnl Can we do Video on SEGV Signals ? |
741 |
|
CAN_VOSF=no |
742 |
< |
if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
742 |
> |
if [[ -n "$sigsegv_recovery" ]]; then |
743 |
|
CAN_VOSF=yes |
744 |
|
fi |
745 |
|
|
816 |
|
dnl Check for GCC 2.7 or higher. |
817 |
|
HAVE_GCC27=no |
818 |
|
AC_MSG_CHECKING(for GCC 2.7 or higher) |
819 |
< |
AC_EGREP_CPP(yes, |
819 |
> |
AC_EGREP_CPP(xyes, |
820 |
|
[#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5 |
821 |
< |
yes |
821 |
> |
xyes |
822 |
|
#endif |
823 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no)) |
824 |
|
|
825 |
|
dnl Check for GCC 3.0 or higher. |
826 |
|
HAVE_GCC30=no |
827 |
|
AC_MSG_CHECKING(for GCC 3.0 or higher) |
828 |
< |
AC_EGREP_CPP(yes, |
828 |
> |
AC_EGREP_CPP(xyes, |
829 |
|
[#if __GNUC__ >= 3 |
830 |
< |
yes |
830 |
> |
xyes |
831 |
|
#endif |
832 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
833 |
|
|
1152 |
|
AC_SUBST(SYSSRCS) |
1153 |
|
AC_SUBST(CPUINCLUDES) |
1154 |
|
AC_SUBST(CPUSRCS) |
1155 |
< |
AC_OUTPUT(Makefile) |
1155 |
> |
AC_CONFIG_FILES([Makefile]) |
1156 |
> |
AC_OUTPUT |
1157 |
|
|
1158 |
|
dnl Print summary. |
1159 |
|
echo |
1172 |
|
echo Floating-Point emulation core .......... : $FPE_CORE |
1173 |
|
echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS |
1174 |
|
echo Addressing mode ........................ : $ADDRESSING_MODE |
1175 |
+ |
echo Bad memory access recovery type ........ : $sigsegv_recovery |
1176 |
|
echo |
1177 |
|
echo "Configuration done. Now type \"make\" (or \"gmake\")." |