126 |
|
dnl Checks for libraries. |
127 |
|
AC_CHECK_LIB(posix4, sem_init) |
128 |
|
AC_CHECK_LIB(rt, timer_create) |
129 |
+ |
AC_CHECK_LIB(rt, shm_open) |
130 |
|
|
131 |
|
dnl Do we need SDL? |
132 |
|
WANT_SDL=no |
703 |
|
] |
704 |
|
) |
705 |
|
|
706 |
+ |
dnl Check if we have POSIX shared memory support |
707 |
+ |
AC_CACHE_CHECK([whether POSIX shared memory is working], |
708 |
+ |
ac_cv_have_posix_shm, [ |
709 |
+ |
AC_LANG_SAVE |
710 |
+ |
AC_LANG_CPLUSPLUS |
711 |
+ |
AC_TRY_RUN([ |
712 |
+ |
#define HAVE_POSIX_SHM |
713 |
+ |
#include "vm_alloc.cpp" |
714 |
+ |
int main(void) { /* returns 0 if we have working POSIX shm */ |
715 |
+ |
if (vm_init() < 0) exit(2); |
716 |
+ |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
717 |
+ |
if (m1 == VM_MAP_FAILED) exit(3); |
718 |
+ |
vm_exit(); exit(0); |
719 |
+ |
} |
720 |
+ |
], ac_cv_have_posix_shm=yes, ac_cv_have_posix_shm=no, |
721 |
+ |
dnl When cross-compiling, do not assume anything. |
722 |
+ |
ac_cv_have_posix_shm="guessing no" |
723 |
+ |
) |
724 |
+ |
AC_LANG_RESTORE |
725 |
+ |
] |
726 |
+ |
) |
727 |
+ |
AC_TRANSLATE_DEFINE(HAVE_POSIX_SHM, "$ac_cv_have_posix_shm", |
728 |
+ |
[Define if your system supports POSIX shared memory.]) |
729 |
+ |
|
730 |
+ |
dnl Check if we have working 33-bit memory addressing |
731 |
+ |
AC_CACHE_CHECK([whether 33-bit memory addressing is working], |
732 |
+ |
ac_cv_have_33bit_addressing, [ |
733 |
+ |
AC_LANG_SAVE |
734 |
+ |
AC_LANG_CPLUSPLUS |
735 |
+ |
AC_TRY_RUN([ |
736 |
+ |
#define USE_33BIT_ADDRESSING 1 |
737 |
+ |
#include "vm_alloc.cpp" |
738 |
+ |
int main(void) { /* returns 0 if we have working 33-bit addressing */ |
739 |
+ |
if (sizeof(void *) < 8) exit(1); |
740 |
+ |
if (vm_init() < 0) exit(2); |
741 |
+ |
char *m1 = (char *)vm_acquire(32768, VM_MAP_DEFAULT | VM_MAP_33BIT); |
742 |
+ |
if (m1 == VM_MAP_FAILED) exit(3); |
743 |
+ |
char *m2 = m1 + (1L << 32); |
744 |
+ |
m1[0] = 0x12; if (m2[0] != 0x12) exit(4); |
745 |
+ |
m2[0] = 0x34; if (m1[0] != 0x34) exit(5); |
746 |
+ |
vm_exit(); exit(0); |
747 |
+ |
} |
748 |
+ |
], ac_cv_have_33bit_addressing=yes, ac_cv_have_33bit_addressing=no, |
749 |
+ |
dnl When cross-compiling, do not assume anything. |
750 |
+ |
ac_cv_have_33bit_addressing="guessing no" |
751 |
+ |
) |
752 |
+ |
AC_LANG_RESTORE |
753 |
+ |
] |
754 |
+ |
) |
755 |
+ |
|
756 |
|
dnl Check signal handlers need to be reinstalled |
757 |
|
AC_CACHE_CHECK([whether signal handlers need to be reinstalled], |
758 |
|
ac_cv_signal_need_reinstall, [ |
1079 |
|
DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS" |
1080 |
|
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" |
1081 |
|
CAN_JIT=yes |
1082 |
+ |
WANT_33BIT_ADDRESSING=yes |
1083 |
|
fi |
1084 |
|
elif [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xyes" ]]; then |
1085 |
|
dnl SPARC CPU |
1136 |
|
JITSRCS="" |
1137 |
|
fi |
1138 |
|
|
1139 |
+ |
dnl Use 33-bit memory addressing? |
1140 |
+ |
if [[ "$ac_cv_have_33bit_addressing:$WANT_33BIT_ADDRESSING" = "yes:yes" ]]; then |
1141 |
+ |
use_33bit_addressing=yes |
1142 |
+ |
fi |
1143 |
+ |
AC_TRANSLATE_DEFINE(USE_33BIT_ADDRESSING, "$use_33bit_addressing", |
1144 |
+ |
[Define to use 33-bit memory addressing on 64-bit JIT capable systems.]) |
1145 |
+ |
|
1146 |
|
dnl Utility macro used by next two tests. |
1147 |
|
dnl AC_EXAMINE_OBJECT(C source code, |
1148 |
|
dnl commands examining object file, |