Following build system changes in libisofs about ACL and xattr

This commit is contained in:
Thomas Schmitt 2015-12-15 10:10:55 +00:00
parent 9723c6445c
commit 94bae39491
3 changed files with 105 additions and 40 deletions

View File

@ -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

View File

@ -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)
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"
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
LIBACL_DEF=
echo "enabled libacl, local processing of ACL"
fi
else
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 Enable use of extended file attributes by libisofs, default=yes],
, enable_xattr=yes)
if test x$enable_xattr = xyes; then
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= )
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)

View File

@ -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)
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"
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= )
fi
else
LIBACL_DEF=
fi
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