summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2018-08-26 03:10:29 +0200
committerSlávek Banko <[email protected]>2018-09-01 18:41:35 +0200
commitedd0a5a30ebd724b660718895fd6e857b805764d (patch)
treeb3562bc964775f4895e2b0f9044b7528042764b1 /ConfigureChecks.cmake
parent00d0589dc5f8d9bd8ad08c0ea284fae685dc5647 (diff)
downloadtdeadmin-edd0a5a30ebd724b660718895fd6e857b805764d.tar.gz
tdeadmin-edd0a5a30ebd724b660718895fd6e857b805764d.zip
cmake: Cleanup unused definitions from config.h
Cleanup unnecessary tests from ConfigureChecks Add missing tests to ConfigureChecks Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake79
1 files changed, 48 insertions, 31 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index c6fcfb3..ca45811 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -29,39 +29,56 @@ endif( WITH_GCC_VISIBILITY )
#### check for headers
+
check_include_file( "unistd.h" HAVE_UNISTD_H )
check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
-check_include_file( "Carbon/Carbon.h" HAVE_CARBON_CARBON_H )
-check_include_file( "crt_externs.h" HAVE_CRT_EXTERNS_H )
check_include_file( "crypt.h" HAVE_CRYPT_H )
-check_include_file( "dirent.h" HAVE_DIRENT_H )
-check_include_file( "dlfcn.h" HAVE_DLFCN_H )
-check_include_file( "fcntl.h" HAVE_FCNTL_H )
-check_include_file( "inttypes.h" HAVE_INTTYPES_H )
-check_include_file( "linux/quota.h" HAVE_LINUX_QUOTA_H )
-check_include_file( "linux/unistd.h" HAVE_LINUX_UNISTD_H )
-check_include_file( "memory.h" HAVE_MEMORY_H )
-check_include_file( "mntent.h" HAVE_MNTENT_H )
-check_include_file( "ndir.h" HAVE_NDIR_H )
check_include_file( "paths.h" HAVE_PATHS_H )
-check_include_file( "signal.h" HAVE_SIGNAL_H )
-check_include_file( "stdint.h" HAVE_STDINT_H )
-check_include_file( "stdlib.h" HAVE_STDLIB_H )
-check_include_file( "strings.h" HAVE_STRINGS_H )
-check_include_file( "string.h" HAVE_STRING_H )
-check_include_file( "stropts.h" HAVE_STROPTS_H )
-check_include_file( "sys/bitypes.h" HAVE_SYS_BITYPES_H )
-check_include_file( "sys/dir.h" HAVE_SYS_DIR_H )
-check_include_file( "sys/fcntl.h" HAVE_SYS_FCNTL_H )
-check_include_file( "sys/fs/ufs_quota.h" HAVE_SYS_FS_UFS_QUOTA_H )
-check_include_file( "sys/mntent.h" HAVE_SYS_MNTENT_H )
-check_include_file( "sys/mnttab.h" HAVE_SYS_MNTTAB_H )
-check_include_file( "sys/mount.h" HAVE_SYS_MOUNT_H )
-check_include_file( "sys/ndir.h" HAVE_SYS_NDIR_H )
-check_include_file( "sys/params.h" HAVE_SYS_PARAMS_H )
-check_include_file( "sys/param.h" HAVE_SYS_PARAM_H )
-check_include_file( "sys/quota.h" HAVE_SYS_QUOTA_H )
-check_include_file( "sys/stropts.h" HAVE_SYS_STROPTS_H )
-check_include_file( "sys/time.h" HAVE_SYS_TIME_H )
-check_include_file( "sys/types.h" HAVE_SYS_TYPES_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 )
+ set( HAVE_SHADOW 1 )
+ set( SHADOW_LIBRARIES shadow )
+ else( )
+ check_library_exists( gen getspent "" LIBGEN )
+ if( LIBGEN )
+ set( HAVE_SHADOW 1 )
+ set( SHADOW_LIBRARIES gen )
+ 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 "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 )