*** empty log message ***
authorJim Meyering <jim@meyering.net>
Sat, 15 Feb 2003 22:29:37 +0000 (22:29 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 15 Feb 2003 22:29:37 +0000 (22:29 +0000)
m4/ChangeLog
m4/mmap-stack.m4 [new file with mode: 0644]

index 0fc86a088ce186100fbbd862f9c406afdf1a759d..2c72337ad1ca92d875eb41d8b4d1734b2c687a78 100644 (file)
@@ -1,5 +1,7 @@
 2003-02-15  Jim Meyering  <jim@meyering.net>
 
+       * mmap-stack.m4: New file.
+
        * jm-macros.m4: Require AC_SYS_MMAP_STACK.
 
        Add Irix6 support to physmem.c.
diff --git a/m4/mmap-stack.m4 b/m4/mmap-stack.m4
new file mode 100644 (file)
index 0000000..cc7e801
--- /dev/null
@@ -0,0 +1,30 @@
+#serial 1
+# Arrange to define HAVE_MMAP_STACK and to compile mmap-stack.c
+# if there is sufficient support.
+# From Jim Meyering
+
+AC_DEFUN([AC_SYS_MMAP_STACK],
+[
+  # prerequisites
+  AC_REQUIRE([AC_FUNC_MMAP])
+  AC_CHECK_HEADERS_ONCE(sys/mman.h ucontext.h stdarg.h)
+  AC_CHECK_FUNCS_ONCE(getcontext makecontext setcontext)
+
+  # For now, require tmpfile. FIXME: if there's a system with working mmap
+  # and *context functions yet that lacks tmpfile, we can provide a replacement.
+  AC_CHECK_FUNCS_ONCE(tmpfile)
+
+  ac_i=$ac_cv_func_tmpfile
+  ac_i=$ac_i:$ac_cv_func_getcontext
+  ac_i=$ac_i:$ac_cv_func_makecontext
+  ac_i=$ac_i:$ac_cv_func_setcontext
+  ac_i=$ac_i:$ac_cv_func_mmap_fixed_mapped
+
+  if test $ac_i = yes:yes:yes:yes:yes; then
+    AC_LIBOBJ(mmap-stack)
+    AC_DEFINE(HAVE_MMAP_STACK, 1,
+      [Define to 1 if there is sufficient support (mmap, getcontext,
+       makecontext, setcontext) for running a process with mmap'd
+       memory for its stack.])
+  fi
+])