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