| 1 |
# printf-frexp.m4 |
| 2 |
# serial 5 |
| 3 |
dnl Copyright (C) 2007, 2009-2026 Free Software Foundation, Inc. |
| 4 |
dnl This file is free software; the Free Software Foundation |
| 5 |
dnl gives unlimited permission to copy and/or distribute it, |
| 6 |
dnl with or without modifications, as long as this notice is preserved. |
| 7 |
dnl This file is offered as-is, without any warranty. |
| 8 |
|
| 9 |
dnl Check how to define printf_frexp() without linking with libm. |
| 10 |
|
| 11 |
AC_DEFUN([gl_FUNC_PRINTF_FREXP], |
| 12 |
[ |
| 13 |
AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM]) |
| 14 |
if test $gl_cv_func_frexp_no_libm = yes; then |
| 15 |
gl_FUNC_FREXP_WORKS |
| 16 |
case "$gl_cv_func_frexp_works" in |
| 17 |
*yes) |
| 18 |
AC_DEFINE([HAVE_FREXP_IN_LIBC], [1], |
| 19 |
[Define if the frexp function is available in libc.]) |
| 20 |
;; |
| 21 |
esac |
| 22 |
fi |
| 23 |
|
| 24 |
AC_CACHE_CHECK([whether ldexp can be used without linking with libm], |
| 25 |
[gl_cv_func_ldexp_no_libm], |
| 26 |
[ |
| 27 |
AC_LINK_IFELSE( |
| 28 |
[AC_LANG_PROGRAM( |
| 29 |
[[#include <math.h> |
| 30 |
double x; |
| 31 |
int y;]], |
| 32 |
[[return ldexp (x, y) < 1;]])], |
| 33 |
[gl_cv_func_ldexp_no_libm=yes], |
| 34 |
[gl_cv_func_ldexp_no_libm=no]) |
| 35 |
]) |
| 36 |
if test $gl_cv_func_ldexp_no_libm = yes; then |
| 37 |
AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1], |
| 38 |
[Define if the ldexp function is available in libc.]) |
| 39 |
fi |
| 40 |
]) |