generic: test for non-zero used blocks while writing into a file
[xfstests-dev.git] / m4 / package_attrdev.m4
1 AC_DEFUN([AC_PACKAGE_NEED_ATTR_ERROR_H],
2   [ AC_CHECK_HEADERS([attr/error_context.h])
3     if test "$ac_cv_header_attr_error_context_h" != "yes"; then
4         echo
5         echo 'FATAL ERROR: attr/error_context.h does not exist.'
6         echo 'Install the extended attributes (attr) development package.'
7         echo 'Alternatively, run "make install-dev" from the attr source.'
8         exit 1
9     fi
10   ])
11
12 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_H],
13   [ have_attributes_h=false
14     AC_CHECK_HEADERS([attr/attributes.h sys/attributes.h], [have_attributes_h=true], )
15     if test "$have_attributes_h" = "false"; then
16         echo
17         echo 'FATAL ERROR: attributes.h does not exist.'
18         echo 'Install the extended attributes (attr) development package.'
19         echo 'Alternatively, run "make install-dev" from the attr source.'
20         exit 1
21     fi
22   ])
23
24 AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
25   [ AC_CHECK_LIB(attr, attr_list, [have_attr_list=true], [have_attr_list=false])
26     AC_SUBST(have_attr_list)
27   ])
28
29 AC_DEFUN([AC_PACKAGE_NEED_ATTRSET_LIBATTR],
30   [ AC_CHECK_LIB(attr, attr_set,, [
31         echo
32         echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
33         echo 'Install the extended attributes (attr) development package.'
34         echo 'Alternatively, run "make install-lib" from the attr source.'
35         exit 1
36     ])
37     libattr="-lattr"
38     test -f ${libexecdir}${libdirsuffix}/libattr.la && \
39         libattr="${libexecdir}${libdirsuffix}/libattr.la"
40     AC_SUBST(libattr)
41   ])
42
43 AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_MACROS],
44   [ AC_MSG_CHECKING([macros in attr/attributes.h])
45     AC_TRY_LINK([
46 #include <sys/types.h>
47 #include <attr/attributes.h>],
48     [ int x = ATTR_SECURE; ], [ echo ok ], [
49         echo
50         echo 'FATAL ERROR: could not find a current attributes header.'
51         echo 'Upgrade the extended attributes (attr) development package.'
52         echo 'Alternatively, run "make install-dev" from the attr source.'
53         exit 1 ])
54   ])