Blame m4/printf-frexp.m4

Packit Service a2489d
# printf-frexp.m4 serial 5
Packit Service a2489d
dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
Packit Service a2489d
dnl This file is free software; the Free Software Foundation
Packit Service a2489d
dnl gives unlimited permission to copy and/or distribute it,
Packit Service a2489d
dnl with or without modifications, as long as this notice is preserved.
Packit Service a2489d
Packit Service a2489d
dnl Check how to define printf_frexp() without linking with libm.
Packit Service a2489d
Packit Service a2489d
AC_DEFUN([gl_FUNC_PRINTF_FREXP],
Packit Service a2489d
[
Packit Service a2489d
  AC_REQUIRE([gl_CHECK_FREXP_NO_LIBM])
Packit Service a2489d
  if test $gl_cv_func_frexp_no_libm = yes; then
Packit Service a2489d
    gl_FUNC_FREXP_WORKS
Packit Service a2489d
    case "$gl_cv_func_frexp_works" in
Packit Service a2489d
      *yes)
Packit Service a2489d
        AC_DEFINE([HAVE_FREXP_IN_LIBC], [1],
Packit Service a2489d
          [Define if the frexp function is available in libc.])
Packit Service a2489d
        ;;
Packit Service a2489d
    esac
Packit Service a2489d
  fi
Packit Service a2489d
Packit Service a2489d
  AC_CACHE_CHECK([whether ldexp can be used without linking with libm],
Packit Service a2489d
    [gl_cv_func_ldexp_no_libm],
Packit Service a2489d
    [
Packit Service a2489d
      AC_LINK_IFELSE(
Packit Service a2489d
        [AC_LANG_PROGRAM(
Packit Service a2489d
           [[#include <math.h>
Packit Service a2489d
             double x;
Packit Service a2489d
             int y;]],
Packit Service a2489d
           [[return ldexp (x, y) < 1;]])],
Packit Service a2489d
        [gl_cv_func_ldexp_no_libm=yes],
Packit Service a2489d
        [gl_cv_func_ldexp_no_libm=no])
Packit Service a2489d
    ])
Packit Service a2489d
  if test $gl_cv_func_ldexp_no_libm = yes; then
Packit Service a2489d
    AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1],
Packit Service a2489d
      [Define if the ldexp function is available in libc.])
Packit Service a2489d
  fi
Packit Service a2489d
])