2 dnl Copyright (C) 2007 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_CEILL],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 dnl Persuade glibc <math.h> to declare ceill().
11 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12 dnl Test whether ceill() is declared.
13 AC_CHECK_DECLS([ceill], , , [#include <math.h>])
14 if test "$ac_cv_have_decl_ceill" = yes; then
15 dnl Test whether ceill() can be used without libm.
17 if test "$CEILL_LIBM" = "?"; then
25 AC_SUBST([HAVE_DECL_CEILL])
26 AC_SUBST([CEILL_LIBM])
29 # Determines the libraries needed to get the ceill() function.
31 AC_DEFUN([gl_FUNC_CEILL_LIBS],
33 AC_CACHE_VAL([gl_func_ceill_libm], [
36 #ifndef __NO_MATH_INLINES
37 # define __NO_MATH_INLINES 1 /* for glibc */
42 [gl_func_ceill_libm=])
43 if test "$gl_func_ceill_libm" = "?"; then
47 #ifndef __NO_MATH_INLINES
48 # define __NO_MATH_INLINES 1 /* for glibc */
53 [gl_func_ceill_libm="-lm"])
57 CEILL_LIBM="$gl_func_ceill_libm"