Updated some of the information for the new autoconf changes.
[oota-llvm.git] / autoconf / aclocal.m4
index f25fea8e7e0dfd60996d8d24f928079f044e1002..da725af8a46c31c4f6d671582a1183e67463d9ac 100644 (file)
@@ -6111,26 +6111,26 @@ ac_cv_func_mmap_file,
 [AC_LANG_SAVE
   AC_LANG_C
   AC_TRY_RUN([
-#ifdef HAVE_SYS_MMAN_H
-#include <sys/mman.h>
-#endif
-
 #ifdef HAVE_SYS_TYPES_H
 #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 != MAP_FAILED);}],
+  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
 ])
 if test "$ac_cv_func_mmap_file" = yes; then
-   AC_DEFINE(HAVE_MMAP_FILE)
+   AC_DEFINE([HAVE_MMAP_FILE],[],[Define if mmap() can map files into memory])
    AC_SUBST(MMAP_FILE,[yes])
 fi
 ])
@@ -6152,7 +6152,47 @@ ac_cv_header_mmap_anon,
   AC_LANG_RESTORE
 ])
 if test "$ac_cv_header_mmap_anon" = yes; then
-   AC_DEFINE(HAVE_MMAP_ANONYMOUS)
+   AC_DEFINE([HAVE_MMAP_ANONYMOUS],[],[Define if mmap() uses MAP_ANONYMOUS to map anonymous pages, or undefine if it uses MAP_ANON])
 fi
 ])
 
+#
+# Configure a Makefile without clobbering it if it exists and is not out of
+# date.  This is modified from:
+# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
+#[AC_CONFIG_COMMANDS($1,${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/$1 $1)
+#
+AC_DEFUN([AC_CONFIG_MAKEFILE],
+[AC_CONFIG_COMMANDS($1,${SHELL} ${srcdir}/autoconf/install-sh -c ${srcdir}/$1 $1,${srcdir}/autoconf/mkinstalldirs `dirname $1`)
+])
+
+#
+# Determine if the printf() functions have the %a format character.
+# This is modified from:
+# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
+AC_DEFUN([AC_C_PRINTF_A],
+[
+       AC_LANG_SAVE
+       AC_LANG_C
+       AC_RUN_IFELSE(
+               AC_LANG_PROGRAM([#include <stdio.h>
+                                #include <stdlib.h>],
+                                [[[
+                                volatile double A, B;
+                                char Buffer[100];
+                                A = 1;
+                                A /= 10.0;
+                                sprintf(Buffer, "%a", A);
+                                B = atof(Buffer);
+                                if (A != B)
+                                                        return (1);
+                                if (A != 0x1.999999999999ap-4)
+                                                        return (1);
+                                return (0);]]]),
+               ac_c_printf_a=yes,ac_c_printf_a=no)
+       AC_LANG_RESTORE
+       if test "$ac_c_printf_a" = "yes"; then
+               AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string])
+       fi
+])
+