Files
apfstests/m4/package_attrdev.m4
T
Lu Fengqi 9b846275d6 build: fix undefined macro: AC_PACKAGE_NEED_GETXATTR_LIBATTR
Because the macro AC_PACKAGE_NEED_GETXATTR_LIBATTR was removed by
the following commit specified by fixes tag, we also need remove
AC_PACKAGE_NEED_GETXATTR_LIBATTR from configure.ac.

In addition, the libattr will not be set after the macro being
removed. This cause gcc fail to link the libattr for fsstress
correctly. The macro AC_PACKAGE_NEED_ATTRGET_LIBATTR has been
obsoleted, so change it to AC_PACKAGE_NEED_ATTRSET_LIBATTR and add
it to configure.ac. It can help check libattr and set libattr
variable.

Fixes: 42b851446f ("build: remove <attr/xattr.h> check")
Reported-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Tested-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-07-04 20:33:23 +08:00

55 lines
1.9 KiB
Plaintext

AC_DEFUN([AC_PACKAGE_NEED_ATTR_ERROR_H],
[ AC_CHECK_HEADERS([attr/error_context.h])
if test "$ac_cv_header_attr_error_context_h" != "yes"; then
echo
echo 'FATAL ERROR: attr/error_context.h does not exist.'
echo 'Install the extended attributes (attr) development package.'
echo 'Alternatively, run "make install-dev" from the attr source.'
exit 1
fi
])
AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_H],
[ have_attributes_h=false
AC_CHECK_HEADERS([attr/attributes.h sys/attributes.h], [have_attributes_h=true], )
if test "$have_attributes_h" = "false"; then
echo
echo 'FATAL ERROR: attributes.h does not exist.'
echo 'Install the extended attributes (attr) development package.'
echo 'Alternatively, run "make install-dev" from the attr source.'
exit 1
fi
])
AC_DEFUN([AC_PACKAGE_WANT_ATTRLIST_LIBATTR],
[ AC_CHECK_LIB(attr, attr_list, [have_attr_list=true], [have_attr_list=false])
AC_SUBST(have_attr_list)
])
AC_DEFUN([AC_PACKAGE_NEED_ATTRSET_LIBATTR],
[ AC_CHECK_LIB(attr, attr_set,, [
echo
echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
echo 'Install the extended attributes (attr) development package.'
echo 'Alternatively, run "make install-lib" from the attr source.'
exit 1
])
libattr="-lattr"
test -f ${libexecdir}${libdirsuffix}/libattr.la && \
libattr="${libexecdir}${libdirsuffix}/libattr.la"
AC_SUBST(libattr)
])
AC_DEFUN([AC_PACKAGE_NEED_ATTRIBUTES_MACROS],
[ AC_MSG_CHECKING([macros in attr/attributes.h])
AC_TRY_LINK([
#include <sys/types.h>
#include <attr/attributes.h>],
[ int x = ATTR_SECURE; ], [ echo ok ], [
echo
echo 'FATAL ERROR: could not find a current attributes header.'
echo 'Upgrade the extended attributes (attr) development package.'
echo 'Alternatively, run "make install-dev" from the attr source.'
exit 1 ])
])