generic/457: use thin volume for dmlogwrites target device
[xfstests-dev.git] / m4 / package_xfslibs.m4
1 AC_DEFUN([AC_PACKAGE_NEED_XFS_XFS_H],
2   [ AC_CHECK_HEADERS([xfs/xfs.h],,,[
3       #define _GNU_SOURCE
4       #define _FILE_OFFSET_BITS 64
5     ])
6     if test "$ac_cv_header_xfs_xfs_h" != "yes"; then
7         echo
8         echo 'FATAL ERROR: cannot find a valid <xfs/xfs.h> header file.'
9         echo 'Run "make install-dev" from the xfsprogs source.'
10         exit 1
11     fi
12   ])
13
14 AC_DEFUN([AC_PACKAGE_WANT_LIBXFS_H],
15   [ AC_CHECK_HEADERS([xfs/libxfs.h], [ have_libxfs=true ],
16     [ have_libxfs=false ], [#define _GNU_SOURCE])
17     AC_SUBST(have_libxfs)
18   ])
19
20 AC_DEFUN([AC_PACKAGE_WANT_XLOG_ASSIGN_LSN],
21   [ AC_CHECK_DECL(xlog_assign_lsn,
22       [ have_xlog_assign_lsn=true ], [ have_xlog_assign_lsn=false ], [[
23 #define _GNU_SOURCE
24 #include <xfs/libxfs.h>]])
25     AC_SUBST(have_xlog_assign_lsn)
26   ])
27
28 AC_DEFUN([AC_PACKAGE_NEED_XFS_XQM_H],
29   [ AC_CHECK_HEADERS([xfs/xqm.h],,,[
30         #define _GNU_SOURCE
31         #define _FILE_OFFSET_BITS 64
32     ])
33     if test "$ac_cv_header_xfs_xqm_h" != "yes"; then
34         echo
35         echo 'FATAL ERROR: cannot find a valid <xfs/xqm.h> header file.'
36         echo 'Install or upgrade the XFS development package.'
37         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
38         exit 1
39     fi
40   ])
41
42 AC_DEFUN([AC_PACKAGE_NEED_XFS_HANDLE_H],
43   [ AC_CHECK_HEADERS([xfs/handle.h])
44     if test "$ac_cv_header_xfs_handle_h" != "yes"; then
45         echo
46         echo 'FATAL ERROR: cannot find a valid <xfs/handle.h> header file.'
47         echo 'Install or upgrade the XFS development package.'
48         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
49         exit 1
50     fi
51   ])
52
53 AC_DEFUN([AC_PACKAGE_NEED_LIBXFSINIT_LIBXFS],
54   [ AC_CHECK_LIB(xfs, libxfs_init,, [
55         echo
56         echo 'FATAL ERROR: could not find a valid XFS base library.'
57         echo 'Install or upgrade the XFS library package.'
58         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
59         exit 1
60     ])
61     libxfs="-lxfs"
62     test -f ${libexecdir}${libdirsuffix}/libxfs.la && \
63         libxfs="${libexecdir}${libdirsuffix}/libxfs.la"
64     AC_SUBST(libxfs)
65   ])
66
67 AC_DEFUN([AC_PACKAGE_NEED_OPEN_BY_FSHANDLE],
68   [ AC_CHECK_LIB(handle, open_by_fshandle,, [
69         echo
70         echo 'FATAL ERROR: could not find a current XFS handle library.'
71         echo 'Install or upgrade the XFS library package.'
72         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
73         exit 1
74     ])
75     libhdl="-lhandle"
76     test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
77         libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
78     AC_SUBST(libhdl)
79   ])
80
81 AC_DEFUN([AC_PACKAGE_NEED_ATTRLIST_LIBHANDLE],
82   [ AC_CHECK_LIB(handle, attr_list_by_handle,, [
83         echo
84         echo 'FATAL ERROR: could not find a current XFS handle library.'
85         echo 'Install or upgrade the XFS library package.'
86         echo 'Alternatively, run "make install-lib" from the xfsprogs source.'
87         exit 1
88     ])
89     libhdl="-lhandle"
90     test -f ${libexecdir}${libdirsuffix}/libhandle.la && \
91         libhdl="${libexecdir}${libdirsuffix}/libhandle.la"
92     AC_SUBST(libhdl)
93   ])
94
95 AC_DEFUN([AC_PACKAGE_NEED_XFSCTL_MACRO],
96   [ AC_MSG_CHECKING([xfsctl from xfs/xfs.h])
97     AC_TRY_LINK([
98 #define _GNU_SOURCE
99 #define _FILE_OFFSET_BITS 64
100 #include <xfs/xfs.h> ],
101       [ int x = xfsctl(0, 0, 0, 0); ],
102       [ echo ok ],
103       [ echo
104         echo 'FATAL ERROR: cannot find required macros in the XFS headers.'
105         echo 'Upgrade your XFS programs (xfsprogs) development package.'
106         echo 'Alternatively, run "make install-dev" from the xfsprogs source.'
107         exit 1
108       ])
109   ])