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_FREXPL],
9 AC_REQUIRE([gl_MATH_H_DEFAULTS])
11 AC_CACHE_CHECK([whether frexpl() can be used without linking with libm],
12 [gl_cv_func_frexpl_no_libm],
14 AC_TRY_LINK([#include <math.h>
16 [int e; return frexpl (x, &e) > 0;],
17 [gl_cv_func_frexpl_no_libm=yes],
18 [gl_cv_func_frexpl_no_libm=no])
20 if test $gl_cv_func_frexpl_no_libm = no; then
21 AC_CACHE_CHECK([whether frexpl() can be used with libm],
22 [gl_cv_func_frexpl_in_libm],
26 AC_TRY_LINK([#include <math.h>
28 [int e; return frexpl (x, &e) > 0;],
29 [gl_cv_func_frexpl_in_libm=yes],
30 [gl_cv_func_frexpl_in_libm=no])
33 if test $gl_cv_func_frexpl_in_libm = yes; then
37 if test $gl_cv_func_frexpl_no_libm = yes \
38 || test $gl_cv_func_frexpl_in_libm = yes; then
39 AC_DEFINE([HAVE_FREXPL], 1,
40 [Define if the frexpl() function is available.])
41 dnl Also check whether it's declared.
42 dnl MacOS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
43 AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])