[llvm-commits] CVS: llvm/autoconf/m4/rand48.m4 func_isinf.m4 func_isnan.m4 single_cxx_check.m4

Reid Spencer reid at x10sys.com
Wed Oct 27 16:03:55 PDT 2004



Changes in directory llvm/autoconf/m4:

rand48.m4 added (r1.1)
func_isinf.m4 updated: 1.1 -> 1.2
func_isnan.m4 updated: 1.1 -> 1.2
single_cxx_check.m4 updated: 1.3 -> 1.4
---
Log message:

Changes to support rand48 tests

---
Diffs of the changes:  (+61 -32)

Index: llvm/autoconf/m4/rand48.m4
diff -c /dev/null llvm/autoconf/m4/rand48.m4:1.1
*** /dev/null	Wed Oct 27 18:03:54 2004
--- llvm/autoconf/m4/rand48.m4	Wed Oct 27 18:03:44 2004
***************
*** 0 ****
--- 1,12 ----
+ #
+ # This function determins if the the srand48,drand48,lrand48 functions are
+ # available on this platform.
+ #
+ AC_DEFUN([AC_FUNC_RAND48],[
+ AC_SINGLE_CXX_CHECK([ac_cv_func_rand48],   
+                     [srand48/lrand48/drand48], [<stdlib.h>],
+                     [srand48(0);lrand48();drand48();])
+ if test "$ac_cv_func_rand48" = "yes" ; then
+ AC_DEFINE([HAVE_RAND48],1,[Define to 1 if srand48/lrand48/drand48 exist in <stdlib.h>])
+ fi
+ ])


Index: llvm/autoconf/m4/func_isinf.m4
diff -u llvm/autoconf/m4/func_isinf.m4:1.1 llvm/autoconf/m4/func_isinf.m4:1.2
--- llvm/autoconf/m4/func_isinf.m4:1.1	Tue Sep  7 09:23:53 2004
+++ llvm/autoconf/m4/func_isinf.m4	Wed Oct 27 18:03:44 2004
@@ -3,22 +3,34 @@
 # platform.
 #
 AC_DEFUN([AC_FUNC_ISINF],[
-AC_SINGLE_CXX_CHECK([HAVE_ISINF_IN_MATH_H],    [ac_cv_func_isinf_in_math_h],   
+AC_SINGLE_CXX_CHECK([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],    
+                    [float f; isinf(f);])
+if test "$ac_cv_func_isinf_in_math_h" = "yes" ; then 
+  AC_DEFINE([HAVE_ISINF_IN_MATH_H],1,[Set to 1 if the isinf function is found in <math.h>])
+fi
+
+AC_SINGLE_CXX_CHECK([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],
+                    [float f; isinf(f);])
+if test "$ac_cv_func_isinf_in_cmath" = "yes" ; then
+  AC_DEFINE([HAVE_ISINF_IN_CMATH],1,[Set to 1 if the isinf function is found in <cmath>])
+fi
+
+AC_SINGLE_CXX_CHECK([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],
+                    [float f; std::isinf(f)}])
+if test "$ac_cv_func_std_isinf_in_cmath" = "yes" ; then 
+  AC_DEFINE([HAVE_STD_ISINF_IN_CMATH],1,[Set to 1 if the std::isinf function is found in <cmath>])
+fi
+
+AC_SINGLE_CXX_CHECK([ac_cv_func_finite_in_ieeefp_h],
                     [finite], [<ieeefp.h>],
-                    [#include <ieeefp.h>
-                     int foo(float f) {return finite(f);}])
+                    [float f; finite(f);])
+if test "$ac_cv_func_finite_in_ieefp_h" = "yes" ; then
+  AC_DEFINE([HAVE_FINITE_IN_IEEFP_H],1,[Set to 1 if the finite function is found in <ieeefp.h>])
+fi
+
 ])
 
 


Index: llvm/autoconf/m4/func_isnan.m4
diff -u llvm/autoconf/m4/func_isnan.m4:1.1 llvm/autoconf/m4/func_isnan.m4:1.2
--- llvm/autoconf/m4/func_isnan.m4:1.1	Tue Sep  7 09:23:53 2004
+++ llvm/autoconf/m4/func_isnan.m4	Wed Oct 27 18:03:44 2004
@@ -3,16 +3,25 @@
 # platform.
 #
 AC_DEFUN([AC_FUNC_ISNAN],[
-AC_SINGLE_CXX_CHECK([HAVE_ISNAN_IN_MATH_H],    [ac_cv_func_isnan_in_math_h],   
+AC_SINGLE_CXX_CHECK([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],    
+                    [float f; isnan(f);])
+
+if test "$ac_cv_func_isnan_in_math_h" = "yes" ; then
+  AC_DEFINE([HAVE_ISNAN_IN_MATH_H],1,[Set to 1 if the isnan function is found in <math.h>])
+fi
+
+AC_SINGLE_CXX_CHECK([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],
+                    [float f; isnan(f);])
+if test "$ac_cv_func_isnan_in_cmath" = "yes" ; then
+  AC_DEFINE([HAVE_ISNAN_IN_CMATH],1,[Set to 1 if the isnan function is found in <cmath>])
+fi
+
+AC_SINGLE_CXX_CHECK([ac_cv_func_std_isnan_in_cmath],
                     [std::isnan], [<cmath>],
-                    [#include <cmath>
-                     using std::isnan; int foo(float f) {return isnan(f);}])
+                    [float f; std::isnan(f);])
+if test "$ac_cv_func_std_isnan_in_cmath" = "yes" ; then
+  AC_DEFINE([HAVE_STD_ISNAN_IN_CMATH],1,[Set to 1 if the std::isnan function is found in <cmath>])
+fi
 ])


Index: llvm/autoconf/m4/single_cxx_check.m4
diff -u llvm/autoconf/m4/single_cxx_check.m4:1.3 llvm/autoconf/m4/single_cxx_check.m4:1.4
--- llvm/autoconf/m4/single_cxx_check.m4:1.3	Sun Sep 19 17:31:49 2004
+++ llvm/autoconf/m4/single_cxx_check.m4	Wed Oct 27 18:03:44 2004
@@ -1,14 +1,10 @@
-dnl AC_SINGLE_CXX_CHECK(DEFINEVAR, CACHEVAR, FUNCTION, HEADER, PROGRAM)
-dnl                     $1,        $2,       $3,       $4,     $5
+dnl AC_SINGLE_CXX_CHECK(CACHEVAR, FUNCTION, HEADER, PROGRAM)
+dnl                     $1,       $2,       $3,     $4,     
 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_CACHE_CHECK([for $2 in $3], [$1],
+  [AC_LANG_PUSH([C++])
+   AC_COMPILE_IFELSE(AC_LANG_PROGRAM([#include $3],[$4]),[$1=yes],[$1=no])
+  AC_LANG_POP([C++])])
+ ])
 






More information about the llvm-commits mailing list