isnan.m4 1.48 KB
Newer Older
1
# isnan.m4 serial 5
2
dnl Copyright (C) 2007-2018 Free Software Foundation, Inc.
Ben Pfaff's avatar
Ben Pfaff committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

AC_DEFUN([gl_ISNAN],
[
  AC_REQUIRE([gl_MATH_H_DEFAULTS])
  AC_REQUIRE([gl_FUNC_ISNANF])
  AC_REQUIRE([gl_FUNC_ISNAND])
  AC_REQUIRE([gl_FUNC_ISNANL])

  # If we replaced any of the underlying isnan* functions, replace
  # the isnan macro; it undoubtedly suffers from the same flaws.
  AC_MSG_CHECKING([whether isnan macro works])
  if test $gl_func_isnanf = yes \
     && test $gl_func_isnand = yes \
     && test $gl_func_isnanl = yes; then
    AC_MSG_RESULT([yes])
Bruno Haible's avatar
Bruno Haible committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    ISNAN_LIBM=
    dnl Append $ISNANF_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
    case " $ISNAN_LIBM " in
      *" $ISNANF_LIBM "*) ;;
      *) ISNAN_LIBM="$ISNAN_LIBM $ISNANF_LIBM" ;;
    esac
    dnl Append $ISNAND_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
    case " $ISNAN_LIBM " in
      *" $ISNAND_LIBM "*) ;;
      *) ISNAN_LIBM="$ISNAN_LIBM $ISNAND_LIBM" ;;
    esac
    dnl Append $ISNANL_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
    case " $ISNAN_LIBM " in
      *" $ISNANL_LIBM "*) ;;
      *) ISNAN_LIBM="$ISNAN_LIBM $ISNANL_LIBM" ;;
    esac
Ben Pfaff's avatar
Ben Pfaff committed
37
  else
38
    AC_MSG_RESULT([no])
39
    dnl REPLACE_ISNAN=1 also makes sure the rpl_isnan[fdl] functions get built.
40 41
    REPLACE_ISNAN=1
    ISNAN_LIBM=
Ben Pfaff's avatar
Ben Pfaff committed
42
  fi
43
  AC_SUBST([ISNAN_LIBM])
Ben Pfaff's avatar
Ben Pfaff committed
44
])