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.
7 AC_DEFUN([gl_FUNC_TRUNC],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
10 dnl Persuade glibc <math.h> to declare trunc().
11 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12 dnl Test whether trunc() is declared.
13 AC_CHECK_DECLS([trunc], , , [#include <math.h>])
14 if test "$ac_cv_have_decl_trunc" = yes; then
15 dnl Test whether trunc() can be used without libm.
18 #ifndef __NO_MATH_INLINES
19 # define __NO_MATH_INLINES 1 /* for glibc */
25 if test "$TRUNC_LIBM" = "?"; then
29 #ifndef __NO_MATH_INLINES
30 # define __NO_MATH_INLINES 1 /* for glibc */
38 if test "$TRUNC_LIBM" = "?"; then
46 AC_SUBST([HAVE_DECL_TRUNC])
47 AC_SUBST([TRUNC_LIBM])