aboutsummaryrefslogtreecommitdiffstats
path: root/autoconf/m4/func_mmap_file.m4
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-09-19 22:31:49 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-09-19 22:31:49 +0000
commit12de17db02dca026fea1e2aee57ebdca97784292 (patch)
treeedfdc281c36966a7fa9f81a3533acee319d0bd7f /autoconf/m4/func_mmap_file.m4
parent8eacb0c3a7489b86a7f5523ff4992452bc0b7941 (diff)
downloadexternal_llvm-12de17db02dca026fea1e2aee57ebdca97784292.zip
external_llvm-12de17db02dca026fea1e2aee57ebdca97784292.tar.gz
external_llvm-12de17db02dca026fea1e2aee57ebdca97784292.tar.bz2
Bring the script out of the dark ages and into modern autoconfness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16415 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf/m4/func_mmap_file.m4')
-rw-r--r--autoconf/m4/func_mmap_file.m49
1 files changed, 4 insertions, 5 deletions
diff --git a/autoconf/m4/func_mmap_file.m4 b/autoconf/m4/func_mmap_file.m4
index 707a1d1..96b5173 100644
--- a/autoconf/m4/func_mmap_file.m4
+++ b/autoconf/m4/func_mmap_file.m4
@@ -4,9 +4,8 @@
AC_DEFUN([AC_FUNC_MMAP_FILE],
[AC_CACHE_CHECK(for mmap of files,
ac_cv_func_mmap_file,
-[AC_LANG_SAVE
- AC_LANG_C
- AC_TRY_RUN([
+[ AC_LANG_PUSH([C])
+ AC_RUN_IFELSE([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
@@ -22,8 +21,8 @@ ac_cv_func_mmap_file,
int fd;
int main () {
fd = creat ("foo",0777); fd = (int) mmap (0, 1, PROT_READ, MAP_SHARED, fd, 0); unlink ("foo"); return (fd != (int) MAP_FAILED);}],
- ac_cv_func_mmap_file=yes, ac_cv_func_mmap_file=no)
- AC_LANG_RESTORE
+ ac_cv_func_mmap_file=yes, ac_cv_func_mmap_file=no, ac_cv_func_mmap_file=no)
+ AC_LANG_POP([C])
])
if test "$ac_cv_func_mmap_file" = yes; then
AC_DEFINE([HAVE_MMAP_FILE],[],[Define if mmap() can map files into memory])