Bug 19114 - working mmap not found by autoconf / getpagesize header problem
working mmap not found by autoconf / getpagesize header problem
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: autoconf (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jens Petersen
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-14 16:03 EDT by Mark Cooke
Modified: 2007-04-18 12:29 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-10 07:03:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mark Cooke 2000-10-14 16:03:13 EDT
Setup:

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.

Description:

configure fails to detect mmap as working.  tracing into the autoconf test
shows undefined references to getpagesize/read/write/open/umask/rand etc.
(See config.log)

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
functionality.

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
write/read/close/etc.

Cheers,

Mark
Comment 1 Jens Petersen 2001-06-29 03:29:54 EDT
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_DEFUN(AC_FUNC_MMAP,
-[AC_CHECK_HEADERS(unistd.h)
+[AC_CHECK_HEADERS(stdlib.h unistd.h sys/stat.h sys/types.h)
 AC_CHECK_FUNCS(getpagesize)
 AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped,
 [AC_TRY_RUN([
@@ -1039,11 +1072,24 @@
 #include <fcntl.h>
 #include <sys/mman.h>
 
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H


Note You need to log in before you can comment on or make changes to this bug.