+2010-07-12 Bruno Haible <bruno@clisp.org>
+
+ Unify tests that set gl_cv_func_ldexpl_no_libm.
+ * m4/ldexpl.m4 (gl_CHECK_LDEXPL_NO_LIBM): New macro, extracted from
+ gl_FUNC_LDEXPL.
+ (gl_FUNC_LDEXPL): Invoke it.
+ * m4/printf-frexpl.m4 (gl_FUNC_PRINTF_FREXPL): Likewise.
+
2010-07-12 Bruno Haible <bruno@clisp.org>
Unify tests that set gl_cv_func_ldexp_no_libm.
-# ldexpl.m4 serial 5
+# ldexpl.m4 serial 6
dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [#include <math.h>])
LDEXPL_LIBM=
if test $HAVE_DECL_LDEXPL = 1; then
- AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm],
- [gl_cv_func_ldexpl_no_libm],
- [
- AC_TRY_LINK([#include <math.h>
- long double x;],
- [return ldexpl (x, -1) > 0;],
- [gl_cv_func_ldexpl_no_libm=yes],
- [gl_cv_func_ldexpl_no_libm=no])
- ])
+ gl_CHECK_LDEXPL_NO_LIBM
if test $gl_cv_func_ldexpl_no_libm = no; then
AC_CACHE_CHECK([whether ldexpl() can be used with libm],
[gl_cv_func_ldexpl_in_libm],
AC_SUBST([LDEXPL_LIBM])
])
+dnl Test whether ldexpl() can be used without linking with libm.
+dnl Set gl_cv_func_ldexpl_no_libm to 'yes' or 'no' accordingly.
+AC_DEFUN([gl_CHECK_LDEXPL_NO_LIBM],
+[
+ AC_CACHE_CHECK([whether ldexpl() can be used without linking with libm],
+ [gl_cv_func_ldexpl_no_libm],
+ [
+ AC_TRY_LINK([#include <math.h>
+ long double x;],
+ [return ldexpl (x, -1) > 0;],
+ [gl_cv_func_ldexpl_no_libm=yes],
+ [gl_cv_func_ldexpl_no_libm=no])
+ ])
+])
+
dnl Test whether ldexpl() works on finite numbers (this fails on AIX 5.1
dnl and MacOS X 10.4/PowerPC).
AC_DEFUN([gl_FUNC_LDEXPL_WORKS],
AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [#include <math.h>])
fi
- AC_CACHE_CHECK([whether ldexpl can be used without linking with libm],
- [gl_cv_func_ldexpl_no_libm],
- [
- AC_TRY_LINK([#include <math.h>
- long double x;
- int y;],
- [return ldexpl (x, y) < 1;],
- [gl_cv_func_ldexpl_no_libm=yes],
- [gl_cv_func_ldexpl_no_libm=no])
- ])
+ gl_CHECK_LDEXPL_NO_LIBM
if test $gl_cv_func_ldexpl_no_libm = yes; then
gl_FUNC_LDEXPL_WORKS
case "$gl_cv_func_ldexpl_works" in