For PR351:
* Add checks for sterror and strerror_r functions
* Add check to determine if /dev/zero is needed for allocating RWX memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19148 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index a1c6d5f..9d9762d 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -443,7 +443,8 @@
 
 AC_CHECK_FUNCS([backtrace getcwd getpagesize getrusage gettimeofday isatty ])
 AC_CHECK_FUNCS([mkdtemp mkstemp mktemp ])
-AC_CHECK_FUNCS([realpath setrlimit strdup strtoq strtoll sysconf ])
+AC_CHECK_FUNCS([realpath setrlimit strdup strerror strerror_r strtoll strtoq ])
+AC_CHECK_FUNCS([sysconf])
 AC_C_PRINTF_A
 AC_FUNC_ALLOCA
 AC_FUNC_RAND48
@@ -459,9 +460,11 @@
 AC_FUNC_ISINF
 
 dnl Check for mmap and mprotect support. We need both to do the JIT and for
-dnl bytecode loading, etc.
+dnl bytecode loading, etc. We also need to know if /dev/zero is required to
+dnl be opened for allocating RWX memory.
 AC_FUNC_MMAP
 AC_FUNC_MMAP_FILE
+AC_NEED_DEV_ZERO_FOR_MMAP
 AC_CHECK_FUNC(mprotect,,
               AC_MSG_ERROR([Function mprotect() required but not found]))