From e0aebef54f0ad717c557af45290139ab49e907d7 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 15 Dec 2015 10:10:55 +0000 Subject: [PATCH] Following build system changes in libisofs about ACL and xattr --- acinclude.m4 | 6 +++ configure.ac | 60 ++++++++++++++++++++++++------ xorriso/configure_ac.txt | 79 ++++++++++++++++++++++++++-------------- 3 files changed, 105 insertions(+), 40 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index e55c36d5..8e7f6568 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -22,16 +22,22 @@ AC_DEFUN([TARGET_SHIZZLE], AC_MSG_CHECKING([target operating system]) + LIBBURNIA_SUPP_ACL=none + LIBBURNIA_SUPP_FATTR=none LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'" case $target in *-*-linux*) ARCH=linux LIBBURN_ARCH_LIBS= + LIBBURNIA_SUPP_ACL=libacl + LIBBURNIA_SUPP_FATTR=xattr LIBBURNIA_LDCONFIG_CMD=ldconfig ;; *-*-freebsd*) ARCH=freebsd LIBBURN_ARCH_LIBS=-lcam + LIBBURNIA_SUPP_ACL=libacl + LIBBURNIA_SUPP_FATTR=extattr # This may later be overridden by configure --enable-libdir-pkgconfig LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/pkgconfig diff --git a/configure.ac b/configure.ac index 39563bce..9ca44f70 100644 --- a/configure.ac +++ b/configure.ac @@ -187,32 +187,68 @@ dnl On my Linux this does work with an ACL enabled libisofs but in general dnl it seems not be right. dnl So for now it seems to be best to do the same configuration for libisoburn dnl and xorriso as for libisofs. - AC_ARG_ENABLE(libacl, [ --enable-libacl Enable use of libacl by libisofs, default=yes], , enable_libacl=yes) -if test x$enable_libacl = xyes; then +LIBACL_DEF= +if test x$LIBBURNIA_SUPP_ACL = xlibacl +then + if test x$enable_libacl = xyes; then dnl Check whether there is libacl-devel and libacl-runtime. dnl If not, erase this macro which would enable use of acl_to_text and others - LIBACL_DEF="-DLibisofs_with_aaip_acL" + LIBACL_DEF="-DLibisofs_with_aaip_acL" dnl The empty yes case obviously causes -lacl to be linked - AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , LIBACL_DEF= ), LIBACL_DEF= ) + has_acl_h_but_no_func=0 + AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= ) + if test "$has_acl_h_but_no_libacl" = 1 + then + AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= ) + fi + fi +fi +if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL +then + if test x$has_acl_h_but_no_libacl = x1 + then + echo "enabled local processing of ACL" + else + echo "enabled libacl, local processing of ACL" + fi else - LIBACL_DEF= + echo "disabled local processing of ACL" fi AC_SUBST(LIBACL_DEF) AC_ARG_ENABLE(xattr, -[ --enable-xattr Enable use of xattr by libisofs, default=yes], - , enable_xattr=yes) -if test x$enable_xattr = xyes; then -dnl Check whether there is the header for Linux xattr. + [ --enable-xattr Enable use of extended file attributes by libisofs, default=yes], + , enable_xattr=yes) +XATTR_DEF= +if test x"$LIBBURNIA_SUPP_FATTR" = xxattr +then + if test "x$enable_xattr" = xyes; then +dnl Check whether there is the header for Linux xattr. dnl If not, erase this macro which would enable use of listxattr and others - XATTR_DEF="-DLibisofs_with_aaip_xattR" - AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= , XATTR_DEF= ), XATTR_DEF= ) + XATTR_DEF="-DLibisofs_with_aaip_xattR" + AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= , + XATTR_DEF= ), XATTR_DEF= ) + fi +elif test x"$LIBBURNIA_SUPP_FATTR" = xextattr +then + if test "x$enable_xattr" = xyes; then + XATTR_DEF="-DLibisofs_with_freebsd_extattR" + AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=, + XATTR_DEF= ), XATTR_DEF= ) + fi +fi +if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR +then + echo "enabled xattr, local processing of extended file attributes Linux style" +elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR +then + echo "enabled extattr, local processing of extended file attributes FreeBSD style" else - XATTR_DEF= + echo "disabled local processing of extended file attributes" fi AC_SUBST(XATTR_DEF) diff --git a/xorriso/configure_ac.txt b/xorriso/configure_ac.txt index edf239c2..1e24a1e5 100644 --- a/xorriso/configure_ac.txt +++ b/xorriso/configure_ac.txt @@ -214,55 +214,78 @@ then AC_DEFINE([Xorriso_with_editlinE], []) fi + AH_TEMPLATE([Libisofs_with_aaip_acL], [Define to use ACL capabilities]) AC_ARG_ENABLE(libacl, [ --enable-libacl Enable use of ACL functions by libisofs, default=yes], , enable_libacl=yes) -if test x$enable_libacl = xyes; then +LIBACL_DEF= +has_acl_h_but_no_func=0 +if test x$LIBBURNIA_SUPP_ACL = xlibacl +then + if test x$enable_libacl = xyes; then dnl Check whether there is libacl-devel and libacl-runtime. dnl If not, erase this macro which would enable use of acl_to_text and others - LIBACL_DEF="-DLibisofs_with_aaip_acL" + LIBACL_DEF="-DLibisofs_with_aaip_acL" dnl The empty yes case obviously causes -lacl to be linked - has_acl_h_but_no_func=0 - AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= ) - if test "$has_acl_h_but_no_libacl" = 1 - then - AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= ) + AC_CHECK_HEADER(sys/acl.h, AC_CHECK_LIB(acl, acl_to_text, , has_acl_h_but_no_libacl=1 ), LIBACL_DEF= ) + if test "$has_acl_h_but_no_libacl" = 1 + then + AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= ) + fi fi -else - LIBACL_DEF= fi if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL then AC_DEFINE([Libisofs_with_aaip_acL], []) -fi - - -AH_TEMPLATE([Libisofs_with_aaip_xattR], [Define to use xattr capabilities]) -AH_TEMPLATE([Libisofs_with_freebsd_extattR], [Define to use extattr capabilities]) -AC_ARG_ENABLE(xattr, -[ --enable-xattr Enable use of xattr by libisofs, default=yes], - , enable_xattr=yes) -if test x$enable_xattr = xyes; then -dnl Check whether there is the header for GNU/Linux xattr. -dnl If not, erase this macro which would enable use of listxattr and others - XATTR_DEF="-DLibisofs_with_aaip_xattR" - AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= , XATTR_DEF= ), XATTR_DEF= ) - if test "x$XATTR_DEF" = x + if test x$has_acl_h_but_no_libacl = x1 then - XATTR_DEF="-DLibisofs_with_freebsd_extattR" - AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=, XATTR_DEF= ), XATTR_DEF= ) + echo "enabled local processing of ACL" + else + echo "enabled libacl, local processing of ACL" fi else - XATTR_DEF= + echo "disabled local processing of ACL" fi + + +AH_TEMPLATE([Libisofs_with_aaip_xattR], + [Define to use Linux xattr capabilities]) +AH_TEMPLATE([Libisofs_with_freebsd_extattR], + [Define to use FreeBSD extattr capabilities]) +AC_ARG_ENABLE(xattr, + [ --enable-xattr Enable use of extended file attributes by libisofs, default=yes], + , enable_xattr=yes) + +XATTR_DEF= +if test x"$LIBBURNIA_SUPP_FATTR" = xxattr +then + if test "x$enable_xattr" = xyes; then +dnl Check whether there is the header for Linux xattr. +dnl If not, erase this macro which would enable use of listxattr and others + XATTR_DEF="-DLibisofs_with_aaip_xattR" + AC_CHECK_HEADER(attr/xattr.h, AC_CHECK_LIB(c, listxattr, X= , + XATTR_DEF= ), XATTR_DEF= ) + fi +elif test x"$LIBBURNIA_SUPP_FATTR" = xextattr +then + if test "x$enable_xattr" = xyes; then + XATTR_DEF="-DLibisofs_with_freebsd_extattR" + AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=, + XATTR_DEF= ), XATTR_DEF= ) + fi +fi + if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR then AC_DEFINE([Libisofs_with_aaip_xattR], []) -fi -if test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR + echo "enabled xattr, local processing of extended file attributes Linux style" +elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR then AC_DEFINE([Libisofs_with_freebsd_extattR], []) + echo "enabled extattr, local processing of extended file attributes FreeBSD style" +else + echo "disabled local processing of extended file attributes" fi