Red Hat Bugzilla – Bug 19114
working mmap not found by autoconf / getpagesize header problem
Last modified: 2007-04-18 12:29:21 EDT
Compiling Livid/OMS from CVS - www.linuxvideo.org on RH 7.0
Steps to Repeat:
1. Checkout current cvs (3pm, 14th October)
2. Run autogen.sh from the oms tree.
configure fails to detect mmap as working. tracing into the autoconf test
shows undefined references to getpagesize/read/write/open/umask/rand etc.
The autoconf test in /usr/share/autoconf/acspecific.m4 does not appear to
contain the correct set of header includes for an error-free test of mmap
RH7 appears to need at least stdlib.h (for rand) and sys/stat.h (for umask)
added to the headers used in the test.
The autoconf with RH7 also doesn't actually include unistd.h because as
part of the earlier OMS configure, HAVE_GETPAGESIZE is defined. This
breaks the test in acspecific too - unistd.h is needed on RH7 for
Thank you for the report and sorry for the slow response.
[This is already fixed in autoconf-2.50.]
The following patch seems to solve the problem in 2.13. Tested on oms-0.1.2.
--- autoconf-2.13/acspecific.m4.orig Fri Jun 29 16:26:39 2001
+++ autoconf-2.13/acspecific.m4 Fri Jun 29 16:26:39 2001
@@ -1010,7 +1043,7 @@
+[AC_CHECK_HEADERS(stdlib.h unistd.h sys/stat.h sys/types.h)
AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped,
@@ -1039,11 +1072,24 @@
+# include <sys/types.h>
+# include <stdlib.h>
+# include <sys/stat.h>
+# include <unistd.h>
/* This mess was copied from the GNU getpagesize.h. */
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H