Blame m4/printf-frexpl.m4

Packit Service a2489d
# printf-frexpl.m4 serial 10
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_frexpl() without linking with libm.
Packit Service a2489d
Packit Service a2489d
AC_DEFUN([gl_FUNC_PRINTF_FREXPL],
Packit Service a2489d
[
Packit Service a2489d
  AC_REQUIRE([gl_MATH_H_DEFAULTS])
Packit Service a2489d
  AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
Packit Service a2489d
Packit Service a2489d
  dnl Subset of gl_FUNC_FREXPL_NO_LIBM.
Packit Service a2489d
  gl_CHECK_FREXPL_NO_LIBM
Packit Service a2489d
  if test $gl_cv_func_frexpl_no_libm = yes; then
Packit Service a2489d
    gl_FUNC_FREXPL_WORKS
Packit Service a2489d
    case "$gl_cv_func_frexpl_works" in
Packit Service a2489d
      *yes) gl_func_frexpl_no_libm=yes ;;
Packit Service a2489d
      *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
Packit Service a2489d
    esac
Packit Service a2489d
  else
Packit Service a2489d
    gl_func_frexpl_no_libm=no
Packit Service a2489d
    dnl Set REPLACE_FREXPL here because the system may have frexpl in libm.
Packit Service a2489d
    REPLACE_FREXPL=1
Packit Service a2489d
  fi
Packit Service a2489d
  if test $gl_func_frexpl_no_libm = yes; then
Packit Service a2489d
    AC_DEFINE([HAVE_FREXPL_IN_LIBC], [1],
Packit Service a2489d
      [Define if the frexpl function is available in libc.])
Packit Service a2489d
    dnl Also check whether it's declared.
Packit Service a2489d
    dnl Mac OS X 10.3 has frexpl() in libc but doesn't declare it in <math.h>.
Packit Service a2489d
    AC_CHECK_DECL([frexpl], , [HAVE_DECL_FREXPL=0], [[#include <math.h>]])
Packit Service a2489d
  fi
Packit Service a2489d
Packit Service a2489d
  gl_CHECK_LDEXPL_NO_LIBM
Packit Service a2489d
  if test $gl_cv_func_ldexpl_no_libm = yes; then
Packit Service a2489d
    gl_FUNC_LDEXPL_WORKS
Packit Service a2489d
    case "$gl_cv_func_ldexpl_works" in
Packit Service a2489d
      *yes)
Packit Service a2489d
        AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1],
Packit Service a2489d
          [Define if the ldexpl function is available in libc.])
Packit Service a2489d
        dnl Also check whether it's declared.
Packit Service a2489d
        dnl Mac OS X 10.3 has ldexpl() in libc but doesn't declare it in <math.h>.
Packit Service a2489d
        AC_CHECK_DECL([ldexpl], , [HAVE_DECL_LDEXPL=0], [[#include <math.h>]])
Packit Service a2489d
        ;;
Packit Service a2489d
    esac
Packit Service a2489d
  fi
Packit Service a2489d
])