xfstests updates - rework build to be like other xfs packages, revive some old fs...
[xfstests-dev.git] / m4 / package_attrdev.m4
1 AC_DEFUN([AC_PACKAGE_NEED_ATTR_XATTR_H],
2   [ AC_CHECK_HEADERS([attr/xattr.h])
3     if test "$ac_cv_header_attr_xattr_h" != "yes"; then
4         echo
5         echo 'FATAL ERROR: attr/xattr.h does not exist.'
6         echo 'Install the extended attributes (attr) development package.'
7         echo 'Alternatively, run "make install-lib" from the attr source.'
8         exit 1
9     fi
10   ])
11
12 AC_DEFUN([AC_PACKAGE_NEED_ATTR_ERROR_H],
13   [ AC_CHECK_HEADERS([attr/error_context.h])
14     if test "$ac_cv_header_attr_error_context_h" != "yes"; then
15         echo
16         echo 'FATAL ERROR: attr/error_context.h does not exist.'
17         echo 'Install the extended attributes (attr) development package.'
18         echo 'Alternatively, run "make install-lib" from the attr source.'
19         exit 1
20     fi
21   ])
22
23 AC_DEFUN([AC_PACKAGE_NEED_ATTR_ATTRIBUTES_H],
24   [ AC_CHECK_HEADERS([attr/attributes.h])
25     if test "$ac_cv_header_attr_attributes_h" != "yes"; then
26         echo
27         echo 'FATAL ERROR: attr/attributes.h does not exist.'
28         echo 'Install the extended attributes (attr) development package.'
29         echo 'Alternatively, run "make install-lib" from the attr source.'
30         exit 1
31     fi
32   ])
33
34 AC_DEFUN([AC_PACKAGE_NEED_GETXATTR_LIBATTR],
35   [ AC_CHECK_LIB(attr, getxattr,, [
36         echo
37         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
38         echo 'Install the extended attributes (attr) development package.'
39         echo 'Alternatively, run "make install-lib" from the attr source.'
40         exit 1
41     ])
42     libattr="-lattr"
43     test -f `pwd`/../attr/libattr/libattr.la && \
44         libattr="`pwd`/../attr/libattr/libattr.la"
45     test -f /usr/lib/libattr.la && libattr="/usr/lib/libattr.la"
46     AC_SUBST(libattr)
47   ])
48
49 AC_DEFUN([AC_PACKAGE_NEED_ATTRGET_LIBATTR],
50   [ AC_CHECK_LIB(attr, attr_get,, [
51         echo
52         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
53         echo 'Install the extended attributes (attr) development package.'
54         echo 'Alternatively, run "make install-lib" from the attr source.'
55         exit 1
56     ])
57     libattr="-lattr"
58     test -f `pwd`/../attr/libattr/libattr.la && \
59         libattr="`pwd`/../attr/libattr/libattr.la"
60     test -f /usr/lib/libattr.la && libattr="/usr/lib/libattr.la"
61     AC_SUBST(libattr)
62   ])
63
64 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_MACROS],
65   [ AC_MSG_CHECKING([macros in attr/attributes.h])
66     AC_TRY_LINK([
67 #include <sys/types.h>
68 #include <attr/attributes.h>],
69     [ int x = ATTR_SHIFT; ], [
70         echo
71         echo 'FATAL ERROR: incorrect macros exist in attributes.h header file.'
72         echo 'Upgrade the extended attributes (attr) development package.'
73         echo 'Alternatively, run "make install-dev" from the attr source.'
74         exit 1 ],
75     [ echo ok ])
76   ])