summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2026-02-17 01:49:01 +0100
committerSlávek Banko <slavek.banko@axis.cz>2026-02-17 01:49:01 +0100
commit0e5f0efdc9b42c1ab81b889d268a06c0baa2a326 (patch)
treeb9fe8a0187768664814ad9b05d741d00481cc751
parentb2b0613a11449e643cc3bc7527a71d92e10a7628 (diff)
downloadtdeadmin-master.tar.gz
tdeadmin-master.zip
KUser: Add check if crypt function is found.HEADmaster
All header and function checks are only meaningful if KUser is built. No other application uses the results of these tests. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--ConfigureChecks.cmake101
1 files changed, 55 insertions, 46 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index fafad25..24dbb17 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -26,57 +26,66 @@ if( WITH_GCC_VISIBILITY )
endif( )
-#### check for headers
-
-check_include_file( "unistd.h" HAVE_UNISTD_H )
-check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
-check_include_file( "crypt.h" HAVE_CRYPT_H )
-check_include_file( "paths.h" HAVE_PATHS_H )
-
-
-#### check for functions
-
-check_function_exists( crypt HAVE_CRYPT )
-if( NOT HAVE_CRYPT )
- check_library_exists( crypt crypt "" HAVE_CRYPT_LIB )
- if( HAVE_CRYPT_LIB )
- set( HAVE_CRYPT 1 )
- set( CRYPT_LIBRARIES crypt )
- endif( HAVE_CRYPT_LIB )
-endif( NOT HAVE_CRYPT )
-if( NOT HAVE_CRYPT )
- check_library_exists( c crypt "" HAVE_CRYPT_LIBC )
- if( HAVE_CRYPT_LIBC )
- set( HAVE_CRYPT 1 )
- set( CRYPT_LIBRARIES c )
- endif( HAVE_CRYPT_LIBC )
-endif( NOT HAVE_CRYPT )
-
-check_function_exists( getspent HAVE_GETSPENT )
-if( HAVE_GETSPENT )
- set( HAVE_SHADOW 1 )
-else( )
- check_library_exists( shadow getspent "" LIBSHADOW )
- if( LIBSHADOW )
+##### check headers and functions for kuser
+
+if( BUILD_KUSER )
+
+ #### check for headers
+
+ check_include_file( "unistd.h" HAVE_UNISTD_H )
+ check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
+ check_include_file( "crypt.h" HAVE_CRYPT_H )
+ check_include_file( "paths.h" HAVE_PATHS_H )
+
+
+ #### check for functions
+
+ check_function_exists( crypt HAVE_CRYPT )
+ if( NOT HAVE_CRYPT )
+ check_library_exists( crypt crypt "" HAVE_CRYPT_LIB )
+ if( HAVE_CRYPT_LIB )
+ set( HAVE_CRYPT 1 )
+ set( CRYPT_LIBRARIES crypt )
+ endif( HAVE_CRYPT_LIB )
+ endif( NOT HAVE_CRYPT )
+ if( NOT HAVE_CRYPT )
+ check_library_exists( c crypt "" HAVE_CRYPT_LIBC )
+ if( HAVE_CRYPT_LIBC )
+ set( HAVE_CRYPT 1 )
+ set( CRYPT_LIBRARIES c )
+ endif( HAVE_CRYPT_LIBC )
+ endif( NOT HAVE_CRYPT )
+ if( NOT HAVE_CRYPT )
+ tde_message_fatal( "KUser build is requested, but the crypt function was not found." )
+ endif()
+
+ check_function_exists( getspent HAVE_GETSPENT )
+ if( HAVE_GETSPENT )
set( HAVE_SHADOW 1 )
- set( SHADOW_LIBRARIES shadow )
else( )
- check_library_exists( gen getspent "" LIBGEN )
- if( LIBGEN )
+ check_library_exists( shadow getspent "" LIBSHADOW )
+ if( LIBSHADOW )
set( HAVE_SHADOW 1 )
- set( SHADOW_LIBRARIES gen )
+ set( SHADOW_LIBRARIES shadow )
+ else( )
+ check_library_exists( gen getspent "" LIBGEN )
+ if( LIBGEN )
+ set( HAVE_SHADOW 1 )
+ set( SHADOW_LIBRARIES gen )
+ endif( )
endif( )
endif( )
-endif( )
-tde_save_and_set( CMAKE_REQUIRED_INCLUDES "pwd.h" )
-check_function_exists( fgetpwent HAVE_FGETPWENT )
-tde_restore( CMAKE_REQUIRED_INCLUDES )
+ tde_save_and_set( CMAKE_REQUIRED_INCLUDES "pwd.h" )
+ check_function_exists( fgetpwent HAVE_FGETPWENT )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
+
+ tde_save_and_set( CMAKE_REQUIRED_INCLUDES "grp.h" )
+ check_function_exists( fgetgrent HAVE_FGETGRENT )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
-tde_save_and_set( CMAKE_REQUIRED_INCLUDES "grp.h" )
-check_function_exists( fgetgrent HAVE_FGETGRENT )
-tde_restore( CMAKE_REQUIRED_INCLUDES )
+ tde_save_and_set( CMAKE_REQUIRED_INCLUDES "shadow.h" )
+ check_function_exists( fgetspent HAVE_FGETSPENT )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
-tde_save_and_set( CMAKE_REQUIRED_INCLUDES "shadow.h" )
-check_function_exists( fgetspent HAVE_FGETSPENT )
-tde_restore( CMAKE_REQUIRED_INCLUDES )
+endif( BUILD_KUSER)