X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftar;a=blobdiff_plain;f=acinclude.m4;h=3b28b3bd63ddacd9cab238882a81dad73a26d78e;hp=d48c881dd1ae4d95c694e93617feabe8235571f1;hb=HEAD;hpb=cd7bdd4076ca154575bbef85eb2157e59befcfe2 diff --git a/acinclude.m4 b/acinclude.m4 index d48c881..3b28b3b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,6 +1,6 @@ dnl Special Autoconf macros for GNU tar -*- autoconf -*- -dnl Copyright 2009, 2013 Free Software Foundation, Inc. +dnl Copyright 2009, 2013-2014 Free Software Foundation, Inc. dnl dnl This file is part of GNU tar. dnl @@ -37,18 +37,40 @@ AC_DEFUN([TAR_HEADERS_ATTR_XATTR_H], [], [with_xattrs=maybe] ) - AC_CHECK_HEADERS([attr/xattr.h]) - AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_attr_xattr_h" = yes]) - if test "$ac_cv_header_attr_xattr_h" = yes; then + # First check for + AC_CHECK_HEADERS([sys/xattr.h]) + AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_sys_xattr_h" = yes]) + AM_CONDITIONAL([TAR_LIB_ATTR],[false]) + if test "$ac_cv_header_sys_xattr_h" = yes; then AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \ setxattr fsetxattr lsetxattr \ listxattr flistxattr llistxattr, # only when functions are present - AC_DEFINE([HAVE_ATTR_XATTR_H], [1], - [define to 1 if we have header]) + AC_DEFINE([HAVE_SYS_XATTR_H], [1], + [define to 1 if we have header]) if test "$with_xattrs" != no; then AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.]) fi ) fi + + # If is not found, then check for + if test "$ac_cv_header_sys_xattr_h" != yes; then + AC_CHECK_HEADERS([attr/xattr.h]) + AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_attr_xattr_h" = yes]) + AC_CHECK_LIB([attr],[fgetxattr]) + AM_CONDITIONAL([TAR_LIB_ATTR],[test "$ac_cv_lib_attr_fgetxattr" = yes]) + if test "$ac_cv_header_attr_xattr_h" = yes; then + AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \ + setxattr fsetxattr lsetxattr \ + listxattr flistxattr llistxattr, + # only when functions are present + AC_DEFINE([HAVE_ATTR_XATTR_H], [1], + [define to 1 if we have header]) + if test "$with_xattrs" != no; then + AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.]) + fi + ) + fi + fi ])