linamh/dev-libs/apr/files/apr-xattr-build.patch
2013-10-31 09:47:02 +01:00

156 lines
5.4 KiB
Diff

Index: include/apr.h.in
===================================================================
--- include/apr.h.in (revision 606453)
+++ include/apr.h.in (working copy)
@@ -103,6 +103,8 @@
#define APR_HAVE_SYS_UIO_H @sys_uioh@
#define APR_HAVE_SYS_UN_H @sys_unh@
#define APR_HAVE_SYS_WAIT_H @sys_waith@
+#define APR_HAVE_SYS_XATTR_H @sys_xattrh@
+#define APR_HAVE_SYS_EXTATTR_H @sys_extattrh@
#define APR_HAVE_TIME_H @timeh@
#define APR_HAVE_UNISTD_H @unistdh@
#define APR_HAVE_WINDOWS_H @windowsh@
@@ -238,6 +240,7 @@
#define APR_HAS_UNICODE_FS @have_unicode_fs@
#define APR_HAS_PROC_INVOKED @have_proc_invoked@
#define APR_HAS_USER 1
+#define APR_HAS_XATTR @xattr@
#define APR_HAS_LARGE_FILES @aprlfs@
#define APR_HAS_XTHREAD_FILES 0
#define APR_HAS_OS_UUID @osuuid@
Index: configure.in
===================================================================
--- configure.in (revision 606453)
+++ configure.in (working copy)
@@ -124,7 +124,7 @@
DEFAULT_OSDIR="unix"
echo "(Default will be ${DEFAULT_OSDIR})"
-apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support random"
+apr_modules="file_io network_io threadproc misc locks time mmap shmem user memory atomic poll support random xattr"
dnl Checks for programs.
AC_PROG_MAKE_SET
@@ -1135,7 +1135,9 @@
sys/types.h \
sys/uio.h \
sys/un.h \
- sys/wait.h)
+ sys/wait.h \
+ sys/xattr.h \
+ sys/extattr.h)
# IRIX 6.5 has a problem in <netinet/tcp.h> which prevents it from
# being included by itself. Check for <netinet/tcp.h> manually,
@@ -1187,6 +1189,8 @@
AC_SUBST(unistdh)
AC_SUBST(signalh)
AC_SUBST(sys_waith)
+AC_SUBST(sys_xattrh)
+AC_SUBST(sys_extattrh)
AC_SUBST(pthreadh)
AC_SUBST(semaphoreh)
AC_SUBST(windowsh)
@@ -2030,6 +2034,87 @@
APR_CHECK_DIRENT_INODE
APR_CHECK_DIRENT_TYPE
+dnl ----------------------------- Checking for Extended Attributes Support
+echo "${nl}Checking for Extended Attributes Support..."
+
+# Check whether Extended Attributes have explicitly been disabled
+AC_ARG_ENABLE(xattr,
+ [ --disable-xattr Disable Extended Attributes support in APR.],
+ [ if test "$enableval" = "no"; then
+ user_disabled_xattr=1
+ fi ],
+ [ user_disabled_xattr=0 ] )
+
+xattrdarwin="0"
+xattrlinux="0"
+xattrfreebsd="0"
+xattrsolaris="0"
+if test "$user_disabled_xattr" = 1; then
+ echo "no -- disabled by user"
+else
+ AC_CHECK_FUNCS([fgetxattr fsetxattr flistxattr fremovexattr lgetxattr \
+ extattr_get_fd extattr_set_fd extattr_list_fd \
+ extattr_delete_fd openat unlinkat])
+ APR_CHECK_DEFINE(O_XATTR, sys/fcntl.h)
+ APR_CHECK_DEFINE(XATTR_NOFOLLOW, sys/xattr.h)
+ APR_CHECK_DEFINE(XATTR_CREATE, sys/xattr.h)
+ APR_CHECK_DEFINE(XATTR_REPLACE, sys/xattr.h)
+ APR_CHECK_DEFINE(XATTR_NAME_MAX, linux/limits.h)
+ APR_CHECK_DEFINE(XATTR_SIZE_MAX, linux/limits.h)
+ APR_CHECK_DEFINE(XATTR_LIST_MAX, linux/limits.h)
+ APR_CHECK_DEFINE(XATTR_MAXNAMELEN, sys/xattr.h)
+ APR_CHECK_DEFINE(EXTATTR_NAMESPACE_USER, sys/extattr.h)
+ APR_CHECK_DEFINE(EXTATTR_NAMESPACE_SYSTEM, sys/extattr.h)
+ APR_CHECK_DEFINE(EXTATTR_MAXNAMELEN, sys/extattr.h)
+
+ APR_BEGIN_DECISION([xattr attribute system interface])
+ APR_IFALLYES(header:sys/xattr.h dnl
+ define:XATTR_NOFOLLOW dnl
+ func:fgetxattr dnl
+ func:fsetxattr dnl
+ func:flistxattr dnl
+ func:fremovexattr,
+ [xattrdarwin="1"
+ APR_DECIDE(USE_XATTR_DARWIN, [xattr (Darwin)])])
+
+ APR_IFALLYES(header:sys/xattr.h dnl
+ func:lgetxattr dnl
+ func:fgetxattr dnl
+ func:fsetxattr dnl
+ func:flistxattr dnl
+ func:fremovexattr,
+ [xattrlinux="1"
+ APR_DECIDE(USE_XATTR_LINUX, [xattr (Linux)])])
+
+ APR_IFALLYES(header:sys/extattr.h dnl
+ func:extattr_set_fd dnl
+ func:func:extattr_get_fd dnl
+ func:extattr_list_fd dnl
+ func:func:extattr_delete_fd,
+ [xattrfreebsd="1"
+ APR_DECIDE(USE_XATTR_FREEBSD, [extattr (FreeBSD)])])
+
+ APR_IFALLYES(define:O_XATTR dnl
+ func:openat dnl
+ func:unlinkat,
+ [xattrsolaris="1"
+ APR_DECIDE(USE_XATTR_SOLARIS, [attropen (Solaris)])])
+
+ if test "x$ac_decision" = "x"; then
+ ac_decision="USE_XATTR_NONE"
+ ac_decision_msg="no xattr interface available"
+ fi
+ APR_END_DECISION
+ AC_DEFINE_UNQUOTED($ac_decision)
+fi
+
+if test "$xattrdarwin$xattrlinux$xattrfreebsd$xattrsolaris" = "0000"; then
+ xattr="0"
+else
+ xattr="1"
+fi
+AC_SUBST(xattr)
+
dnl ----------------------------- Checking for UUID Support
echo "${nl}Checking for OS UUID Support..."
Index: build.conf
===================================================================
--- build.conf (revision 606453)
+++ build.conf (working copy)
@@ -13,7 +13,7 @@
# directories that have platform-specific code in them. the resulting
# pattern will be: SUBDIR/PLATFORM/*.c
platform_dirs =
- dso file_io locks memory misc mmap network_io poll random
+ dso file_io locks memory misc mmap network_io poll random xattr
shmem support threadproc time user atomic
# all the public headers