Cache wheather madvise declaration is needed on Solaris

This commit is contained in:
Nobuyoshi Nakada 2021-11-30 11:12:21 +09:00
parent 12fbdf4d4e
commit f379748e80
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -1108,15 +1108,18 @@ main()
]) ])
]) ])
AC_CHECK_TYPES([caddr_t],[],[],[@%:@include <sys/types.h>]) AC_CHECK_TYPES([caddr_t],[],[],[@%:@include <sys/types.h>])
RUBY_WERROR_FLAG([AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ AC_CACHE_CHECK([whether madvise declaration is needed], rb_cv_madvice_prototype_using_caddr_t,
[RUBY_WERROR_FLAG([AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@if defined(HAVE_CADDR_T) && (defined(MADV_FREE) || defined(MADV_DONTNEED)) @%:@if defined(HAVE_CADDR_T) && (defined(MADV_FREE) || defined(MADV_DONTNEED))
@%:@include <sys/unistd.h> @%:@include <sys/unistd.h>
@%:@include <sys/mman.h> @%:@include <sys/mman.h>
@%:@include <sys/types.h> @%:@include <sys/types.h>
extern int madvise(caddr_t, size_t, int); extern int madvise(caddr_t, size_t, int);
]], [[]])], ]], [[]])],
[AC_DEFINE(NEED_MADVICE_PROTOTYPE_USING_CADDR_T, 1)], []) [rb_cv_madvice_prototype_using_caddr_t=yes], [rb_cv_madvice_prototype_using_caddr_t=no])
])
]) ])
AS_IF([test $rb_cv_madvice_prototype_using_caddr_t = yes], [AC_DEFINE(NEED_MADVICE_PROTOTYPE_USING_CADDR_T, 1)])
], ],
[haiku*], [ [haiku*], [
LIBS="$LIBS" # m lib is include in root LIBS="$LIBS" # m lib is include in root