summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-14 09:33:20 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-14 09:33:20 +0900
commit7cf90f99f5674fdadc0ff9d8341b315b2490ea26 (patch)
tree39d4e1992719680e2ebaf23fd10d6c76bfa0ded6 /configure.ac
parenta168c4772827bc6105177c4b605dcf6e6e1943a5 (diff)
Refix PAGE_SIZE
* honor actually used headers * include sys/user.h only when `PAGE_SIZE` is not defined
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 4 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index ac737f6cc8..da65b16ccc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2732,14 +2732,11 @@ main(int argc, char *argv[])
test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
])
-AS_CASE([$target_os],
- [darwin*], [ac_cv_header_sys_user_h=no], dnl LIST_HEAD conflicts with sys/queue.h
- [AC_CHECK_HEADERS([sys/user.h])]
-)
-AS_IF([test "x$ac_cv_func_mmap:$ac_cv_header_sys_user_h" = xyes:yes], [
+AC_CHECK_HEADERS([sys/user.h])
+AS_IF([test "x$ac_cv_func_mmap" = xyes], [
AC_CACHE_CHECK([whether PAGE_SIZE is compile-time const], rb_cv_const_page_size,
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- @%:@include <sys/user.h>
+ [malloc_headers=`sed -n '/MALLOC_HEADERS_BEGIN/,/MALLOC_HEADERS_END/p' ${srcdir}/gc.c`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$malloc_headers
typedef char conftest_page[PAGE_SIZE];
]], [[]])],
[rb_cv_const_page_size=yes],