Put the lib/System interface functions in llvm::sys namespace.
[oota-llvm.git] / autoconf / acinclude.m4
index 1ac0dd6e04deffd69d02db9c95138e6055e1772f..bbebf45eb5b084974644dde0ac2ad415323b248f 100644 (file)
@@ -6079,37 +6079,6 @@ then
 fi
 AC_SUBST(HAVE_FWD_ITERATOR)])
 
-#
-# Check for slist extension.  This is from
-# http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
-#
-AC_DEFUN([AC_CXX_HAVE_EXT_SLIST],
-[AC_CACHE_CHECK(whether the compiler has ext/slist,
-ac_cv_cxx_have_ext_slist,
-[AC_REQUIRE([AC_CXX_NAMESPACES])
-  AC_LANG_SAVE
-  AC_LANG_CPLUSPLUS
-  AC_TRY_COMPILE([#include <ext/slist>
-#ifdef HAVE_NAMESPACES
-using namespace std;
-#endif],[slist<int> s; return 0;],
-  ac_cv_cxx_have_ext_slist=std, ac_cv_cxx_have_ext_slist=no)
-  AC_TRY_COMPILE([#include <ext/slist>
-#ifdef HAVE_NAMESPACES
-using namespace __gnu_cxx;
-#endif],[slist<int> s; return 0;],
-  ac_cv_cxx_have_ext_slist=gnu, ac_cv_cxx_have_ext_slist=no)
-
-  AC_LANG_RESTORE
-])
-if test "$ac_cv_cxx_have_ext_slist" = std; then
-   AC_DEFINE(HAVE_EXT_SLIST,std,[define if the compiler has ext/slist])
-fi
-if test "$ac_cv_cxx_have_ext_slist" = gnu; then
-   AC_DEFINE(HAVE_EXT_SLIST,gnu,[define if the compiler has ext/slist])
-fi
-])
-
 #
 # Check for FLEX.  This is modified from
 # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_namespaces.html
@@ -6241,6 +6210,7 @@ AC_DEFUN([AC_CONFIG_MAKEFILE],
 # http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_have_ext_slist.html
 AC_DEFUN([AC_C_PRINTF_A],
 [
+        AC_MSG_CHECKING([for printf %a format specifier])
        AC_LANG_SAVE
        AC_LANG_C
        AC_RUN_IFELSE(
@@ -6260,6 +6230,7 @@ AC_DEFUN([AC_C_PRINTF_A],
                                 return (0);]]]),
                ac_c_printf_a=yes,ac_c_printf_a=no)
        AC_LANG_RESTORE
+        AC_MSG_RESULT($ac_c_printf_a)
        if test "$ac_c_printf_a" = "yes"; then
                AC_DEFINE([HAVE_PRINTF_A],[1],[Define to have the %a format string])
        fi
@@ -6270,6 +6241,7 @@ AC_DEFUN([AC_C_PRINTF_A],
 #
 AC_DEFUN([AC_LINK_USE_R],
 [
+  AC_MSG_CHECKING([for compiler -Wl,-R<path> option])
   AC_LANG_SAVE
   AC_LANG_C
   oldcflags="$CFLAGS"
@@ -6277,8 +6249,58 @@ AC_DEFUN([AC_LINK_USE_R],
   AC_LINK_IFELSE([int main() { return 0; }],[ac_cv_link_use_r=yes],[ac_cv_link_use_r=no])
   CFLAGS="$oldcflags"
   AC_LANG_RESTORE
+  AC_MSG_RESULT($ac_cv_link_use_r)
   if test "$ac_cv_link_use_r" = yes
   then
     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
 ])
+
+
+dnl AC_SINGLE_CXX_CHECK(DEFINEVAR, CACHEVAR, FUNCTION, HEADER, PROGRAM)
+dnl                     $1,        $2,       $3,       $4,     $5
+dnl 
+AC_DEFUN([AC_SINGLE_CXX_CHECK],
+[AC_CACHE_CHECK([for $3 in $4], [$2],
+ [AC_LANG_PUSH(C++)
+  AC_COMPILE_IFELSE(AC_LANG_SOURCE([$5]),[$2=yes],[$2=no])
+ AC_LANG_POP(C++)])
+ if test "$$2" = "yes"
+ then
+   AC_DEFINE($1, 1, [Define to 1 if your compiler defines $3 in the $4
+                     header file.])
+ fi])
+
+AC_DEFUN([AC_FUNC_ISNAN],[
+AC_SINGLE_CXX_CHECK([HAVE_ISNAN_IN_MATH_H],    [ac_cv_func_isnan_in_math_h],   
+                    [isnan], [<math.h>],
+                    [#include <math.h>
+                     int foo(float f) {return isnan(f);}])
+AC_SINGLE_CXX_CHECK([HAVE_ISNAN_IN_CMATH],     [ac_cv_func_isnan_in_cmath],    
+                    [isnan], [<cmath>],
+                    [#include <cmath>
+                     int foo(float f) {return isnan(f);}])
+AC_SINGLE_CXX_CHECK([HAVE_STD_ISNAN_IN_CMATH], [ac_cv_func_std_isnan_in_cmath],
+                    [std::isnan], [<cmath>],
+                    [#include <cmath>
+                     using std::isnan; int foo(float f) {return isnan(f);}])
+])
+
+AC_DEFUN([AC_FUNC_ISINF],[
+AC_SINGLE_CXX_CHECK([HAVE_ISINF_IN_MATH_H],    [ac_cv_func_isinf_in_math_h],   
+                    [isinf], [<math.h>],
+                    [#include <math.h>
+                     int foo(float f) {return isinf(f);}])
+AC_SINGLE_CXX_CHECK([HAVE_ISINF_IN_CMATH],     [ac_cv_func_isinf_in_cmath],    
+                    [isinf], [<cmath>],
+                    [#include <cmath>
+                     int foo(float f) {return isinf(f);}])
+AC_SINGLE_CXX_CHECK([HAVE_STD_ISINF_IN_CMATH], [ac_cv_func_std_isinf_in_cmath],
+                    [std::isinf], [<cmath>],
+                    [#include <cmath>
+                     using std::isinf; int foo(float f) {return isinf(f);}])
+AC_SINGLE_CXX_CHECK([HAVE_FINITE_IN_IEEEFP_H], [ac_cv_func_finite_in_ieeefp_h],
+                    [finite], [<ieeefp.h>],
+                    [#include <ieeefp.h>
+                     int foo(float f) {return finite(f);}])
+])