]> Dogcows Code - chaz/tar/blobdiff - acinclude.m4
Prepare for implementing extended attribute support.
[chaz/tar] / acinclude.m4
index 10a27e5b97071cddbb103384675a74db2f785d25..30381d380df8573516bdbd65c73f2aa086c0c48b 100644 (file)
@@ -24,3 +24,29 @@ AC_DEFUN([TAR_COMPR_PROGRAM],[
             [tar_compr_var=m4_if($2,,$1,$2)])
  AC_DEFINE_UNQUOTED(tar_compr_define, "$tar_compr_var",
                     [Define to the program name of ]$1[ compressor program])])
+
+# Provide <attr/xattr.h>, if necessary
+
+AC_DEFUN([TAR_HEADERS_ATTR_XATTR_H],
+[
+  AC_ARG_WITH([xattrs],
+    AS_HELP_STRING([--without-xattrs], [don't use linux extended attributes]),
+    [], [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
+    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 <attr/xattr.h> header])
+        if test "$with_xattrs" != no; then
+          AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.])
+        fi
+    )
+  fi
+])
+                   
\ No newline at end of file
This page took 0.020597 seconds and 4 git commands to generate.