summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2025-11-16 18:42:46 +0100
committerSlávek Banko <slavek.banko@axis.cz>2025-11-16 18:57:25 +0100
commitcfa12e2abdfc5d447dbf507cd7a6005acf607807 (patch)
treee8e9b9a8a32896b282d3e6305e77dfbb744f42ca
parentb9d01ea849b71deb12a1d27270685da4c1c3d0c0 (diff)
downloadkrusader-master.tar.gz
krusader-master.zip
Allow ACL detection without pkgconfig file.HEADmaster
Allow building with POSIX ACL without a separate ACL library. This solves firstly building on older distributions where there is no pkgconfig file, but there is an acl library supporting extended ACL, and secondly it solves building on systems where POSIX ACLs are part of the standard library and a separate acl library is not present. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--ConfigureChecks.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index d50e00b..de74220 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -51,6 +51,21 @@ endif( )
if( WITH_ACL )
pkg_search_module( ACL libacl )
if( NOT ACL_FOUND )
+ find_file( HAVE_ACL_H "sys/acl.h" )
+ if( HAVE_ACL_H )
+ find_library( HAVE_ACL_LIB NAMES acl )
+ if( HAVE_ACL_LIB )
+ set( ACL_LIBRARIES "${HAVE_ACL_LIB}" CACHE INTERNAL "Extended ACL library" FORCE )
+ endif( )
+ tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "${ACL_LIBRARIES}" )
+ check_symbol_exists( acl_free "${HAVE_ACL_H}" HAVE_ACL )
+ tde_restore( CMAKE_REQUIRED_LIBRARIES )
+ if( HAVE_ACL )
+ set( ACL_FOUND 1 CACHE INTERNAL "Posix ACL found" FORCE )
+ endif()
+ endif()
+ endif( )
+ if( NOT ACL_FOUND )
tde_message_fatal( "ACL support was requested, but not found on your system" )
endif( )
set( HAVE_POSIX_ACL 1 )