2 # Arrange to define HAVE_MMAP_STACK and to compile mmap-stack.c
3 # if there is sufficient support.
6 AC_DEFUN([AC_SYS_MMAP_STACK],
9 AC_REQUIRE([AC_FUNC_MMAP])
10 AC_CHECK_HEADERS_ONCE(sys/mman.h ucontext.h stdarg.h)
11 AC_CHECK_FUNCS_ONCE(getcontext makecontext setcontext)
13 # For now, require tmpfile. FIXME: if there's a system with working mmap
14 # and *context functions yet that lacks tmpfile, we can provide a replacement.
15 AC_CHECK_FUNCS_ONCE(tmpfile)
17 ac_i=$ac_cv_func_tmpfile
18 ac_i=$ac_i:$ac_cv_func_getcontext
19 ac_i=$ac_i:$ac_cv_func_makecontext
20 ac_i=$ac_i:$ac_cv_func_setcontext
21 ac_i=$ac_i:$ac_cv_func_mmap_fixed_mapped
23 if test $ac_i = yes:yes:yes:yes:yes; then
25 AC_DEFINE(HAVE_MMAP_STACK, 1,
26 [Define to 1 if there is sufficient support (mmap, getcontext,
27 makecontext, setcontext) for running a process with mmap'd
28 memory for its stack.])