# HG changeset patch # User Bruno Haible # Date 1196683025 -3600 # Node ID aa7abd06f14824382cc2b82cd680a9ac8a556bc7 # Parent 986c2d658c651e3b9ce75cfd2213d0ae44ae134b Move declaration of getpagesize() from getpagesize.h to unistd.h. diff -r 986c2d658c65 -r aa7abd06f148 ChangeLog --- a/ChangeLog Mon Dec 03 12:53:14 2007 +0100 +++ b/ChangeLog Mon Dec 03 12:57:05 2007 +0100 @@ -1,3 +1,23 @@ +2007-12-02 Martin Lambers + Bruno Haible + + * lib/getpagesize.h: Remove file. + * lib/unistd.in.h: Include declaration of getpagesize here. + * m4/getpagesize.m4 (gl_FUNC_GETPAGESIZE): Renamed from gl_GETPAGESIZE. + Invoke gl_UNISTD_H_DEFAULTS. Set HAVE_GETPAGESIZE, HAVE_OS_H, + HAVE_SYS_PARAM_H. + * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETPAGESIZE, + HAVE_GETPAGESIZE, HAVE_OS_H, HAVE_SYS_PARAM_H. + * modules/getpagesize (Files): Remove lib/getpagesize.h. + (Depends-on): Add unistd. + (configure.ac): Invoke gl_UNISTD_MODULE_INDICATOR. + (Include): Use instead of getpagesize.h. + * modules/unistd (Makefile.am): Substitute also GNULIB_GETPAGESIZE, + HAVE_GETPAGESIZE, HAVE_OS_H, HAVE_SYS_PARAM_H. + * m4/pagealign_alloc.m4 (gl_PREREQ_PAGEALIGN_ALLOC): Remove + gl_GETPAGESIZE invocation, already handled by module dependency. + * lib/pagealign_alloc.c: Don't include getpagesize.h. + 2007-12-02 Bruno Haible * modules/strings-tests: New file. diff -r 986c2d658c65 -r aa7abd06f148 NEWS --- a/NEWS Mon Dec 03 12:53:14 2007 +0100 +++ b/NEWS Mon Dec 03 12:57:05 2007 +0100 @@ -6,6 +6,9 @@ Date Modules Changes +2007-12-03 getpagesize The include file is changed from "getpagesize.h" + to . + 2007-12-03 strcase The include file is changed from to . diff -r 986c2d658c65 -r aa7abd06f148 lib/getpagesize.h --- a/lib/getpagesize.h Mon Dec 03 12:53:14 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* Emulate getpagesize on systems that lack it. - Copyright (C) 1999, 2000, 2004, 2005 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#ifndef HAVE_GETPAGESIZE - -#include - -#if !defined getpagesize && defined _SC_PAGESIZE -# if ! (defined __VMS && __VMS_VER < 70000000) -# define getpagesize() sysconf (_SC_PAGESIZE) -# endif -#endif - -#if !defined getpagesize && defined __VMS -# ifdef __ALPHA -# define getpagesize() 8192 -# else -# define getpagesize() 512 -# endif -#endif - -/* This is for BeOS. */ -#if !defined getpagesize && HAVE_OS_H -# include -# if defined B_PAGE_SIZE -# define getpagesize() B_PAGE_SIZE -# endif -#endif - -/* This is for AmigaOS4.0. */ -#if !defined getpagesize && defined __amigaos4__ -# define getpagesize() 2048 -#endif - -#if !defined getpagesize && HAVE_SYS_PARAM_H -# include -# ifdef EXEC_PAGESIZE -# define getpagesize() EXEC_PAGESIZE -# else -# ifdef NBPG -# ifndef CLSIZE -# define CLSIZE 1 -# endif -# define getpagesize() (NBPG * CLSIZE) -# else -# ifdef NBPC -# define getpagesize() NBPC -# endif -# endif -# endif -#endif - -#endif /* not HAVE_GETPAGESIZE */ diff -r 986c2d658c65 -r aa7abd06f148 lib/pagealign_alloc.c --- a/lib/pagealign_alloc.c Mon Dec 03 12:53:14 2007 +0100 +++ b/lib/pagealign_alloc.c Mon Dec 03 12:57:05 2007 +0100 @@ -32,7 +32,6 @@ #endif #include "error.h" -#include "getpagesize.h" #include "xalloc.h" #include "gettext.h" diff -r 986c2d658c65 -r aa7abd06f148 lib/unistd.in.h --- a/lib/unistd.in.h Mon Dec 03 12:53:14 2007 +0100 +++ b/lib/unistd.in.h Mon Dec 03 12:57:05 2007 +0100 @@ -180,6 +180,61 @@ #endif +#if @GNULIB_GETPAGESIZE@ +# if !@HAVE_GETPAGESIZE@ +/* This is for POSIX systems. */ +# if !defined getpagesize && defined _SC_PAGESIZE +# if ! (defined __VMS && __VMS_VER < 70000000) +# define getpagesize() sysconf (_SC_PAGESIZE) +# endif +# endif +/* This is for older VMS. */ +# if !defined getpagesize && defined __VMS +# ifdef __ALPHA +# define getpagesize() 8192 +# else +# define getpagesize() 512 +# endif +# endif +/* This is for BeOS. */ +# if !defined getpagesize && @HAVE_OS_H@ +# include +# if defined B_PAGE_SIZE +# define getpagesize() B_PAGE_SIZE +# endif +# endif +/* This is for AmigaOS4.0. */ +# if !defined getpagesize && defined __amigaos4__ +# define getpagesize() 2048 +# endif +/* This is for older Unix systems. */ +# if !defined getpagesize && @HAVE_SYS_PARAM_H@ +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else +# ifdef NBPG +# ifndef CLSIZE +# define CLSIZE 1 +# endif +# define getpagesize() (NBPG * CLSIZE) +# else +# ifdef NBPC +# define getpagesize() NBPC +# endif +# endif +# endif +# endif +# endif +#elif defined GNULIB_POSIXCHECK +# undef getpagesize +# define getpagesize() \ + (GL_LINK_WARNING ("getpagesize is unportable - " \ + "use gnulib module getpagesize for portability"), \ + getpagesize ()) +#endif + + #if @GNULIB_LCHOWN@ # if @REPLACE_LCHOWN@ /* Change the owner of FILE to UID (if UID is not -1) and the group of FILE diff -r 986c2d658c65 -r aa7abd06f148 m4/getpagesize.m4 --- a/m4/getpagesize.m4 Mon Dec 03 12:53:14 2007 +0100 +++ b/m4/getpagesize.m4 Mon Dec 03 12:57:05 2007 +0100 @@ -1,13 +1,22 @@ -# getpagesize.m4 serial 6 -dnl Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. +# getpagesize.m4 serial 7 +dnl Copyright (C) 2002, 2004-2005, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -AC_DEFUN([gl_GETPAGESIZE], +AC_DEFUN([gl_FUNC_GETPAGESIZE], [ - dnl Prerequisites of lib/getpagesize.h. - AC_CHECK_HEADERS_ONCE(sys/param.h) - AC_CHECK_HEADERS(OS.h) - AC_CHECK_FUNCS(getpagesize) + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_CHECK_FUNCS([getpagesize]) + if test $ac_cv_func_getpagesize = no; then + HAVE_GETPAGESIZE=0 + AC_CHECK_HEADERS([OS.h]) + if test $ac_cv_header_OS_h = yes; then + HAVE_OS_H=1 + fi + AC_CHECK_HEADERS([sys/param.h]) + if test $ac_cv_header_sys_param_h = yes; then + HAVE_SYS_PARAM_H=1 + fi + fi ]) diff -r 986c2d658c65 -r aa7abd06f148 m4/pagealign_alloc.m4 --- a/m4/pagealign_alloc.m4 Mon Dec 03 12:53:14 2007 +0100 +++ b/m4/pagealign_alloc.m4 Mon Dec 03 12:57:05 2007 +0100 @@ -1,4 +1,4 @@ -#serial 4 +#serial 5 dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -17,7 +17,6 @@ AC_DEFUN([gl_PREREQ_PAGEALIGN_ALLOC], [ AC_REQUIRE([gl_FUNC_MMAP_ANON]) - AC_REQUIRE([gl_GETPAGESIZE]) AC_CHECK_FUNCS_ONCE([posix_memalign]) AC_CHECK_HEADERS_ONCE([unistd.h]) ]) diff -r 986c2d658c65 -r aa7abd06f148 m4/unistd_h.m4 --- a/m4/unistd_h.m4 Mon Dec 03 12:53:14 2007 +0100 +++ b/m4/unistd_h.m4 Mon Dec 03 12:57:05 2007 +0100 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 9 +# unistd_h.m4 serial 10 dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -38,6 +38,7 @@ GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE]) GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R]) + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) @@ -45,9 +46,12 @@ dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) + HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) + HAVE_OS_H=0; AC_SUBST([HAVE_OS_H]) + HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H]) REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN]) REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) diff -r 986c2d658c65 -r aa7abd06f148 modules/getpagesize --- a/modules/getpagesize Mon Dec 03 12:53:14 2007 +0100 +++ b/modules/getpagesize Mon Dec 03 12:57:05 2007 +0100 @@ -2,18 +2,19 @@ getpagesize() function: Return memory page size. Files: -lib/getpagesize.h m4/getpagesize.m4 Depends-on: +unistd configure.ac: -gl_GETPAGESIZE +gl_FUNC_GETPAGESIZE +gl_UNISTD_MODULE_INDICATOR([getpagesize]) Makefile.am: Include: -"getpagesize.h" + License: LGPL diff -r 986c2d658c65 -r aa7abd06f148 modules/unistd --- a/modules/unistd Mon Dec 03 12:53:14 2007 +0100 +++ b/modules/unistd Mon Dec 03 12:57:05 2007 +0100 @@ -29,15 +29,19 @@ -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \ -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \ -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \ + -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \ + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \ -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \ -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \ -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \