From 0882f0c9d671cd466668f65433ee33a71f127a95 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 11 Oct 2006 10:57:33 +0000 Subject: [PATCH] r19239: make the acl configure check more readable... metze --- source/configure.in | 106 ++++++++++++++++++++++++++++---------------- 1 file changed, 68 insertions(+), 38 deletions(-) diff --git a/source/configure.in b/source/configure.in index d7c7ba7beda..86228a3e6c1 100644 --- a/source/configure.in +++ b/source/configure.in @@ -4976,54 +4976,84 @@ AC_ARG_WITH(acl-support, AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"]) AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"]) AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[ - acl_LIBS=$LIBS - LIBS="$LIBS -lacl" - AC_TRY_LINK([#include -#include ], -[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);], -samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no) - LIBS=$acl_LIBS]) - if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then - AC_MSG_RESULT(Using posix ACLs) - AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available]) - AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[ + acl_LIBS=$LIBS + LIBS="$LIBS -lacl" + AC_TRY_LINK([ + #include + #include + ],[ + acl_t acl; + int entry_id; + acl_entry_t *entry_p; + return acl_get_entry(acl, entry_id, entry_p); + ], + [samba_cv_HAVE_POSIX_ACLS=yes], + [samba_cv_HAVE_POSIX_ACLS=no]) + LIBS=$acl_LIBS + ]) + if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then + AC_MSG_RESULT(Using posix ACLs) + AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available]) + AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[ acl_LIBS=$LIBS LIBS="$LIBS -lacl" - AC_TRY_LINK([#include -#include ], -[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);], -samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no) - LIBS=$acl_LIBS]) - if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then - AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) - fi + AC_TRY_LINK([ + #include + #include + ],[ + acl_permset_t permset_d; + acl_perm_t perm; + return acl_get_perm_np(permset_d, perm); + ], + [samba_cv_HAVE_ACL_GET_PERM_NP=yes], + [samba_cv_HAVE_ACL_GET_PERM_NP=no]) + LIBS=$acl_LIBS + ]) + if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then + AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) fi + fi ;; *) AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"]) AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[ - acl_LIBS=$LIBS - LIBS="$LIBS -lacl" - AC_TRY_LINK([#include -#include ], -[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);], -samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no) - LIBS=$acl_LIBS]) - if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then - AC_MSG_RESULT(Using posix ACLs) - AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available]) - AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[ + acl_LIBS=$LIBS + LIBS="$LIBS -lacl" + AC_TRY_LINK([ + #include + #include + ],[ + acl_t acl; + int entry_id; + acl_entry_t *entry_p; + return acl_get_entry( acl, entry_id, entry_p); + ], + [samba_cv_HAVE_POSIX_ACLS=yes], + [samba_cv_HAVE_POSIX_ACLS=no]) + LIBS=$acl_LIBS + ]) + if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then + AC_MSG_RESULT(Using posix ACLs) + AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available]) + AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[ acl_LIBS=$LIBS LIBS="$LIBS -lacl" - AC_TRY_LINK([#include -#include ], -[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);], -samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no) - LIBS=$acl_LIBS]) - if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then - AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) - fi + AC_TRY_LINK([ + #include + #include + ],[ + acl_permset_t permset_d; + acl_perm_t perm; + return acl_get_perm_np( permset_d, perm); + ], + [samba_cv_HAVE_ACL_GET_PERM_NP=yes], + [samba_cv_HAVE_ACL_GET_PERM_NP=no]) + LIBS=$acl_LIBS + ]) + if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then + AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available]) fi + fi ;; esac ;;