2 # serial 4 (libsigsegv-2.15)
3 dnl Copyright (C) 2002-2024 Bruno Haible <bruno@clisp.org>
4 dnl This file is free software, distributed under the terms of the GNU
5 dnl General Public License as published by the Free Software Foundation;
6 dnl either version 2 of the License, or (at your option) any later version.
7 dnl As a special exception to the GNU General Public License, this file
8 dnl may be distributed as part of a program that contains a configuration
9 dnl script generated by Autoconf, under the same distribution terms as
10 dnl the rest of that program.
12 # How to determine the memory page size.
13 AC_DEFUN([SV_GETPAGESIZE],
15 AC_REQUIRE([AC_PROG_CC])
17 AC_CHECK_HEADERS([unistd.h])
21 AC_CACHE_CHECK([for getpagesize], [sv_cv_func_getpagesize], [
25 #include <sys/types.h>
29 [[int pgsz = getpagesize();]])],
30 [sv_cv_func_getpagesize=yes],
31 [sv_cv_func_getpagesize=no])])
32 if test $sv_cv_func_getpagesize = yes; then
33 AC_DEFINE([HAVE_GETPAGESIZE], [1],
34 [Define if getpagesize() is available as a function or a macro.])
37 dnl 2) sysconf(_SC_PAGESIZE).
39 AC_CACHE_CHECK([for sysconf(_SC_PAGESIZE)], [sv_cv_func_sysconf_pagesize], [
43 #include <sys/types.h>
47 [[int pgsz = sysconf (_SC_PAGESIZE);]])],
48 [sv_cv_func_sysconf_pagesize=yes],
49 [sv_cv_func_sysconf_pagesize=no])])
50 if test $sv_cv_func_sysconf_pagesize = yes; then
51 AC_DEFINE([HAVE_SYSCONF_PAGESIZE], [1],
52 [Define if sysconf(_SC_PAGESIZE) is available as a function or a macro.])
57 AC_CACHE_CHECK([for PAGESIZE in limits.h], [sv_cv_macro_pagesize], [
59 AC_LANG_PROGRAM([[#include <limits.h>]],
60 [[int pgsz = PAGESIZE;]])],
61 [sv_cv_macro_pagesize=yes],
62 [sv_cv_macro_pagesize=no])])
63 if test $sv_cv_macro_pagesize = yes; then
64 AC_DEFINE([HAVE_PAGESIZE], [1],
65 [Define if PAGESIZE is available as a macro.])
68 dnl 4) On BeOS, you need to include <OS.h> and use B_PAGE_SIZE.