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]) 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:'" LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'"
case $target in case $target in
*-*-linux*) *-*-linux*)
ARCH=linux ARCH=linux
LIBBURN_ARCH_LIBS= LIBBURN_ARCH_LIBS=
LIBBURNIA_SUPP_ACL=libacl
LIBBURNIA_SUPP_FATTR=xattr
LIBBURNIA_LDCONFIG_CMD=ldconfig LIBBURNIA_LDCONFIG_CMD=ldconfig
;; ;;
*-*-freebsd*) *-*-freebsd*)
ARCH=freebsd ARCH=freebsd
LIBBURN_ARCH_LIBS=-lcam LIBBURN_ARCH_LIBS=-lcam
LIBBURNIA_SUPP_ACL=libacl
LIBBURNIA_SUPP_FATTR=extattr
# This may later be overridden by configure --enable-libdir-pkgconfig # This may later be overridden by configure --enable-libdir-pkgconfig
LIBBURNIA_PKGCONFDIR=$(echo "$libdir" | sed 's/\/lib$/\/libdata/')/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 it seems not be right.
dnl So for now it seems to be best to do the same configuration for libisoburn dnl So for now it seems to be best to do the same configuration for libisoburn
dnl and xorriso as for libisofs. dnl and xorriso as for libisofs.
AC_ARG_ENABLE(libacl, AC_ARG_ENABLE(libacl,
[ --enable-libacl Enable use of libacl by libisofs, default=yes], [ --enable-libacl Enable use of libacl by libisofs, default=yes],
, enable_libacl=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 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 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 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 else
LIBACL_DEF= echo "disabled local processing of ACL"
fi fi
AC_SUBST(LIBACL_DEF) AC_SUBST(LIBACL_DEF)
AC_ARG_ENABLE(xattr, 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) , enable_xattr=yes)
if test x$enable_xattr = xyes; then XATTR_DEF=
dnl Check whether there is the header for Linux xattr. 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 dnl If not, erase this macro which would enable use of listxattr and others
XATTR_DEF="-DLibisofs_with_aaip_xattR" 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 else
XATTR_DEF= echo "disabled local processing of extended file attributes"
fi fi
AC_SUBST(XATTR_DEF) AC_SUBST(XATTR_DEF)

View File

@ -214,55 +214,78 @@ then
AC_DEFINE([Xorriso_with_editlinE], []) AC_DEFINE([Xorriso_with_editlinE], [])
fi fi
AH_TEMPLATE([Libisofs_with_aaip_acL], [Define to use ACL capabilities]) AH_TEMPLATE([Libisofs_with_aaip_acL], [Define to use ACL capabilities])
AC_ARG_ENABLE(libacl, AC_ARG_ENABLE(libacl,
[ --enable-libacl Enable use of ACL functions by libisofs, default=yes], [ --enable-libacl Enable use of ACL functions by libisofs, default=yes],
, enable_libacl=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 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 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 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= )
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
if test "$has_acl_h_but_no_libacl" = 1 then
then AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= )
AC_CHECK_LIB(c, acl_to_text, X= , LIBACL_DEF= ) fi
fi fi
else
LIBACL_DEF=
fi fi
if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL if test x$LIBACL_DEF = x-DLibisofs_with_aaip_acL
then then
AC_DEFINE([Libisofs_with_aaip_acL], []) AC_DEFINE([Libisofs_with_aaip_acL], [])
fi if test x$has_acl_h_but_no_libacl = x1
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
then then
XATTR_DEF="-DLibisofs_with_freebsd_extattR" echo "enabled local processing of ACL"
AC_CHECK_HEADER(sys/extattr.h, AC_CHECK_LIB(c, extattr_list_file, X=, XATTR_DEF= ), XATTR_DEF= ) else
echo "enabled libacl, local processing of ACL"
fi fi
else else
XATTR_DEF= echo "disabled local processing of ACL"
fi 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 if test x$XATTR_DEF = x-DLibisofs_with_aaip_xattR
then then
AC_DEFINE([Libisofs_with_aaip_xattR], []) AC_DEFINE([Libisofs_with_aaip_xattR], [])
fi echo "enabled xattr, local processing of extended file attributes Linux style"
if test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR elif test x$XATTR_DEF = x-DLibisofs_with_freebsd_extattR
then then
AC_DEFINE([Libisofs_with_freebsd_extattR], []) 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 fi