getusershell: Work around musl bugs.
[gnulib.git] / m4 / isnan.m4
blob9b5a2d8de701ba9905b15d98e974ca1ccb2a65ef
1 # isnan.m4
2 # serial 5
3 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_ISNAN],
10   AC_REQUIRE([gl_MATH_H_DEFAULTS])
11   AC_REQUIRE([gl_FUNC_ISNANF])
12   AC_REQUIRE([gl_FUNC_ISNAND])
13   AC_REQUIRE([gl_FUNC_ISNANL])
15   # If we replaced any of the underlying isnan* functions, replace
16   # the isnan macro; it undoubtedly suffers from the same flaws.
17   AC_MSG_CHECKING([whether isnan macro works])
18   if test $gl_func_isnanf = yes \
19      && test $gl_func_isnand = yes \
20      && test $gl_func_isnanl = yes; then
21     AC_MSG_RESULT([yes])
22     ISNAN_LIBM=
23     dnl Append $ISNANF_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
24     case " $ISNAN_LIBM " in
25       *" $ISNANF_LIBM "*) ;;
26       *) ISNAN_LIBM="$ISNAN_LIBM $ISNANF_LIBM" ;;
27     esac
28     dnl Append $ISNAND_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
29     case " $ISNAN_LIBM " in
30       *" $ISNAND_LIBM "*) ;;
31       *) ISNAN_LIBM="$ISNAN_LIBM $ISNAND_LIBM" ;;
32     esac
33     dnl Append $ISNANL_LIBM to ISNAN_LIBM, avoiding gratuitous duplicates.
34     case " $ISNAN_LIBM " in
35       *" $ISNANL_LIBM "*) ;;
36       *) ISNAN_LIBM="$ISNAN_LIBM $ISNANL_LIBM" ;;
37     esac
38   else
39     AC_MSG_RESULT([no])
40     dnl REPLACE_ISNAN=1 also makes sure the rpl_isnan[fdl] functions get built.
41     REPLACE_ISNAN=1
42     ISNAN_LIBM=
43   fi
44   AC_SUBST([ISNAN_LIBM])