diff options
author | Bruno Haible <bruno@clisp.org> | 2011-10-11 02:11:21 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-10-11 02:11:21 +0200 |
commit | 6d273f723651db3faff61a76569eb44d8750b5f1 (patch) | |
tree | 44b13aead64531f0bd9b716b77c9f16dd534115c /m4/logl.m4 | |
parent | 150ee3a66dce0f413327e67322e5b89ed440bd71 (diff) | |
download | gnulib-6d273f723651db3faff61a76569eb44d8750b5f1.tar.gz |
logl: Simplify for platforms where 'long double' == 'double'.
* lib/logl.c (logl) [HAVE_SAME_LONG_DOUBLE_AS_DOUBLE]: New alternative
implementation.
* m4/logl.m4 (gl_FUNC_LOGL): Require gl_LONG_DOUBLE_VS_DOUBLE.
Determine LOGL_LIBM according to HAVE_SAME_LONG_DOUBLE_AS_DOUBLE.
* modules/logl (Depends-on): Add log. Update conditions.
Diffstat (limited to 'm4/logl.m4')
-rw-r--r-- | m4/logl.m4 | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/m4/logl.m4 b/m4/logl.m4 index 70a5eadfc6..f17e5e5f3f 100644 --- a/m4/logl.m4 +++ b/m4/logl.m4 @@ -1,4 +1,4 @@ -# logl.m4 serial 5 +# logl.m4 serial 6 dnl Copyright (C) 2010-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -7,6 +7,8 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_LOGL], [ AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + dnl Persuade glibc <math.h> to declare logl(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) @@ -56,24 +58,29 @@ AC_DEFUN([gl_FUNC_LOGL], HAVE_DECL_LOGL=0 HAVE_LOGL=0 dnl Find libraries needed to link lib/logl.c. - AC_REQUIRE([gl_FUNC_FREXPL]) - AC_REQUIRE([gl_FUNC_ISNANL]) - AC_REQUIRE([gl_FUNC_FLOORL]) - dnl Append $FREXPL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates. - case " $LOGL_LIBM " in - *" $FREXPL_LIBM "*) ;; - *) LOGL_LIBM="$LOGL_LIBM $FREXPL_LIBM" ;; - esac - dnl Append $ISNANL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates. - case " $LOGL_LIBM " in - *" $ISNANL_LIBM "*) ;; - *) LOGL_LIBM="$LOGL_LIBM $ISNANL_LIBM" ;; - esac - dnl Append $FLOORL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates. - case " $LOGL_LIBM " in - *" $FLOORL_LIBM "*) ;; - *) LOGL_LIBM="$LOGL_LIBM $FLOORL_LIBM" ;; - esac + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + AC_REQUIRE([gl_FUNC_LOG]) + LOGL_LIBM="$LOG_LIBM" + else + AC_REQUIRE([gl_FUNC_FREXPL]) + AC_REQUIRE([gl_FUNC_ISNANL]) + AC_REQUIRE([gl_FUNC_FLOORL]) + dnl Append $FREXPL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates. + case " $LOGL_LIBM " in + *" $FREXPL_LIBM "*) ;; + *) LOGL_LIBM="$LOGL_LIBM $FREXPL_LIBM" ;; + esac + dnl Append $ISNANL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates. + case " $LOGL_LIBM " in + *" $ISNANL_LIBM "*) ;; + *) LOGL_LIBM="$LOGL_LIBM $ISNANL_LIBM" ;; + esac + dnl Append $FLOORL_LIBM to LOGL_LIBM, avoiding gratuitous duplicates. + case " $LOGL_LIBM " in + *" $FLOORL_LIBM "*) ;; + *) LOGL_LIBM="$LOGL_LIBM $FLOORL_LIBM" ;; + esac + fi fi AC_SUBST([LOGL_LIBM]) ]) |