aboutsummaryrefslogtreecommitdiffstats
path: root/autoconf/m4/func_mmap_file.m4
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-09-20 04:08:22 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-09-20 04:08:22 +0000
commita42b525ea81030ba9a547c4867deb76eb96c98c0 (patch)
tree04fa5816c002b5f0b63568f15b6499b9f388bdf5 /autoconf/m4/func_mmap_file.m4
parent2e89ae28941f63781131ea6b0081687374e6950b (diff)
downloadexternal_llvm-a42b525ea81030ba9a547c4867deb76eb96c98c0.zip
external_llvm-a42b525ea81030ba9a547c4867deb76eb96c98c0.tar.gz
external_llvm-a42b525ea81030ba9a547c4867deb76eb96c98c0.tar.bz2
Correct the use AC_RUN_IFELSE to ensure it builds programs correctly by
using the AC_LANG_PROGRAM macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16426 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf/m4/func_mmap_file.m4')
-rw-r--r--autoconf/m4/func_mmap_file.m418
1 files changed, 7 insertions, 11 deletions
diff --git a/autoconf/m4/func_mmap_file.m4 b/autoconf/m4/func_mmap_file.m4
index 96b5173..e607d0d 100644
--- a/autoconf/m4/func_mmap_file.m4
+++ b/autoconf/m4/func_mmap_file.m4
@@ -6,22 +6,18 @@ AC_DEFUN([AC_FUNC_MMAP_FILE],
ac_cv_func_mmap_file,
[ AC_LANG_PUSH([C])
AC_RUN_IFELSE([
-#ifdef HAVE_SYS_TYPES_H
+ AC_LANG_PROGRAM([[
#include <sys/types.h>
-#endif
-
-#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
#include <fcntl.h>
-#endif
-
+]],[[
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_cv_func_mmap_file=no)
+ 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_POP([C])
])
if test "$ac_cv_func_mmap_file" = yes; then