update NEWS.stable
[gnulib.git] / m4 / log10l.m4
1 # log10l.m4 serial 2
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.
6
7 AC_DEFUN([gl_FUNC_LOG10L],
8 [
9   AC_REQUIRE([gl_MATH_H_DEFAULTS])
10   AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
11   AC_REQUIRE([gl_FUNC_LOG10])
12
13   dnl Persuade glibc <math.h> to declare log10l().
14   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
15
16   dnl Test whether log10l() is declared. On AIX 5.1 it is not declared.
17   AC_CHECK_DECL([log10l], , [HAVE_DECL_LOG10L=0], [[#include <math.h>]])
18
19   dnl Test whether log10l() exists. Assume that log10l(), if it exists, is
20   dnl defined in the same library as log10().
21   save_LIBS="$LIBS"
22   LIBS="$LIBS $LOG10_LIBM"
23   AC_CHECK_FUNCS([log10l])
24   LIBS="$save_LIBS"
25   if test $ac_cv_func_log10l = yes; then
26     LOG10L_LIBM="$LOG10_LIBM"
27   else
28     HAVE_LOG10L=0
29     if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
30       LOG10L_LIBM="$LOG10_LIBM"
31     else
32       AC_REQUIRE([gl_FUNC_LOGL])
33       LOG10L_LIBM="$LOGL_LIBM"
34     fi
35   fi
36   AC_SUBST([LOG10L_LIBM])
37 ])