diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-10-27 23:03:44 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-10-27 23:03:44 +0000 |
commit | abec8f96e3e35fbb306c957674809c4ace04a620 (patch) | |
tree | 73a294a25458cd5c975ea83c7ab1fe5cf8dea050 /autoconf | |
parent | 0b8d2f9706743418cf97ff3837465de77fa8d781 (diff) | |
download | llvm-abec8f96e3e35fbb306c957674809c4ace04a620.tar.gz llvm-abec8f96e3e35fbb306c957674809c4ace04a620.tar.bz2 llvm-abec8f96e3e35fbb306c957674809c4ace04a620.tar.xz |
Changes to support rand48 tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rwxr-xr-x | autoconf/AutoRegen.sh | 2 | ||||
-rw-r--r-- | autoconf/configure.ac | 3 | ||||
-rw-r--r-- | autoconf/m4/func_isinf.m4 | 36 | ||||
-rw-r--r-- | autoconf/m4/func_isnan.m4 | 27 | ||||
-rw-r--r-- | autoconf/m4/rand48.m4 | 12 | ||||
-rw-r--r-- | autoconf/m4/single_cxx_check.m4 | 18 |
6 files changed, 64 insertions, 34 deletions
diff --git a/autoconf/AutoRegen.sh b/autoconf/AutoRegen.sh index c3210bf187..55f56f32c9 100755 --- a/autoconf/AutoRegen.sh +++ b/autoconf/AutoRegen.sh @@ -48,5 +48,5 @@ echo "Regenerating configure with autoconf 2.59" autoconf --force --warnings=all -o ../$outfile $configfile || die "autoconf failed" cd .. echo "Regenerating config.h.in with autoheader 2.59" -autoheader -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed" +autoheader --warnings=all -I autoconf -I autoconf/m4 autoconf/$configfile || die "autoheader failed" exit 0 diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 82f1eeedfb..b86ff8d888 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -1,5 +1,5 @@ dnl Initialize autoconf -AC_INIT([[LLVM]],[[1.4]],[llvmbugs@cs.uiuc.edu]) +AC_INIT([[llvm]],[[1.4]],[llvmbugs@cs.uiuc.edu]) dnl Place all of the extra autoconf files into the config subdirectory dnl Tell various tools where the m4 autoconf macros are @@ -318,6 +318,7 @@ AC_CXX_HAVE_FWD_ITERATOR AC_FUNC_ISNAN AC_FUNC_ISINF +AC_FUNC_RAND48 dnl Checks for library functions. AC_FUNC_ALLOCA diff --git a/autoconf/m4/func_isinf.m4 b/autoconf/m4/func_isinf.m4 index dc0c22e925..c372dd8578 100644 --- a/autoconf/m4/func_isinf.m4 +++ b/autoconf/m4/func_isinf.m4 @@ -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 + ]) diff --git a/autoconf/m4/func_isnan.m4 b/autoconf/m4/func_isnan.m4 index 8e626fe15b..eb5ca0daeb 100644 --- a/autoconf/m4/func_isnan.m4 +++ b/autoconf/m4/func_isnan.m4 @@ -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 ]) diff --git a/autoconf/m4/rand48.m4 b/autoconf/m4/rand48.m4 new file mode 100644 index 0000000000..56705d85c9 --- /dev/null +++ b/autoconf/m4/rand48.m4 @@ -0,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 +]) diff --git a/autoconf/m4/single_cxx_check.m4 b/autoconf/m4/single_cxx_check.m4 index 516bc9f605..21efa4bed3 100644 --- a/autoconf/m4/single_cxx_check.m4 +++ b/autoconf/m4/single_cxx_check.m4 @@ -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++])]) + ]) |