Improve ACL detection for CMake build

Fix hidden visibility in posixacladdons

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 6ebff39751)
v3.5.13-sru
Slávek Banko 10 years ago
parent fb74d787f1
commit a1d982adfc

@ -230,11 +230,23 @@ if( HAVE_SYS_TIME_H AND HAVE_TIME_H )
endif( HAVE_SYS_TIME_H AND HAVE_TIME_H ) endif( HAVE_SYS_TIME_H AND HAVE_TIME_H )
if( HAVE_SYS_ACL_H ) if( HAVE_SYS_ACL_H )
set( USE_POSIX_ACL 1 ) check_include_file( "acl/libacl.h" HAVE_ACL_LIBACL_H )
if( HAVE_ACL_LIBACL_H )
check_library_exists( acl acl_init "" HAVE_ACL_INIT )
if( HAVE_ACL_INIT AND HAVE_SYS_XATTR_H )
set( USE_POSIX_ACL 1 )
set( HAVE_NON_POSIX_ACL_EXTENSIONS 1 )
set( ACL_LIBRARIES acl attr )
endif( HAVE_ACL_INIT AND HAVE_SYS_XATTR_H )
else( HAVE_ACL_LIBACL_H )
check_library_exists( c acl_init "" HAVE_ACL_INIT )
if( HAVE_ACL_INIT )
set( USE_POSIX_ACL 1 )
set( ACL_LIBRARIES c )
endif( HAVE_ACL_INIT )
endif( HAVE_ACL_LIBACL_H )
endif( HAVE_SYS_ACL_H ) endif( HAVE_SYS_ACL_H )
check_include_file( "acl/libacl.h" HAVE_NON_POSIX_ACL_EXTENSIONS )
check_include_file( "valgrind/memcheck.h" HAVE_VALGRIND_MEMCHECK_H ) check_include_file( "valgrind/memcheck.h" HAVE_VALGRIND_MEMCHECK_H )
check_include_file( "values.h" HAVE_VALUES_H ) check_include_file( "values.h" HAVE_VALUES_H )
check_include_file( "X11/extensions/shape.h" HAVE_X11_EXTENSIONS_SHAPE_H ) check_include_file( "X11/extensions/shape.h" HAVE_X11_EXTENSIONS_SHAPE_H )

@ -49,10 +49,6 @@ install( FILES renamedlgplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} )
install( FILES kpasswdserver.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded ) install( FILES kpasswdserver.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded )
install( FILES data.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) install( FILES data.protocol DESTINATION ${SERVICES_INSTALL_DIR} )
if( HAVE_NON_POSIX_ACL_EXTENSIONS )
set( ACL_LIBRARIES acl )
endif( HAVE_NON_POSIX_ACL_EXTENSIONS )
##### libkio #################################### ##### libkio ####################################

@ -48,10 +48,9 @@ install( FILES
kremoteencoding.h kmimetypechooser.h kremoteencoding.h kmimetypechooser.h
DESTINATION ${INCLUDE_INSTALL_DIR} ) DESTINATION ${INCLUDE_INSTALL_DIR} )
# FIXME seems that ACL is no longer optional if( USE_POSIX_ACL )
#if( USE_POSIX_ACL )
install( FILES kacl.h DESTINATION ${INCLUDE_INSTALL_DIR} ) install( FILES kacl.h DESTINATION ${INCLUDE_INSTALL_DIR} )
#endif( USE_POSIX_ACL ) endif( USE_POSIX_ACL )
install( FILES install( FILES
connection.h slaveinterface.h slave.h slaveconfig.h connection.h slaveinterface.h slave.h slaveconfig.h
@ -110,10 +109,9 @@ set( ${target}_SRCS
dataprotocol.cpp dataprotocol.cpp
) )
# FIXME seems that ACL is no longer optional if( USE_POSIX_ACL )
#if( USE_POSIX_ACL )
set( ${target}_SRCS ${${target}_SRCS} kacl.cpp posixacladdons.cpp ) set( ${target}_SRCS ${${target}_SRCS} kacl.cpp posixacladdons.cpp )
#endif( USE_POSIX_ACL ) endif( USE_POSIX_ACL )
tde_add_library( ${target} STATIC_PIC AUTOMOC tde_add_library( ${target} STATIC_PIC AUTOMOC
SOURCES ${${target}_SRCS} SOURCES ${${target}_SRCS}

@ -21,6 +21,8 @@
#if defined(USE_POSIX_ACL) && !defined(HAVE_NON_POSIX_ACL_EXTENSIONS) #if defined(USE_POSIX_ACL) && !defined(HAVE_NON_POSIX_ACL_EXTENSIONS)
#include <kdemacros.h>
#include <errno.h> #include <errno.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -61,7 +63,7 @@ protected:
} }
}; };
int acl_cmp(acl_t acl1, acl_t acl2) KDE_EXPORT int acl_cmp(acl_t acl1, acl_t acl2)
{ {
if ( !acl1 || !acl2 ) if ( !acl1 || !acl2 )
return -1; return -1;
@ -127,7 +129,7 @@ int acl_cmp(acl_t acl1, acl_t acl2)
return 0; return 0;
} }
acl_t acl_from_mode(mode_t mode) KDE_EXPORT acl_t acl_from_mode(mode_t mode)
{ {
acl_t newACL = acl_init( 3 ); acl_t newACL = acl_init( 3 );
acl_entry_t entry; acl_entry_t entry;
@ -178,7 +180,7 @@ acl_t acl_from_mode(mode_t mode)
return newACL; return newACL;
} }
int acl_equiv_mode(acl_t acl, mode_t *mode_p) KDE_EXPORT int acl_equiv_mode(acl_t acl, mode_t *mode_p)
{ {
acl_entry_t entry; acl_entry_t entry;
acl_tag_t tag; acl_tag_t tag;

Loading…
Cancel
Save