Submitted By: Mario Fetka (mario dot fetka at gmail dot com) Date: 2011-11-21 Initial Package Version: 1.4.5 Origin: http://privsep.org/patches/2.3.0-dev/xattr-patches/apr-xattr-build.patch Upstream Status: unknown Description: build infrastructure diff -Naur apr-1.4.5.orig/build.conf apr-1.4.5/build.conf --- apr-1.4.5.orig/build.conf 2011-11-21 18:38:28.659217726 +0000 +++ apr-1.4.5/build.conf 2011-11-21 18:39:17.735760998 +0000 @@ -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 diff -Naur apr-1.4.5.orig/configure.in apr-1.4.5/configure.in --- apr-1.4.5.orig/configure.in 2011-11-21 18:38:28.985607639 +0000 +++ apr-1.4.5/configure.in 2011-11-21 18:43:25.981912296 +0000 @@ -197,7 +197,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 @@ -1466,7 +1466,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 which prevents it from # being included by itself. Check for manually, @@ -1518,6 +1520,8 @@ AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) +AC_SUBST(sys_xattrh) +AC_SUBST(sys_extattrh) AC_SUBST(processh) AC_SUBST(pthreadh) AC_SUBST(semaphoreh) @@ -2472,6 +2476,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..." diff -Naur apr-1.4.5.orig/include/apr.h.in apr-1.4.5/include/apr.h.in --- apr-1.4.5.orig/include/apr.h.in 2011-11-21 18:38:28.661532544 +0000 +++ apr-1.4.5/include/apr.h.in 2011-11-21 18:40:23.666523955 +0000 @@ -104,6 +104,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@ @@ -276,6 +278,7 @@ #define APR_HAS_UNICODE_FS @have_unicode_fs@ #define APR_HAS_PROC_INVOKED @have_proc_invoked@ #define APR_HAS_USER @apr_has_user@ +#define APR_HAS_XATTR @xattr@ #define APR_HAS_LARGE_FILES @aprlfs@ #define APR_HAS_XTHREAD_FILES @apr_has_xthread_files@ #define APR_HAS_OS_UUID @osuuid@