2 dnl Copyright (C) 2012 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_LOG1PF],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 AC_REQUIRE([gl_FUNC_LOG1P])
12 dnl Persuade glibc <math.h> to declare log1pf().
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
15 dnl Test whether log1pf() exists. Assume that log1pf(), if it exists, is
16 dnl defined in the same library as log1p().
18 LIBS="$LIBS $LOG1P_LIBM"
19 AC_CHECK_FUNCS([log1pf])
21 if test $ac_cv_func_log1pf = yes; then
22 LOG1PF_LIBM="$LOG1P_LIBM"
25 LIBS="$LIBS $LOG1PF_LIBM"
28 case "$gl_cv_func_log1pf_works" in
30 *) REPLACE_LOG1PF=1 ;;
35 if test $HAVE_LOG1PF = 0 || test $REPLACE_LOG1PF = 1; then
36 dnl Find libraries needed to link lib/log1pf.c.
37 LOG1PF_LIBM="$LOG1P_LIBM"
39 AC_SUBST([LOG1PF_LIBM])
42 dnl Test whether log1pf() works.
43 dnl On IRIX 6.5, log1pf(-1.0f) returns +Infinity instead of -Infinity.
44 AC_DEFUN([gl_FUNC_LOG1PF_WORKS],
46 AC_REQUIRE([AC_PROG_CC])
47 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
48 AC_CACHE_CHECK([whether log1pf works], [gl_cv_func_log1pf_works],
59 if (!(y + y == y && y < 0.0f))
64 [gl_cv_func_log1pf_works=yes],
65 [gl_cv_func_log1pf_works=no],
67 irix*) gl_cv_func_log1pf_works="guessing no";;
68 *) gl_cv_func_log1pf_works="guessing yes";;