2 dnl Copyright (C) 2011-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_LOGF],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 AC_REQUIRE([gl_FUNC_LOG])
12 dnl Persuade glibc <math.h> to declare logf().
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
15 dnl Test whether logf() exists. Assume that logf(), if it exists, is
16 dnl defined in the same library as log().
18 LIBS="$LIBS $LOG_LIBM"
19 AC_CHECK_FUNCS([logf])
21 if test $ac_cv_func_logf = yes; then
24 LIBS="$LIBS $LOGF_LIBM"
27 case "$gl_cv_func_logf_works" in
34 if test $HAVE_LOGF = 0 || test $REPLACE_LOGF = 1; then
35 dnl Find libraries needed to link lib/logf.c.
36 if test $HAVE_LOGF = 0; then
43 dnl Test whether logf() works.
44 dnl On OSF/1 5.1, logf(-0.0f) is NaN.
45 AC_DEFUN([gl_FUNC_LOGF_WORKS],
47 AC_REQUIRE([AC_PROG_CC])
48 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
49 AC_CACHE_CHECK([whether logf works], [gl_cv_func_logf_works],
65 [gl_cv_func_logf_works=yes],
66 [gl_cv_func_logf_works=no],
68 osf*) gl_cv_func_logf_works="guessing no";;
69 *) gl_cv_func_logf_works="guessing yes";;