Set ISNAN_LIBM to empty when libm is not actually needed.
[gnulib.git] / m4 / isnan.m4
1 # isnan.m4 serial 2
2 dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 AC_DEFUN([gl_ISNAN],
8 [
9   AC_REQUIRE([gl_MATH_H_DEFAULTS])
10   AC_REQUIRE([gl_FUNC_ISNANF])
11   AC_REQUIRE([gl_FUNC_ISNAND])
12   AC_REQUIRE([gl_FUNC_ISNANL])
13
14   # If we replaced any of the underlying isnan* functions, replace
15   # the isnan macro; it undoubtedly suffers from the same flaws.
16   AC_MSG_CHECKING([whether isnan macro works])
17   if test $gl_func_isnanf = yes \
18      && test $gl_func_isnand = yes \
19      && test $gl_func_isnanl = yes; then
20     AC_MSG_RESULT([yes])
21     ISNAN_LIBM="$ISNANF_LIBM $ISNAND_LIBM $ISNANL_LIBM"
22   else
23     AC_MSG_RESULT([no])
24     REPLACE_ISNAN=1
25     # Make sure the rpl_isnan[fdl] functions get built.
26     gl_BUILD_ISNANF
27     gl_BUILD_ISNAND
28     gl_BUILD_ISNANL
29     ISNAN_LIBM=
30   fi
31   AC_SUBST([ISNAN_LIBM])
32 ])