diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-06-22 23:42:49 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-06-22 23:42:49 +0000 |
commit | 99913cad315d5eda5e8bb53aa325e5e4220734dd (patch) | |
tree | 05c66d902839f5343595df049705e2ded98946ba /autoconf | |
parent | 8a54a1ed40d3067b32d9bf3a34f04dc55651ad00 (diff) | |
download | external_llvm-99913cad315d5eda5e8bb53aa325e5e4220734dd.zip external_llvm-99913cad315d5eda5e8bb53aa325e5e4220734dd.tar.gz external_llvm-99913cad315d5eda5e8bb53aa325e5e4220734dd.tar.bz2 |
Implement isnan check (AC_FUNC_ISNAN) in terms of three calls to a fairly
generic macro AC_SINGLE_CXX_CHECK.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r-- | autoconf/acinclude.m4 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/autoconf/acinclude.m4 b/autoconf/acinclude.m4 index ff8a829..364ecca 100644 --- a/autoconf/acinclude.m4 +++ b/autoconf/acinclude.m4 @@ -6251,3 +6251,34 @@ AC_DEFUN([AC_LINK_USE_R], 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);}]) +]) + |