dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FLOORL],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
AC_DEFUN([gl_FUNC_FLOORL],
[
AC_REQUIRE([gl_MATH_H_DEFAULTS])
- AC_CHECK_DECLS([floorl], , , [#include <math.h>])
+ AC_CHECK_DECLS([floorl], , , [[#include <math.h>]])
- dnl No libraries are needed to link lib/floorl.c.
- FLOORL_LIBM=
+ dnl Find libraries needed to link lib/floorl.c.
+ if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then
+ AC_REQUIRE([gl_FUNC_FLOOR])
+ FLOORL_LIBM="$FLOOR_LIBM"
+ else
+ FLOORL_LIBM=
+ fi