Changeset 1358


Ignore:
Timestamp:
Jun 25, 2008, 12:21:32 AM (13 years ago)
Author:
Peter
Message:

fixes #338 - runtime tests for quiet_NaN and infinity are not
performed when cross-compiling, but instead we use a compilation
test. On the other hand, for the (most common) case when not
cross-compiling, I removed the compilation test because the result of
the test was ignored anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r1356 r1358  
    148148
    149149# check for quiet_NaN support in OS
    150 # At compile time, but this may not work if quiet_NaN exists and returns
    151 # an incorrect value
    152 AC_MSG_CHECKING([for std::numeric_limits<>::quiet_NaN()])
    153 AC_COMPILE_IFELSE(
    154   [AC_LANG_PROGRAM(
    155     [#include <limits>
    156      extern void f(double);],
    157     [f(std::numeric_limits<double>::quiet_NaN())])],
    158   [quiet_nan=yes],
    159   [quiet_nan=no])
    160 AC_MSG_RESULT($quiet_nan)
    161 # At run-time, but this has the disadvantage that yat cannot be built 
    162 # for cross-compilation
     150# Check at run-time, but if we are cross-compiling fall back on a
     151# compilation test
    163152AC_MSG_CHECKING([if std::numeric_limits<>::has_quiet_NaN is true])
    164153AC_RUN_IFELSE(
     
    166155    [#include <limits>],
    167156    [return !std::numeric_limits<double>::has_quiet_NaN])],
    168   [quiet_nan=yes],
    169   [quiet_nan=no])
    170 AC_MSG_RESULT($quiet_nan)
     157  [quiet_nan=yes
     158   AC_MSG_RESULT($quiet_nan)],
     159  [quiet_nan=no
     160   AC_MSG_RESULT($quiet_nan)],
     161  # if we are cross-compiling fall back on compilation test
     162  [AC_MSG_RESULT(cross-compiling)
     163   AC_MSG_CHECKING([for std::numeric_limits<>::quiet_NaN()])
     164    AC_COMPILE_IFELSE(
     165     [AC_LANG_PROGRAM(
     166        [#include <limits>
     167         extern void f(double);],
     168        [f(std::numeric_limits<double>::quiet_NaN())])],
     169     [quiet_nan=yes],
     170     [quiet_nan=no])
     171   AC_MSG_RESULT($quiet_nan)])
    171172# Check for infinity support for doubles in OS
    172 # At run-time, but this has the disadvantage that yat cannot be built 
    173 # for cross-compilation
     173# Check at run-time, but if we are cross-compiling fall back on a
     174# compilation test
    174175AC_MSG_CHECKING([if std::numeric_limits<>::has_infinity is true])
    175176AC_RUN_IFELSE(
     
    177178    [#include <limits>],
    178179    [return !std::numeric_limits<double>::has_infinity])],
    179   [has_infinity=yes],
    180   [has_infinity=no])
    181 AC_MSG_RESULT($has_infinity)
     180  [has_infinity=yes
     181   AC_MSG_RESULT($has_infinity)],
     182  [has_infinity=no
     183   AC_MSG_RESULT($has_infinity)],
     184  # if we are cross-compiling fall back on compilation test
     185  [AC_MSG_RESULT(cross-compiling)
     186   AC_MSG_CHECKING([for std::numeric_limits<>::infinity()])
     187    AC_COMPILE_IFELSE(
     188     [AC_LANG_PROGRAM(
     189        [#include <limits>
     190         extern void f(double);],
     191        [f(std::numeric_limits<double>::infinity())])],
     192     [has_infinity=yes],
     193     [has_infinity=no])
     194   AC_MSG_RESULT($has_infinity)])
    182195
    183196
Note: See TracChangeset for help on using the changeset viewer.