From 002f82d414159b3815dae0616db582dd6d74b5b0 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 20 Sep 2000 07:43:14 +0000 Subject: [PATCH] Check for _isnan besides for isnan. git-svn-id: https://svn.dealii.org/trunk@3341 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 109 ++++++++++++++++++++++++++++++--------------- 1 file changed, 73 insertions(+), 36 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index f6003906c5..0b9b7f43a1 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -181,6 +181,7 @@ AC_DEFUN(DEAL_II_CHECK_ISNAN_FLAG, dnl AC_MSG_CHECKING(whether isnan is declared with $1 flags) AC_REQUIRE([AC_LANG_CPLUSPLUS]) CXXFLAGS=$2 + deal_II_isnan_flag="" AC_TRY_COMPILE( [ #include @@ -193,42 +194,78 @@ AC_DEFUN(DEAL_II_CHECK_ISNAN_FLAG, dnl AC_MSG_RESULT("yes") deal_II_isnan_flag="-DHAVE_ISNAN" $3 - ], - [ - dnl We need to define something. Unfortunately, this is system - dnl dependent (argh!) - deal_II_isnan_flag="" - for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do - CXXFLAGS="$2 $testflag" - AC_TRY_COMPILE( - [ + ]) + + + if test $deal_II_isnan_flag = "" ; then + dnl Simply using isnan doesn't work. On Microsoft Windows systems, the function + dnl is called _isnan, so check that + AC_TRY_COMPILE( + [ #include - ], - [ - double d=0; - isnan (d); - ], - [ - dnl We found a flag by which isnan is defined; store - dnl this flag and exit the loop - deal_II_isnan_flag="-DHAVE_ISNAN $testflag" - break; - ], - [ - dnl The flag didn't work, don't do nothing. - ]) - done - - dnl if no such flag was found, then abort ./configure since - dnl the library will not be compilable on this platform - dnl without knowledge of the right flag - if test "$deal_II_isnan_flag" = "" ; then - AC_MSG_RESULT(no.) - else - - dnl we found something, lets us it - AC_MSG_RESULT(using $testflag) + ], + [ + double d=0; + _isnan (d); + ], + [ + AC_MSG_RESULT("yes") + deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN" $3 - fi - ]) + ]) + fi + + + dnl Let's see whether we _now_ have found something + if test $deal_II_isnan_flag = "" ; then + dnl We need to define something. Unfortunately, this is system + dnl dependent (argh!) + deal_II_isnan_flag="" + for testflag in -D_ISOC99_SOURCE -D__EXTENSIONS__ ; do + CXXFLAGS="$2 $testflag" + AC_TRY_COMPILE( + [ +#include + ], + [ + double d=0; + isnan (d); + ], + [ + dnl We found a flag by which isnan is defined; store + dnl this flag and exit the loop + deal_II_isnan_flag="-DHAVE_ISNAN $testflag" + break; + ]) + + dnl If that didn't work (and it didn't as we are still inside the + dnl loop), then try the _isnan function (maybe we are on a + dnl Microsoft Windows system) + AC_TRY_COMPILE( + [ +#include + ], + [ + double d=0; + _isnan (d); + ], + [ + dnl We found a flag by which isnan is defined; store + dnl this flag and exit the loop + deal_II_isnan_flag="-DHAVE_UNDERSCORE_ISNAN $testflag" + break; + ]) + done + + dnl if no such flag was found, then abort ./configure since + dnl the library will not be compilable on this platform + dnl without knowledge of the right flag + if test "$deal_II_isnan_flag" = "" ; then + AC_MSG_RESULT(no.) + else + dnl we found something, lets us it + AC_MSG_RESULT(using $testflag) + $3 + fi + fi ) -- 2.39.5