2 dnl Copyright (C) 2007-2011 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.
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 dnl Persuade glibc <math.h> to declare isinf.
11 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12 AC_CHECK_DECLS([isinf], , , [#include <math.h>])
13 if test "$ac_cv_have_decl_isinf" = yes; then
14 gl_CHECK_MATH_LIB([ISINF_LIBM], [x = isinf (x);])
15 if test "$ISINF_LIBM" != missing; then
16 dnl Test whether isinf() on 'long double' works.
18 case "$gl_cv_func_isinfl_works" in
20 *) ISINF_LIBM=missing;;
24 if test "$ac_cv_have_decl_isinf" != yes ||
25 test "$ISINF_LIBM" = missing; then
27 dnl No libraries are needed to link lib/isinf.c.
30 AC_SUBST([ISINF_LIBM])
33 dnl Test whether isinf() correctly returns false for LDBL_MAX.
34 AC_DEFUN([gl_ISINFL_WORKS],
36 AC_REQUIRE([AC_PROG_CC])
37 AC_REQUIRE([gl_BIGENDIAN])
38 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
39 AC_CACHE_CHECK([whether isinf(long double) works], [gl_cv_func_isinfl_works],
41 AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <float.h>
43 [[return !!isinf(LDBL_MAX);]])],
44 [gl_cv_func_isinfl_works=yes],
45 [gl_cv_func_isinfl_works=no],
46 [gl_cv_func_isinfl_works="guessing no"])