#
AC_DEFUN([AC_HAVE_FADVISE],
[ AC_MSG_CHECKING([for fadvise ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <fcntl.h>
- ], [
- posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
+ ]], [[
+posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
+ ]])
], have_fadvise=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_MADVISE],
[ AC_MSG_CHECKING([for madvise ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <sys/mman.h>
- ], [
- posix_madvise(0, 0, MADV_NORMAL);
+ ]], [[
+posix_madvise(0, 0, MADV_NORMAL);
+ ]])
], have_madvise=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_MINCORE],
[ AC_MSG_CHECKING([for mincore ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <sys/mman.h>
- ], [
- mincore(0, 0, 0);
+ ]], [[
+mincore(0, 0, 0);
+ ]])
], have_mincore=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_SENDFILE],
[ AC_MSG_CHECKING([for sendfile ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <sys/sendfile.h>
- ], [
- sendfile(0, 0, 0, 0);
+ ]], [[
+sendfile(0, 0, 0, 0);
+ ]])
], have_sendfile=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
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);
+ ]], [[
+getmntent(0);
+ ]])
], have_getmntent=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_FALLOCATE],
[ AC_MSG_CHECKING([for fallocate])
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <fcntl.h>
#include <linux/falloc.h>
- ], [
- fallocate(0, 0, 0, 0);
+ ]], [[
+fallocate(0, 0, 0, 0);
+ ]])
], have_fallocate=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_FIEMAP],
[ AC_MSG_CHECKING([for fiemap])
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <linux/fs.h>
#include <linux/fiemap.h>
- ], [
- struct fiemap *fiemap;
- ioctl(0, FS_IOC_FIEMAP, (unsigned long)fiemap);
+ ]], [[
+struct fiemap *fiemap;
+ioctl(0, FS_IOC_FIEMAP, (unsigned long)fiemap);
+ ]])
], have_fiemap=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_PREADV],
[ AC_MSG_CHECKING([for preadv])
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _BSD_SOURCE
#define _DEFAULT_SOURCE
#include <sys/uio.h>
- ], [
- preadv(0, 0, 0, 0);
+ ]], [[
+preadv(0, 0, 0, 0);
+ ]])
], have_preadv=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_PWRITEV2],
[ AC_MSG_CHECKING([for pwritev2])
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _BSD_SOURCE
#include <sys/uio.h>
- ], [
- pwritev2(0, 0, 0, 0, 0);
+ ]], [[
+pwritev2(0, 0, 0, 0, 0);
+ ]])
], have_pwritev2=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
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);
+ ]], [[
+syscall(__NR_copy_file_range, 0, 0, 0, 0, 0, 0);
+ ]])
], have_copy_file_range=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_SYNC_FILE_RANGE],
[ AC_MSG_CHECKING([for sync_file_range])
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <fcntl.h>
- ], [
- sync_file_range(0, 0, 0, 0);
+ ]], [[
+sync_file_range(0, 0, 0, 0);
+ ]])
], have_sync_file_range=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_SYNCFS],
[ AC_MSG_CHECKING([for syncfs])
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <unistd.h>
- ], [
- syncfs(0);
+ ]], [[
+syncfs(0);
+ ]])
], have_syncfs=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_READDIR],
[ AC_MSG_CHECKING([for readdir])
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM([[
#include <dirent.h>
- ], [
- readdir(0);
+ ]], [[
+readdir(0);
+ ]])
], have_readdir=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_GETFSMAP],
[ AC_MSG_CHECKING([for GETFSMAP])
- AC_TRY_LINK([
+ AC_LINK_IFELSE(
+ [ AC_LANG_PROGRAM([[
#define _GNU_SOURCE
#include <sys/syscall.h>
#include <unistd.h>
#include <linux/fs.h>
#include <linux/fsmap.h>
- ], [
- unsigned long x = FS_IOC_GETFSMAP;
- struct fsmap_head fh;
+ ]], [[
+unsigned long x = FS_IOC_GETFSMAP;
+struct fsmap_head fh;
+ ]])
], have_getfsmap=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_MAP_SYNC],
[ AC_MSG_CHECKING([for MAP_SYNC])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM([[
#include <asm-generic/mman.h>
#include <asm-generic/mman-common.h>
- ], [
- int flags = MAP_SYNC | MAP_SHARED_VALIDATE;
+ ]], [[
+int flags = MAP_SYNC | MAP_SHARED_VALIDATE;
+ ]])
], have_map_sync=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_MALLINFO],
[ AC_MSG_CHECKING([for mallinfo ])
- AC_TRY_COMPILE([
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM([[
#include <malloc.h>
- ], [
- struct mallinfo test;
+ ]], [[
+struct mallinfo test;
- test.arena = 0; test.hblkhd = 0; test.uordblks = 0; test.fordblks = 0;
- test = mallinfo();
+test.arena = 0; test.hblkhd = 0; test.uordblks = 0; test.fordblks = 0;
+test = mallinfo();
+ ]])
], have_mallinfo=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_SG_IO],
[ AC_MSG_CHECKING([for struct sg_io_hdr ])
- AC_TRY_COMPILE([#include <scsi/sg.h>],
- [
- struct sg_io_hdr hdr;
- ioctl(0, SG_IO, &hdr);
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM([[
+#include <scsi/sg.h>
+ ]], [[
+struct sg_io_hdr hdr;
+ioctl(0, SG_IO, &hdr);
+ ]])
], have_sg_io=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
#
AC_DEFUN([AC_HAVE_HDIO_GETGEO],
[ AC_MSG_CHECKING([for struct hd_geometry ])
- AC_TRY_COMPILE([#include <linux/hdreg.h>],
- [
- struct hd_geometry hdr;
- ioctl(0, HDIO_GETGEO, &hdr);
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM([[
+#include <linux/hdreg.h>,
+ ]], [[
+struct hd_geometry hdr;
+ioctl(0, HDIO_GETGEO, &hdr);
+ ]])
], have_hdio_getgeo=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))