From 8eca8ceea2715a2c670d7a5ae7bd923c3195d24a Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 27 Jun 2000 08:10:08 +0000 Subject: [PATCH] Check for existence of isnan for both sets of compiler flags independently. git-svn-id: https://svn.dealii.org/trunk@3087 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/aclocal.m4 | 23 +++++++++++++++++++--- deal.II/configure | 49 +++++++++++++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 12 deletions(-) diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index e95daa5208..1cd141ab9e 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -119,13 +119,13 @@ dnl simply declared in (or , for what it's worth), but dnl on Linux for example, it is only declared if we specifically require dnl support for ISO C 99. This macro checks whether `isnan' is declared dnl or whether we have to pass special compiler flags, namely -dnl -D_ISOC99_SOURCE. Note that when checking we have to use the strict -dnl compiler flags including -ansi -pedantic. +dnl -D_ISOC99_SOURCE. Note that when checking we have to use the two +dnl sets of compiler flags. dnl dnl Usage: DEAL_II_CHECK_ISNAN dnl AC_DEFUN(DEAL_II_CHECK_ISNAN, dnl - AC_MSG_CHECKING(whether isnan is declared) + AC_MSG_CHECKING(whether isnan is declared with debug flags) AC_REQUIRE([AC_LANG_CPLUSPLUS]) CXXFLAGS="$CXXFLAGSG" AC_TRY_COMPILE( @@ -142,6 +142,23 @@ AC_DEFUN(DEAL_II_CHECK_ISNAN, dnl [ AC_MSG_RESULT("no") CXXFLAGSG="$CXXFLAGSG -D_ISOC99_SOURCE" + ]) + AC_MSG_CHECKING(whether isnan is declared with optimized flags) + AC_REQUIRE([AC_LANG_CPLUSPLUS]) + CXXFLAGS="$CXXFLAGSO" + AC_TRY_COMPILE( + [ +#include + ], + [ + double d; + isnan (d); + ], + [ + AC_MSG_RESULT("yes") + ], + [ + AC_MSG_RESULT("no") CXXFLAGSO="$CXXFLAGSO -D_ISOC99_SOURCE" ]) ) diff --git a/deal.II/configure b/deal.II/configure index cea4d71284..9b8a7ddda3 100755 --- a/deal.II/configure +++ b/deal.II/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.27 +# From configure.in Revision: 1.28 @@ -1518,8 +1518,8 @@ else fi rm -f conftest* - echo $ac_n "checking whether isnan is declared""... $ac_c" 1>&6 -echo "configure:1523: checking whether isnan is declared" >&5 + echo $ac_n "checking whether isnan is declared with debug flags""... $ac_c" 1>&6 +echo "configure:1523: checking whether isnan is declared with debug flags" >&5 CXXFLAGS="$CXXFLAGSG" cat > conftest.$ac_ext <&6 CXXFLAGSG="$CXXFLAGSG -D_ISOC99_SOURCE" + +fi +rm -f conftest* + echo $ac_n "checking whether isnan is declared with optimized flags""... $ac_c" 1>&6 +echo "configure:1555: checking whether isnan is declared with optimized flags" >&5 + + CXXFLAGS="$CXXFLAGSO" + cat > conftest.$ac_ext < + +int main() { + + double d; + isnan (d); + +; return 0; } +EOF +if { (eval echo configure:1571: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t"""yes"" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t"""no"" 1>&6 CXXFLAGSO="$CXXFLAGSO -D_ISOC99_SOURCE" fi @@ -1567,17 +1598,17 @@ esac echo $ac_n "checking for consistency of CXXFLAGSG flags""... $ac_c" 1>&6 -echo "configure:1571: checking for consistency of CXXFLAGSG flags" >&5 +echo "configure:1602: checking for consistency of CXXFLAGSG flags" >&5 CXXFLAGS="$CXXFLAGSG" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -1594,17 +1625,17 @@ fi rm -f conftest* echo $ac_n "checking for consistency of CXXFLAGSO flags""... $ac_c" 1>&6 -echo "configure:1598: checking for consistency of CXXFLAGSO flags" >&5 +echo "configure:1629: checking for consistency of CXXFLAGSO flags" >&5 CXXFLAGS="$CXXFLAGSO" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1639: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 -- 2.39.5