[llvm-commits] CVS: llvm/autoconf/m4/func_mmap_file.m4 link_use_r.m4
Reid Spencer
reid at x10sys.com
Sun Sep 19 21:08:33 PDT 2004
Changes in directory llvm/autoconf/m4:
func_mmap_file.m4 updated: 1.2 -> 1.3
link_use_r.m4 updated: 1.2 -> 1.3
---
Log message:
Correct the use AC_RUN_IFELSE to ensure it builds programs correctly by
using the AC_LANG_PROGRAM macro.
---
Diffs of the changes: (+8 -14)
Index: llvm/autoconf/m4/func_mmap_file.m4
diff -u llvm/autoconf/m4/func_mmap_file.m4:1.2 llvm/autoconf/m4/func_mmap_file.m4:1.3
--- llvm/autoconf/m4/func_mmap_file.m4:1.2 Sun Sep 19 17:31:49 2004
+++ llvm/autoconf/m4/func_mmap_file.m4 Sun Sep 19 23:08:22 2004
@@ -6,22 +6,18 @@
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
Index: llvm/autoconf/m4/link_use_r.m4
diff -u llvm/autoconf/m4/link_use_r.m4:1.2 llvm/autoconf/m4/link_use_r.m4:1.3
--- llvm/autoconf/m4/link_use_r.m4:1.2 Sun Sep 19 17:31:49 2004
+++ llvm/autoconf/m4/link_use_r.m4 Sun Sep 19 23:08:22 2004
@@ -9,7 +9,7 @@
AC_LANG_PUSH([C])
oldcflags="$CFLAGS"
CFLAGS="$CFLAGS -Wl,-R."
- AC_LINK_IFELSE([int main() { return 0; }],[ac_cv_link_use_r=yes],[ac_cv_link_use_r=no])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[int main() { return 0; }]])],[ac_cv_link_use_r=yes],[ac_cv_link_use_r=no])
CFLAGS="$oldcflags"
AC_LANG_POP([C])
AC_MSG_RESULT($ac_cv_link_use_r)
@@ -18,5 +18,3 @@
AC_DEFINE([HAVE_LINK_R],[1],[Define if you can use -Wl,-R. to pass -R. to the linker, in order to add the current directory to the dynamic linker search path.])
fi
])
-
-
More information about the llvm-commits
mailing list