Blame m4/limits-h.m4

Packit Service fdd496
dnl Check whether limits.h has needed features.
Packit Service fdd496
Packit Service fdd496
dnl Copyright 2016-2017 Free Software Foundation, Inc.
Packit Service fdd496
dnl This file is free software; the Free Software Foundation
Packit Service fdd496
dnl gives unlimited permission to copy and/or distribute it,
Packit Service fdd496
dnl with or without modifications, as long as this notice is preserved.
Packit Service fdd496
Packit Service fdd496
dnl From Paul Eggert.
Packit Service fdd496
Packit Service fdd496
AC_DEFUN_ONCE([gl_LIMITS_H],
Packit Service fdd496
[
Packit Service fdd496
  gl_CHECK_NEXT_HEADERS([limits.h])
Packit Service fdd496
Packit Service fdd496
  AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
Packit Service fdd496
    [gl_cv_header_limits_width],
Packit Service fdd496
    [AC_COMPILE_IFELSE(
Packit Service fdd496
       [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
Packit Service fdd496
                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
Packit Service fdd496
                          #endif
Packit Service fdd496
                          #include <limits.h>
Packit Service fdd496
                          int ullw = ULLONG_WIDTH;]])],
Packit Service fdd496
       [gl_cv_header_limits_width=yes],
Packit Service fdd496
       [gl_cv_header_limits_width=no])])
Packit Service fdd496
  if test "$gl_cv_header_limits_width" = yes; then
Packit Service fdd496
    LIMITS_H=
Packit Service fdd496
  else
Packit Service fdd496
    LIMITS_H=limits.h
Packit Service fdd496
  fi
Packit Service fdd496
  AC_SUBST([LIMITS_H])
Packit Service fdd496
  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
Packit Service fdd496
])