diff options
author | Geoffrey Keating <geoffk@apple.com> | 2002-11-23 00:20:13 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2002-11-23 00:20:13 +0000 |
commit | 199cbacc9083bdb7d02bae97a2986a213e4a8929 (patch) | |
tree | 2746f5cb8d456ca3c60d7dabc7db8a51a3a150cf /gcc/aclocal.m4 | |
parent | 05abed76a9a443782d8bf3aee18ccc6f3e5fa8dc (diff) | |
download | gcc-199cbacc9083bdb7d02bae97a2986a213e4a8929.zip gcc-199cbacc9083bdb7d02bae97a2986a213e4a8929.tar.gz gcc-199cbacc9083bdb7d02bae97a2986a213e4a8929.tar.bz2 |
aclocal.m4 (ac_cv_func_mmap_dev_zero): Darwin does not allow mmap from /dev/zero.
* 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.
From-SVN: r59394
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 acfef12..0cec464 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.]) |