2 dnl Copyright (C) 2011-2017 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.
7 AC_DEFUN([gl_FUNC_EXPM1F],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 AC_REQUIRE([gl_FUNC_EXPM1])
12 dnl Persuade glibc <math.h> to declare expm1f().
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
15 dnl Test whether expm1f() exists. Assume that expm1f(), if it exists, is
16 dnl defined in the same library as expm1().
18 LIBS="$LIBS $EXPM1_LIBM"
19 AC_CHECK_FUNCS([expm1f])
21 if test $ac_cv_func_expm1f = yes; then
22 EXPM1F_LIBM="$EXPM1_LIBM"
24 LIBS="$LIBS $EXPM1F_LIBM"
27 case "$gl_cv_func_expm1f_works" in
29 *) REPLACE_EXPM1F=1 ;;
34 if test $HAVE_EXPM1F = 0 || test $REPLACE_EXPM1F = 1; then
35 dnl Find libraries needed to link lib/expm1f.c.
36 EXPM1F_LIBM="$EXPM1_LIBM"
38 AC_SUBST([EXPM1F_LIBM])
41 dnl Test whether expm1f() works.
42 dnl On IRIX 6.5, for arguments <= -17.32868, it returns -5.6295e14.
43 AC_DEFUN([gl_FUNC_EXPM1F_WORKS],
45 AC_REQUIRE([AC_PROG_CC])
46 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
47 AC_CACHE_CHECK([whether expm1f works], [gl_cv_func_expm1f_works],
63 [gl_cv_func_expm1f_works=yes],
64 [gl_cv_func_expm1f_works=no],
66 irix*) gl_cv_func_expm1f_works="guessing no" ;;
67 # Guess yes on native Windows.
68 mingw*) gl_cv_func_expm1f_works="guessing yes" ;;
69 *) gl_cv_func_expm1f_works="guessing yes" ;;