summaryrefslogtreecommitdiff
path: root/m4/package_libcdev.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/package_libcdev.m4')
-rw-r--r--m4/package_libcdev.m463
1 files changed, 28 insertions, 35 deletions
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index 14e67e18..5c76c0f7 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -3,15 +3,14 @@
#
AC_DEFUN([AC_HAVE_FADVISE],
[ AC_MSG_CHECKING([for fadvise ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
- ], [
+ ]], [[
posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
- ], have_fadvise=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+ ]])],[have_fadvise=yes
+ AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_SUBST(have_fadvise)
])
@@ -20,15 +19,14 @@ AC_DEFUN([AC_HAVE_FADVISE],
#
AC_DEFUN([AC_HAVE_MADVISE],
[ AC_MSG_CHECKING([for madvise ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <sys/mman.h>
- ], [
+ ]], [[
posix_madvise(0, 0, MADV_NORMAL);
- ], have_madvise=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+ ]])],[have_madvise=yes
+ AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_SUBST(have_madvise)
])
@@ -37,15 +35,14 @@ AC_DEFUN([AC_HAVE_MADVISE],
#
AC_DEFUN([AC_HAVE_MINCORE],
[ AC_MSG_CHECKING([for mincore ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <sys/mman.h>
- ], [
+ ]], [[
mincore(0, 0, 0);
- ], have_mincore=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+ ]])],[have_mincore=yes
+ AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_SUBST(have_mincore)
])
@@ -54,15 +51,14 @@ AC_DEFUN([AC_HAVE_MINCORE],
#
AC_DEFUN([AC_HAVE_SENDFILE],
[ AC_MSG_CHECKING([for sendfile ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <sys/sendfile.h>
- ], [
+ ]], [[
sendfile(0, 0, 0, 0);
- ], have_sendfile=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+ ]])],[have_sendfile=yes
+ AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_SUBST(have_sendfile)
])
@@ -71,14 +67,13 @@ AC_DEFUN([AC_HAVE_SENDFILE],
#
AC_DEFUN([AC_HAVE_GETMNTENT],
[ AC_MSG_CHECKING([for getmntent ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <mntent.h>
- ], [
+ ]], [[
getmntent(0);
- ], have_getmntent=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+ ]])],[have_getmntent=yes
+ AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_SUBST(have_getmntent)
])
@@ -87,15 +82,14 @@ AC_DEFUN([AC_HAVE_GETMNTENT],
#
AC_DEFUN([AC_HAVE_GETMNTINFO],
[ AC_MSG_CHECKING([for getmntinfo ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/param.h>
#include <sys/ucred.h>
#include <sys/mount.h>
- ], [
+ ]], [[
getmntinfo(0, 0);
- ], have_getmntinfo=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+ ]])],[have_getmntinfo=yes
+ AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_SUBST(have_getmntinfo)
])
@@ -105,15 +99,14 @@ AC_DEFUN([AC_HAVE_GETMNTINFO],
#
AC_DEFUN([AC_HAVE_COPY_FILE_RANGE],
[ AC_MSG_CHECKING([for copy_file_range])
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <sys/syscall.h>
#include <unistd.h>
- ], [
+ ]], [[
syscall(__NR_copy_file_range, 0, 0, 0, 0, 0, 0);
- ], have_copy_file_range=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+ ]])],[have_copy_file_range=yes
+ AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])
AC_SUBST(have_copy_file_range)
])