From ff4e7bb239e88a67baed668fd48e25236fee6b93 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Sat, 19 Feb 2000 00:44:46 +0000 Subject: [PATCH] * build fix for cygwin 2000-02-18 Frank Ch. Eigler From Jason "crash" Molenda : * configure.in: Check for getpagesize declaration. * mvmalloc.c, mmap-sup.c: Conditionally declare getpagesize. * configure: Regenerated. --- mmalloc/ChangeLog | 7 +++++++ mmalloc/configure | 47 +++++++++++++++++++++++++++++++++++++++++++++++ mmalloc/configure.in | 1 + mmalloc/mmap-sup.c | 2 ++ mmalloc/mvalloc.c | 2 ++ 5 files changed, 59 insertions(+) diff --git a/mmalloc/ChangeLog b/mmalloc/ChangeLog index cf6644a..2250a69 100644 --- a/mmalloc/ChangeLog +++ b/mmalloc/ChangeLog @@ -1,3 +1,10 @@ +2000-02-18 Frank Ch. Eigler + + From Jason "crash" Molenda : + * configure.in: Check for getpagesize declaration. + * mvmalloc.c, mmap-sup.c: Conditionally declare getpagesize. + * configure: Regenerated. + Fri Feb 18 11:42:21 2000 Andrew Cagney * configure.in: Check for . diff --git a/mmalloc/configure b/mmalloc/configure index a07f02a..8420dfa 100755 --- a/mmalloc/configure +++ b/mmalloc/configure @@ -1423,6 +1423,53 @@ EOF fi +echo $ac_n "checking whether getpagesize must be declared""... $ac_c" 1>&6 +echo "configure:1428: checking whether getpagesize must be declared" >&5 +if eval "test \"`echo '$''{'bfd_cv_decl_needed_getpagesize'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +int main() { +char *(*pfn) = (char *(*)) getpagesize +; return 0; } +EOF +if { (eval echo configure:1454: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + bfd_cv_decl_needed_getpagesize=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_decl_needed_getpagesize=yes +fi +rm -f conftest* +fi + +echo "$ac_t""$bfd_cv_decl_needed_getpagesize" 1>&6 +if test $bfd_cv_decl_needed_getpagesize = yes; then + cat >> confdefs.h <<\EOF +#define NEED_DECLARATION_GETPAGESIZE 1 +EOF + +fi + trap '' 1 2 15 cat > confcache <<\EOF diff --git a/mmalloc/configure.in b/mmalloc/configure.in index d0a5277..db7a4c2 100644 --- a/mmalloc/configure.in +++ b/mmalloc/configure.in @@ -30,5 +30,6 @@ AC_FUNC_MMAP AC_CHECK_HEADERS(limits.h stddef.h unistd.h) BFD_NEED_DECLARATION(sbrk) +BFD_NEED_DECLARATION(getpagesize) AC_OUTPUT(Makefile) diff --git a/mmalloc/mmap-sup.c b/mmalloc/mmap-sup.c index d9a61fb..56146e2 100644 --- a/mmalloc/mmap-sup.c +++ b/mmalloc/mmap-sup.c @@ -41,7 +41,9 @@ Boston, MA 02111-1307, USA. */ it out. */ static size_t pagesize; +#if NEED_DECLARATION_GETPAGESIZE extern int getpagesize PARAMS ((void)); +#endif #define PAGE_ALIGN(addr) (caddr_t) (((long)(addr) + pagesize - 1) & \ ~(pagesize - 1)) diff --git a/mmalloc/mvalloc.c b/mmalloc/mvalloc.c index 7acef67..e44942f 100644 --- a/mmalloc/mvalloc.c +++ b/mmalloc/mvalloc.c @@ -24,7 +24,9 @@ Boston, MA 02111-1307, USA. */ it out. */ static size_t cache_pagesize; +#if NEED_DECLARATION_GETPAGESIZE extern int getpagesize PARAMS ((void)); +#endif PTR mvalloc (md, size) -- 2.7.4