configure: test for large page sizes

Intended to fix PPC64 builds.
This commit is contained in:
Matthew Flatt 2014-03-26 12:11:59 -06:00
parent dd943c8754
commit cdce954128
4 changed files with 52 additions and 1 deletions

33
racket/src/configure vendored
View File

@ -3114,6 +3114,7 @@ enable_strip_by_default=yes
use_flag_pthread=yes
use_flag_posix_pthread=no
skip_iconv_check=no
check_page_size=yes
###### OSKit stuff #######
@ -5475,6 +5476,38 @@ $as_echo "#define HAVE_MMAP_MPROTECT 1" >>confdefs.h
fi
fi
if test "${check_page_size}" = "yes" ; then
msg="for large page size"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $msg" >&5
$as_echo_n "checking $msg... " >&6; }
if test "$cross_compiling" = yes; then :
use_large_page_size=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <unistd.h>
int main() {
return !(getpagesize() > (1 << 14));
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
use_large_page_size=yes
else
use_large_page_size=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_large_page_size" >&5
$as_echo "$use_large_page_size" >&6; }
if test "${use_large_page_size}" = "yes" ; then
$as_echo "#define MZ_USE_LARGE_PAGE_SIZE 1" >>confdefs.h
fi
fi
if test "${enable_backtrace}" = "yes" ; then
GC2OPTIONS="$GC2OPTIONS -DMZ_GC_BACKTRACE"
fi

View File

@ -415,6 +415,7 @@ enable_strip_by_default=yes
use_flag_pthread=yes
use_flag_posix_pthread=no
skip_iconv_check=no
check_page_size=yes
###### OSKit stuff #######
@ -1082,6 +1083,20 @@ if test "${check_for_mprotect}" = "yes" ; then
fi
fi
if test "${check_page_size}" = "yes" ; then
[ msg="for large page size" ]
AC_MSG_CHECKING($msg)
AC_TRY_RUN(
[ #include <unistd.h>]
int main() {
return !(getpagesize() > (1 << 14));
}, use_large_page_size=yes, use_large_page_size=no, use_large_page_size=no)
AC_MSG_RESULT($use_large_page_size)
if test "${use_large_page_size}" = "yes" ; then
AC_DEFINE(MZ_USE_LARGE_PAGE_SIZE,1,[Use large page size])
fi
fi
if test "${enable_backtrace}" = "yes" ; then
GC2OPTIONS="$GC2OPTIONS -DMZ_GC_BACKTRACE"
fi

View File

@ -3,7 +3,7 @@
#if defined(MZ_PRECISE_GC) && !defined(USE_COMPACT_3M_GC)
#ifdef _WIN32
#if defined(_WIN32) || defined(MZ_USE_LARGE_PAGE_SIZE)
# define LOG_APAGE_SIZE 16
#else
# define LOG_APAGE_SIZE 14

View File

@ -65,6 +65,9 @@ typedef unsigned long uintptr_t;
/* When mmap() and mprotect() are available: */
#undef HAVE_MMAP_MPROTECT
/* To enable 2^16 page size instead of 2^14: */
#undef MZ_USE_LARGE_PAGE_SIZE
/* Enable futures: */
#undef MZ_USE_FUTURES