This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] libffi/: check mmap() availability explicitly
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Jul 2004 18:01:26 +0200 (CEST)
- Subject: [patch] libffi/: check mmap() availability explicitly
Hello,
The configure script in libffi/ relies on autoconf cache variables being
implictly set for its mmap() test. Unfortunately with the current set of
autotools used they are not set (anymore, probably) -- it's easily
verifiable -- the first occurence of "ac_cv_header_sys_mman_h" and
"ac_cv_func_mmap" in libffi/configure are tests of their values. Here is
a patch that fixes the problem for me.
2004-07-30 Maciej W. Rozycki <macro@linux-mips.org>
* acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for <sys/mman.h>
and mmap() explicitly instead of relying on preset autoconf cache
variables.
* aclocal.m4: Regenerate.
* configure: Regenerate.
I think the fix should be considered obvious and despite being somewhat
dated, it is still needed for the trunk. Please apply.
Maciej
gcc-3.5.0-20040322-libffi-ac25.patch
diff -up --recursive --new-file gcc-3.5.0-20040322.macro/libffi/acinclude.m4 gcc-3.5.0-20040322/libffi/acinclude.m4
--- gcc-3.5.0-20040322.macro/libffi/acinclude.m4 2003-11-22 03:29:37.000000000 +0000
+++ gcc-3.5.0-20040322/libffi/acinclude.m4 2004-01-24 02:54:32.000000000 +0000
@@ -11,8 +11,12 @@ AC_SUBST(LIBTOOL)
# mmap(2) blacklisting. Some platforms provide the mmap library routine
# but don't support all of the features we need from it.
AC_DEFUN([AC_FUNC_MMAP_BLACKLIST],
-[if test $ac_cv_header_sys_mman_h != yes \
- || test $ac_cv_func_mmap != yes; then
+[
+AC_CHECK_HEADER([sys/mman.h],
+ [libffi_header_sys_mman_h=yes], [libffi_header_sys_mman_h=no])
+AC_CHECK_FUNC([mmap], [libffi_func_mmap=yes], [libffi_func_mmap=no])
+if test "$libffi_header_sys_mman_h" != yes \
+ || test "$libffi_func_mmap" != yes; then
ac_cv_func_mmap_file=no
ac_cv_func_mmap_dev_zero=no
ac_cv_func_mmap_anon=no