configure: explicitly check for sys/mman.h header

And use header-specific guards.

https://bugzilla.gnome.org/show_bug.cgi?id=667292
This commit is contained in:
Idar Tollefsen 2012-05-15 19:04:39 +01:00 committed by Tim-Philipp Müller
parent f85885474c
commit 7a70c91ac3
3 changed files with 8 additions and 1 deletions

View file

@ -425,6 +425,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
AC_MSG_RESULT($broken_poll)
dnl check for mmap()
AC_CHECK_HEADERS([sys/mman.h], [], [], [AC_INCLUDES_DEFAULT])
AC_FUNC_MMAP
AM_CONDITIONAL(HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")

View file

@ -63,7 +63,7 @@
# include <unistd.h>
#endif
#ifdef HAVE_MMAP
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif

View file

@ -18,10 +18,16 @@
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <unistd.h>
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>