update nearly all FSF copyright year lists to include 2010
[gnulib.git] / m4 / ceil.m4
1 # ceil.m4 serial 3
2 dnl Copyright (C) 2007, 2009, 2010 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.
6
7 AC_DEFUN([gl_FUNC_CEIL],
8 [
9   dnl Test whether ceil() can be used without libm.
10   gl_FUNC_CEIL_LIBS
11   if test "$CEIL_LIBM" = "?"; then
12     CEIL_LIBM=
13   fi
14   AC_SUBST([CEIL_LIBM])
15 ])
16
17 # Determines the libraries needed to get the ceil() function.
18 # Sets CEIL_LIBM.
19 AC_DEFUN([gl_FUNC_CEIL_LIBS],
20 [
21   gl_CACHE_VAL_SILENT([gl_cv_func_ceil_libm], [
22     gl_cv_func_ceil_libm=?
23     AC_TRY_LINK([
24        #ifndef __NO_MATH_INLINES
25        # define __NO_MATH_INLINES 1 /* for glibc */
26        #endif
27        #include <math.h>
28        double x;],
29       [x = ceil(x);],
30       [gl_cv_func_ceil_libm=])
31     if test "$gl_cv_func_ceil_libm" = "?"; then
32       save_LIBS="$LIBS"
33       LIBS="$LIBS -lm"
34       AC_TRY_LINK([
35          #ifndef __NO_MATH_INLINES
36          # define __NO_MATH_INLINES 1 /* for glibc */
37          #endif
38          #include <math.h>
39          double x;],
40         [x = ceil(x);],
41         [gl_cv_func_ceil_libm="-lm"])
42       LIBS="$save_LIBS"
43     fi
44   ])
45   CEIL_LIBM="$gl_cv_func_ceil_libm"
46 ])