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_LOG1PL],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
11 AC_REQUIRE([gl_FUNC_LOG1P])
13 dnl Persuade glibc <math.h> to declare log1pl().
14 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
16 dnl Test whether log1pl() exists. Assume that log1pl(), if it exists, is
17 dnl defined in the same library as log1p().
19 LIBS="$LIBS $LOG1P_LIBM"
20 AC_CHECK_FUNCS([log1pl])
22 if test $ac_cv_func_log1pl = yes; then
23 LOG1PL_LIBM="$LOG1P_LIBM"
26 dnl Find libraries needed to link lib/log1pl.c.
27 if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
28 LOG1PL_LIBM="$LOG1P_LIBM"
30 AC_REQUIRE([gl_FUNC_ISNANL])
31 AC_REQUIRE([gl_FUNC_LOGL])
32 AC_REQUIRE([gl_FUNC_ROUNDL])
34 dnl Append $ISNANL_LIBM to LOG1PL_LIBM, avoiding gratuitous duplicates.
35 case " $LOG1PL_LIBM " in
36 *" $ISNANL_LIBM "*) ;;
37 *) LOG1PL_LIBM="$LOG1PL_LIBM $ISNANL_LIBM" ;;
39 dnl Append $LOGL_LIBM to LOG1PL_LIBM, avoiding gratuitous duplicates.
40 case " $LOG1PL_LIBM " in
42 *) LOG1PL_LIBM="$LOG1PL_LIBM $LOGL_LIBM" ;;
44 dnl Append $ROUNDL_LIBM to LOG1PL_LIBM, avoiding gratuitous duplicates.
45 case " $LOG1PL_LIBM " in
46 *" $ROUNDL_LIBM "*) ;;
47 *) LOG1PL_LIBM="$LOG1PL_LIBM $ROUNDL_LIBM" ;;
51 AC_SUBST([LOG1PL_LIBM])