diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-23 00:20:13 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-11-23 00:20:13 +0000 |
commit | fed269b32629f7fb98da5ab4aec225105038fffe (patch) | |
tree | 2746f5cb8d456ca3c60d7dabc7db8a51a3a150cf /gcc/aclocal.m4 | |
parent | b112d8735d87d75727df0da6a8cc6fa773b02c29 (diff) | |
download | gcc-fed269b32629f7fb98da5ab4aec225105038fffe.tar.gz |
* aclocal.m4 (ac_cv_func_mmap_dev_zero): Darwin does not
allow mmap from /dev/zero. Don't make decisions for the host
based on presence or absence of /dev/zero on the build machine.
(ac_cv_func_mmap_anon): Darwin does have working MMAP_ANON.
(AC_FUNC_MMAP_FILE): Darwin does have mmap of a file.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59394 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/aclocal.m4')
-rw-r--r-- | gcc/aclocal.m4 | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index acfef120c71..0cec464e2aa 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -660,14 +660,13 @@ AC_CACHE_CHECK(for working mmap from /dev/zero, then ac_cv_func_mmap_dev_zero=no else ac_cv_func_mmap_dev_zero=buggy fi], - # If this is not cygwin, and /dev/zero is a character device, it's probably - # safe to assume it works. + # When cross-building, assume that this works, unless we know it + # doesn't. Of course, we have no way of knowing if there even is a /dev/zero + # on the host, let alone whether mmap will work on it. [case "$host_os" in cygwin* | win32 | pe | mingw* ) ac_cv_func_mmap_dev_zero=buggy ;; - * ) if test -c /dev/zero - then ac_cv_func_mmap_dev_zero=yes - else ac_cv_func_mmap_dev_zero=no - fi ;; + darwin* ) ac_cv_func_mmap_dev_zero=no ;; + * ) ac_cv_func_mmap_dev_zero=yes ;; esac]) ]) if test $ac_cv_func_mmap_dev_zero = yes; then @@ -687,7 +686,10 @@ AC_CACHE_CHECK([for working mmap with MAP_ANON(YMOUS)], fi], # Unlike /dev/zero, it is not safe to assume MAP_ANON(YMOUS) works # just because it's there. Some SCO Un*xen define it but don't implement it. - ac_cv_func_mmap_anon=no) + [case "$host_os" in + darwin* ) ac_cv_func_mmap_anon=yes ;; + * ) ac_cv_func_mmap_anon=no ;; + esac]) ]) if test $ac_cv_func_mmap_anon = yes; then AC_DEFINE(HAVE_MMAP_ANON, 1, @@ -740,7 +742,10 @@ int main() exit(0); }], ac_cv_func_mmap_file=yes, ac_cv_func_mmap_file=no, -ac_cv_func_mmap_file=no)]) + [case "$host_os" in + darwin* ) ac_cv_func_mmap_file=yes ;; + * ) ac_cv_func_mmap_file=no ;; + esac])]) if test $ac_cv_func_mmap_file = yes; then AC_DEFINE(HAVE_MMAP_FILE, 1, [Define if read-only mmap of a plain file works.]) |