Check only whether PAGE_SIZE is compile-time const
This commit is contained in:
parent
921d8ac99d
commit
a1fdc5f71c
18
configure.ac
18
configure.ac
@ -2732,24 +2732,18 @@ AS_CASE([$target_os],
|
|||||||
[AC_CHECK_HEADERS([sys/user.h])]
|
[AC_CHECK_HEADERS([sys/user.h])]
|
||||||
)
|
)
|
||||||
AS_IF([test "x$ac_cv_func_mmap:$ac_cv_header_sys_user_h" = xyes:yes], [
|
AS_IF([test "x$ac_cv_func_mmap:$ac_cv_header_sys_user_h" = xyes:yes], [
|
||||||
AC_CACHE_CHECK([PAGE_SIZE is defined], rb_cv_page_size,
|
AC_CACHE_CHECK([whether PAGE_SIZE is compile-time const], rb_cv_const_page_size,
|
||||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
@%:@include <sys/user.h>
|
@%:@include <sys/user.h>
|
||||||
typedef char conftest_page[PAGE_SIZE];
|
typedef char conftest_page[PAGE_SIZE];
|
||||||
]], [[]])],
|
]], [[]])],
|
||||||
[rb_cv_page_size=const],
|
[rb_cv_const_page_size=yes],
|
||||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
[rb_cv_const_page_size=no])])
|
||||||
@%:@include <sys/user.h>
|
])
|
||||||
]], [[
|
AS_IF([test "x$rb_cv_const_page_size" = xyes],
|
||||||
int page_size = (int)PAGE_SIZE;
|
|
||||||
(void)page_size;
|
|
||||||
]])],
|
|
||||||
[rb_cv_page_size=variable], [rb_cv_page_size=no])])])
|
|
||||||
AS_IF([test "x$rb_cv_page_size" = xconst],
|
|
||||||
[AC_DEFINE(HAVE_CONST_PAGE_SIZE, 1)],
|
[AC_DEFINE(HAVE_CONST_PAGE_SIZE, 1)],
|
||||||
[AC_DEFINE(HAVE_CONST_PAGE_SIZE, 0)]
|
[AC_DEFINE(HAVE_CONST_PAGE_SIZE, 0)]
|
||||||
)
|
)
|
||||||
], [AC_DEFINE(HAVE_CONST_PAGE_SIZE, 0)])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
: "runtime section" && {
|
: "runtime section" && {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user