From f4428d3184a1f16a4dc4499646ba28b4a87543d3 Mon Sep 17 00:00:00 2001 From: Marco van Wieringen Date: Thu, 16 Sep 2010 22:07:42 +0200 Subject: [PATCH] Rewrote ACL configure logic to be somewhat better readable in the same style as the new xattr configure logic. --- bacula/autoconf/configure.in | 119 ++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 45 deletions(-) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 834d1a090d..c68ecad6ad 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -2522,57 +2522,86 @@ have_acl=no have_extended_acl=no if test x$support_acl = xyes -o x$support_acl = xauto; then AC_CHECK_HEADER(sys/acl.h, [ AC_DEFINE(HAVE_SYS_ACL_H,1,[Defines if your system have the sys/acl.h header file])] , ) + + dnl + dnl First check for acl_get_file in libc + dnl AC_CHECK_FUNC(acl_get_file, [ have_acl=yes - ], [ - AC_CHECK_LIB(acl, acl_get_file, - [ - have_acl=yes; - if test $have_afs = yes; then - dnl - dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!! - dnl - if test -d /usr/lib64/; then - FDLIBS="-L/usr/lib64 -lacl $FDLIBS" - else - FDLIBS="-L/usr/lib -lacl $FDLIBS" - fi - else - FDLIBS="-lacl $FDLIBS" - fi - ], [ - AC_CHECK_LIB(pacl, acl_get_file, - [ - have_acl=yes; - FDLIBS="-lpacl $FDLIBS" - ], [ - AC_CHECK_LIB(sec, acltotext, - [ - have_acl=yes; - FDLIBS="-lsec $FDLIBS" - - AC_CHECK_LIB(sec, acl_totext, - [ - have_extended_acl=yes - ] - ) - ], [ - dnl check for AIX - AC_CHECK_FUNC(acl_get, - [ - have_acl=yes - ] - ) - ] - ) - ] - ) - ] - ) ] ) + dnl + dnl Check for acl_get_file in libacl (Linux) + dnl + if test $have_acl = no; then + AC_CHECK_LIB(acl, acl_get_file, + [ + have_acl=yes + if test $have_afs = yes; then + dnl + dnl Because of possible naming conflict with AFS libacl make sure we use the one in /usr/lib64 or /usr/lib !!! + dnl + if test -d /usr/lib64/; then + FDLIBS="-L/usr/lib64 -lacl $FDLIBS" + else + FDLIBS="-L/usr/lib -lacl $FDLIBS" + fi + else + FDLIBS="-lacl $FDLIBS" + fi + ] + ) + fi + + dnl + dnl Check for acl_get_file in libpacl (OSF1) + dnl + if test $have_acl = no; then + AC_CHECK_LIB(pacl, acl_get_file, + [ + have_acl=yes + FDLIBS="-lpacl $FDLIBS" + ] + ) + fi + + dnl + dnl Check for acltotext and acl_totext (Solaris) + dnl + if test $have_acl = no; then + AC_CHECK_LIB(sec, acltotext, + [ + have_acl=yes + FDLIBS="-lsec $FDLIBS" + + AC_CHECK_LIB(sec, acl_totext, + [ + have_extended_acl=yes + ] + ) + ] + ) + fi + + dnl + dnl Check for acl_get and aclx_get (AIX) + dnl + if test $have_acl = no; then + AC_CHECK_FUNC(acl_get, + [ + have_acl=yes + + AC_CHECK_FUNC(aclx_get, + [ + have_extended_acl=yes + ] + ) + ] + ) + fi + if test x$support_acl = xyes -a $have_acl != yes; then AC_MSG_ERROR([acl support explicitly enabled but no supported acl implementation found, please either load the acl libraries or rerun configure without --enable-acl]) -- 2.39.5