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_CEILF],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 dnl Persuade glibc <math.h> to declare ceilf().
11 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12 dnl Test whether ceilf() is declared.
13 AC_CHECK_DECLS([ceilf], , , [#include <math.h>])
14 if test "$ac_cv_have_decl_ceilf" = yes; then
15 dnl Test whether ceilf() can be used without libm.
17 if test "$CEILF_LIBM" = "?"; then
18 dnl Sun C 5.0 on Solaris declares ceilf() and has it in the system-wide
19 dnl libm.so, but not in the libm.so that the compiler uses.
25 if test $REPLACE_CEILF = 1; then
29 AC_SUBST([REPLACE_CEILF])
30 AC_SUBST([CEILF_LIBM])
33 # Determines the libraries needed to get the ceilf() function.
35 AC_DEFUN([gl_FUNC_CEILF_LIBS],
37 AC_CACHE_VAL([gl_cv_func_ceilf_libm], [
38 gl_cv_func_ceilf_libm=?
40 #ifndef __NO_MATH_INLINES
41 # define __NO_MATH_INLINES 1 /* for glibc */
46 [gl_cv_func_ceilf_libm=])
47 if test "$gl_cv_func_ceilf_libm" = "?"; then
51 #ifndef __NO_MATH_INLINES
52 # define __NO_MATH_INLINES 1 /* for glibc */
57 [gl_cv_func_ceilf_libm="-lm"])
61 CEILF_LIBM="$gl_cv_func_ceilf_libm"