diff options
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 190 |
1 files changed, 147 insertions, 43 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index a637df137..b72d866df 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -23,6 +23,11 @@ tde_setup_largefiles( ) find_package( TQt ) find_package( TDE ) +# strlcat and strlcpy check +check_function_exists( strlcat HAVE_STRLCAT ) +check_symbol_exists( strlcat "string.h" HAVE_STRLCAT_PROTO ) +check_function_exists( strlcpy HAVE_STRLCPY ) +check_symbol_exists( strlcpy "string.h" HAVE_STRLCPY_PROTO ) ##### look for the usb.ids file, Its location can be set EG: -DWITH_USBIDS="/opt/share/misc/usb.ids" @@ -95,7 +100,7 @@ if( BUILD_KSMSERVER OR BUILD_KSPLASHML OR BUILD_TDEIOSLAVES ) endif( ) # libssh (tdeioslave/sftp) -if( BUILD_TDEIOSLAVES ) +if( BUILD_TDEIOSLAVES AND WITH_SFTP ) pkg_search_module( LIBSSH libssh ) if( NOT LIBSSH_FOUND ) tde_message_fatal( "LibSSH is required, but was not found on your system" ) @@ -103,16 +108,22 @@ if( BUILD_TDEIOSLAVES ) endif( ) -# pam -if( WITH_PAM AND (BUILD_KCHECKPASS OR BUILD_TDM) ) - check_library_exists( pam pam_start "" HAVE_PAM ) - if( HAVE_PAM ) - check_include_file( "security/pam_appl.h" SECURITY_PAM_APPL_H ) - endif( ) - if( HAVE_PAM AND SECURITY_PAM_APPL_H ) - set( PAM_LIBRARY pam ${DL_LIBRARIES} ) - else( ) - tde_message_fatal( "pam are requested, but not found on your system" ) +# pam and shadow +if( BUILD_KCHECKPASS OR BUILD_TDM ) + if ( WITH_PAM ) + check_library_exists( pam pam_start "" HAVE_PAM ) + if( HAVE_PAM ) + set( USE_PAM 1 CACHE INTERNAL "" FORCE ) + check_include_file( "security/pam_appl.h" SECURITY_PAM_APPL_H ) + endif( ) + if( HAVE_PAM AND SECURITY_PAM_APPL_H ) + set( PAM_LIBRARY pam ${DL_LIBRARIES} ) + else( ) + tde_message_fatal( "pam are requested, but not found on your system" ) + endif( ) + elseif( WITH_SHADOW ) + set( HAVE_SHADOW 1 CACHE INTERNAL "" FORCE ) + set( USESHADOW 1 CACHE INTERNAL "" FORCE ) endif( ) endif( ) @@ -475,9 +486,9 @@ if( WITH_ELFICON ) if( NOT LIBR_FOUND ) message(FATAL_ERROR "\nelficon support was requested, but libr was not found on your system" ) endif( NOT LIBR_FOUND ) - if( NOT "${LIBR_VERSION}" STREQUAL "0.6.0" ) + if( "${LIBR_VERSION}" VERSION_LESS "0.6" ) message(FATAL_ERROR "\nelficon support was requested, but the libr version on your system may not be compatible with TDE" ) - endif( NOT "${LIBR_VERSION}" STREQUAL "0.6.0" ) + endif( "${LIBR_VERSION}" VERSION_LESS "0.6" ) set( HAVE_ELFICON 1 ) endif( ) @@ -496,30 +507,16 @@ endif( ) if( BUILD_KXKB ) if( NOT X11_XKB_RULES_DIR ) - pkg_search_module( XKB_CONFIG xkeyboard-config ) - if( XKB_CONFIG_FOUND ) - execute_process( - COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=xkb_base xkeyboard-config - OUTPUT_VARIABLE KB_RULES_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if( NOT "${KB_RULES_DIR}" STREQUAL "" ) - string(REGEX REPLACE "/xkb$" "/" X11_XKB_RULES_DIR "${KB_RULES_DIR}" ) - endif( ) + pkg_get_variable( KB_RULES_DIR xkeyboard-config xkb_base ) + if( KB_RULES_DIR ) + string(REGEX REPLACE "/xkb$" "/" X11_XKB_RULES_DIR "${KB_RULES_DIR}" ) endif( ) endif( ) if( NOT X11_XKB_RULES_DIR ) - pkg_search_module( XKBCOMP xkbcomp ) - if( XKBCOMP_FOUND ) - execute_process( - COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=xkbconfigdir xkbcomp - OUTPUT_VARIABLE KB_RULES_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if( NOT "${KB_RULES_DIR}" STREQUAL "" ) - string(REGEX REPLACE "/xkb$" "/" X11_XKB_RULES_DIR "${KB_RULES_DIR}" ) - endif( ) + pkg_get_variable( KB_RULES_DIR xkbcomp xkbconfigdir ) + if( KB_RULES_DIR ) + string(REGEX REPLACE "/xkb$" "/" X11_XKB_RULES_DIR "${KB_RULES_DIR}" ) endif( ) endif( ) @@ -541,16 +538,8 @@ if( BUILD_KXKB ) endif( ) if( NOT X11_XKB_RULES_DIR ) - execute_process( - COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=libdir xkbfile - OUTPUT_VARIABLE KB_RULES_LIBDIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - execute_process( - COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=prefix xkbfile - OUTPUT_VARIABLE KB_RULES_PREFIX - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + pkg_get_variable( KB_RULES_LIBDIR xkbfile libdir) + pkg_get_variable( KB_RULES_PREFIX xkbfile prefix) if( KB_RULES_LIBDIR AND KB_RULES_PREFIX ) find_file( RULES_FILE NAMES xorg xfree86 @@ -574,4 +563,119 @@ if( BUILD_KXKB ) message( STATUS "No additional XKb rules directory found" ) endif( ) + if( WITH_XKB_TRANSLATIONS ) + if( NOT XKB_CONFIG_LOCALE_DIR ) + pkg_get_variable( XKB_CONFIG_DATADIR xkeyboard-config datadir ) + if( XKB_CONFIG_DATADIR ) + set( XKB_CONFIG_LOCALE_DIR "${XKB_CONFIG_DATADIR}/locale" CACHE INTERNAL "" ) + message( STATUS "Found xkeybord-config locale dir: ${XKB_CONFIG_LOCALE_DIR}" ) + endif( ) + endif( ) + + if( NOT XKB_CONFIG_LOCALE_DIR ) + tde_message_fatal( "Translations for xkb messages were requested but the xkeyboard-config locale directory could not be determined." ) + endif( ) + endif( ) + endif( ) + +if( BUILD_KCONTROL OR BUILD_TDM ) + # SunOS kstat + check_library_exists( kstat kstat_open "" HAVE_KSTAT ) + if( HAVE_KSTAT ) + set( KSTAT_LIBRARIES kstat ) + else() + if( ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" ) + tde_message_fatal( "libkstat not found on SunOS platform!" ) + endif() + set( KSTAT_LIBRARIES "" ) + endif( ) + + if( NOT DEFINED REBOOT_BINARY ) + message( STATUS "Looking for reboot" ) + find_program( REBOOT_BINARY reboot + HINTS /sbin + /usr/sbin + ) + if( REBOOT_BINARY ) + message( STATUS "Looking for reboot - ${REBOOT_BINARY}" ) + endif( REBOOT_BINARY ) + endif( NOT DEFINED REBOOT_BINARY ) + + if( NOT DEFINED POWEROFF_BINARY ) + message( STATUS "Looking for poweroff" ) + find_program( POWEROFF_BINARY poweroff + HINTS /sbin + /usr/sbin + ) + if( POWEROFF_BINARY ) + message( STATUS "Looking for poweroff - ${POWEROFF_BINARY}" ) + endif( POWEROFF_BINARY ) + endif( NOT DEFINED POWEROFF_BINARY ) + + if( NOT DEFINED HALT_BINARY ) + message( STATUS "Looking for halt" ) + find_program( HALT_BINARY halt + HINTS /sbin + /usr/sbin + ) + if( HALT_BINARY ) + message( STATUS "Looking for halt - ${HALT_BINARY}" ) + endif( HALT_BINARY ) + endif( NOT DEFINED HALT_BINARY ) + + if( NOT DEFINED SHUTDOWN_BINARY ) + message( STATUS "Looking for shutdown" ) + find_program( SHUTDOWN_BINARY shutdown + HINTS /sbin + /usr/sbin + ) + if( SHUTDOWN_BINARY ) + message( STATUS "Looking for shutdown - ${SHUTDOWN_BINARY}" ) + endif( SHUTDOWN_BINARY ) + endif( NOT DEFINED SHUTDOWN_BINARY ) + + if( ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" ) + # SunOS based systems + if( NOT REBOOT_BINARY AND SHUTDOWN_BINARY ) + # emulate reboot + set( REBOOT_BINARY "${SHUTDOWN_BINARY} -y -i 6") + endif( NOT REBOOT_BINARY AND SHUTDOWN_BINARY ) + + if( NOT POWEROFF_BINARY AND SHUTDOWN_BINARY ) + # emulate poweroff + set( POWEROFF_BINARY "${SHUTDOWN_BINARY} -y -i 5") + endif( NOT POWEROFF_BINARY AND SHUTDOWN_BINARY ) + + else( ) # default condition + if( NOT REBOOT_BINARY AND SHUTDOWN_BINARY ) + # emulate reboot + set( REBOOT_BINARY "${SHUTDOWN_BINARY} -r now") + endif( NOT REBOOT_BINARY AND SHUTDOWN_BINARY ) + + if( NOT POWEROFF_BINARY AND SHUTDOWN_BINARY ) + # emulate poweroff + set( POWEROFF_BINARY "${SHUTDOWN_BINARY} -h now") + endif( NOT POWEROFF_BINARY AND SHUTDOWN_BINARY ) + + if( NOT POWEROFF_BINARY AND HALT_BINARY ) + # emulate poweroff + set( POWEROFF_BINARY "${HALT_BINARY} -p") + endif( NOT POWEROFF_BINARY AND HALT_BINARY ) + + endif( ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" ) + + if( NOT REBOOT_BINARY ) + tde_message_fatal( "reboot command is not defined" ) + endif( NOT REBOOT_BINARY ) + + if( NOT POWEROFF_BINARY ) + tde_message_fatal( "poweroff command is not defined" ) + endif( NOT POWEROFF_BINARY ) + + message( STATUS "poweroff - ${POWEROFF_BINARY}" ) + message( STATUS "reboot - ${REBOOT_BINARY}" ) + +endif( BUILD_KCONTROL OR BUILD_TDM ) + +check_include_files( "sys/time.h;sys/loadavg.h" HAVE_SYS_LOADAVG_H ) |