]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - m4/package_libcdev.m4
Document recent changes, enable -O2 by default for builds.
[thirdparty/xfsprogs-dev.git] / m4 / package_libcdev.m4
CommitLineData
0bba1a49
NS
1#
2# Check if we have a working fadvise system call
3#
4AC_DEFUN([AC_HAVE_FADVISE],
5 [ AC_MSG_CHECKING([for fadvise ])
6 AC_TRY_COMPILE([
7#define _GNU_SOURCE
8#define _FILE_OFFSET_BITS 64
9#include <fcntl.h>
10 ], [
38c187fe 11 posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
0bba1a49
NS
12 ], have_fadvise=yes
13 AC_MSG_RESULT(yes),
14 AC_MSG_RESULT(no))
15 AC_SUBST(have_fadvise)
16 ])
17
18#
19# Check if we have a working madvise system call
20#
21AC_DEFUN([AC_HAVE_MADVISE],
22 [ AC_MSG_CHECKING([for madvise ])
23 AC_TRY_COMPILE([
24#define _GNU_SOURCE
25#define _FILE_OFFSET_BITS 64
26#include <sys/mman.h>
27 ], [
28 posix_madvise(0, 0, MADV_NORMAL);
29 ], have_madvise=yes
30 AC_MSG_RESULT(yes),
31 AC_MSG_RESULT(no))
32 AC_SUBST(have_madvise)
33 ])
34
35#
36# Check if we have a working mincore system call
37#
38AC_DEFUN([AC_HAVE_MINCORE],
39 [ AC_MSG_CHECKING([for mincore ])
40 AC_TRY_COMPILE([
41#define _GNU_SOURCE
42#define _FILE_OFFSET_BITS 64
43#include <sys/mman.h>
44 ], [
45 mincore(0, 0, 0);
46 ], have_mincore=yes
47 AC_MSG_RESULT(yes),
48 AC_MSG_RESULT(no))
49 AC_SUBST(have_mincore)
50 ])
51
52#
53# Check if we have a working sendfile system call
54#
55AC_DEFUN([AC_HAVE_SENDFILE],
56 [ AC_MSG_CHECKING([for sendfile ])
57 AC_TRY_COMPILE([
58#define _GNU_SOURCE
59#define _FILE_OFFSET_BITS 64
60#include <sys/sendfile.h>
61 ], [
62 sendfile(0, 0, 0, 0);
63 ], have_sendfile=yes
64 AC_MSG_RESULT(yes),
65 AC_MSG_RESULT(no))
66 AC_SUBST(have_sendfile)
67 ])
cfe6e3f0
NS
68
69#
70# Check if we have a getmntent libc call (IRIX, Linux)
71#
72AC_DEFUN([AC_HAVE_GETMNTENT],
73 [ AC_MSG_CHECKING([for getmntent ])
74 AC_TRY_COMPILE([
75#include <stdio.h>
76#include <mntent.h>
77 ], [
78 getmntent(0);
79 ], have_getmntent=yes
80 AC_MSG_RESULT(yes),
81 AC_MSG_RESULT(no))
82 AC_SUBST(have_getmntent)
83 ])
84
85#
86# Check if we have a getmntinfo libc call (FreeBSD, Mac OS X)
87#
88AC_DEFUN([AC_HAVE_GETMNTINFO],
89 [ AC_MSG_CHECKING([for getmntinfo ])
90 AC_TRY_COMPILE([
91#include <sys/param.h>
92#include <sys/ucred.h>
93#include <sys/mount.h>
94 ], [
95 getmntinfo(0, 0);
96 ], have_getmntinfo=yes
97 AC_MSG_RESULT(yes),
98 AC_MSG_RESULT(no))
99 AC_SUBST(have_getmntinfo)
100 ])