Blame m4/getpagesize.m4

Packit 709fb3
# getpagesize.m4 serial 9
Packit 709fb3
dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2017 Free Software Foundation,
Packit 709fb3
dnl Inc.
Packit 709fb3
dnl This file is free software; the Free Software Foundation
Packit 709fb3
dnl gives unlimited permission to copy and/or distribute it,
Packit 709fb3
dnl with or without modifications, as long as this notice is preserved.
Packit 709fb3
Packit 709fb3
AC_DEFUN([gl_FUNC_GETPAGESIZE],
Packit 709fb3
[
Packit 709fb3
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
Packit 709fb3
  AC_REQUIRE([AC_CANONICAL_HOST])
Packit 709fb3
  AC_CHECK_FUNCS([getpagesize])
Packit 709fb3
  if test $ac_cv_func_getpagesize = no; then
Packit 709fb3
    HAVE_GETPAGESIZE=0
Packit 709fb3
    AC_CHECK_HEADERS([OS.h])
Packit 709fb3
    if test $ac_cv_header_OS_h = yes; then
Packit 709fb3
      HAVE_OS_H=1
Packit 709fb3
    fi
Packit 709fb3
    AC_CHECK_HEADERS([sys/param.h])
Packit 709fb3
    if test $ac_cv_header_sys_param_h = yes; then
Packit 709fb3
      HAVE_SYS_PARAM_H=1
Packit 709fb3
    fi
Packit 709fb3
  fi
Packit 709fb3
  case "$host_os" in
Packit 709fb3
    mingw*)
Packit 709fb3
      REPLACE_GETPAGESIZE=1
Packit 709fb3
      ;;
Packit 709fb3
  esac
Packit 709fb3
  dnl Also check whether it's declared.
Packit 709fb3
  dnl mingw has getpagesize() in libgcc.a but doesn't declare it.
Packit 709fb3
  AC_CHECK_DECL([getpagesize], , [HAVE_DECL_GETPAGESIZE=0])
Packit 709fb3
])