configure: use AC_CHECK_FUNC to check for mmap

This commit is contained in:
Tim-Philipp Müller 2013-02-19 09:32:08 +00:00
parent 26ff0ced15
commit f56720fc7b

View file

@ -406,16 +406,7 @@ case $ac_cv_audioresample_format in
esac
dnl Check for mmap (needed by allocators library)
AC_MSG_CHECKING(if mmap is supported)
AC_TRY_LINK(
[#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>],
[char * p = (char *)mmap(NULL, 10, PROT_READ, MAP_SHARED, -1, 2);
munmap(p,10);],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MMAP, 1, [Defined if mmap is supported])],
[AC_MSG_RESULT(no)] )
AC_CHECK_FUNC([mmap], [AC_DEFINE(HAVE_MMAP, 1, [Defined if mmap is supported])])
dnl *** plug-ins to include ***