summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake342
1 files changed, 266 insertions, 76 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 64908c9da..640849814 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -23,18 +23,31 @@ tde_setup_largefiles( )
find_package( TQt )
find_package( TDE )
-
-##### check for libdl ###########################
-
-set( DL_LIBRARIES dl )
-check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL )
-if( NOT HAVE_LIBDL )
- unset( DL_LIBRARIES )
- check_function_exists( dlopen HAVE_DLOPEN )
- if( HAVE_DLOPEN )
- set( HAVE_LIBDL 1 )
- endif( HAVE_DLOPEN )
-endif( NOT HAVE_LIBDL )
+# 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"
+
+if( WITH_USBIDS )
+ set( USBIDS_FILE "${WITH_USBIDS}" )
+ message( STATUS "Using specified usb.ids file: ${USBIDS_FILE}" )
+ else()
+ find_file( PATH_USBIDS usb.ids
+ HINTS /usr/share/misc
+ /var/lib/usbutils
+ /usr/share/hwdata
+ )
+ if( PATH_USBIDS )
+ set( USBIDS_FILE "${PATH_USBIDS}" )
+ message( STATUS "Using system usb.ids file: ${PATH_USBIDS}" )
+ else()
+ set( USE_BUILTIN_USBIDS 1 )
+ message( STATUS "File usb.ids (hwdata) was not found on the system, using builtin" )
+ endif()
+endif( WITH_USBIDS )
# stdint.h (drkonqi)
@@ -49,12 +62,6 @@ if( BUILD_TDM OR BUILD_TDEIOSLAVES )
endif( )
-# sys/bitypes.h (drkonqi)
-if( BUILD_DRKONQI )
- check_include_file( sys/bitypes.h HAVE_SYS_BITYPES_H )
-endif( )
-
-
# sys/ioctl.h (tdeioslave/fish, kcontrol/info)
if( BUILD_TDEIOSLAVES OR BUILD_KCONTROL )
check_include_file( sys/ioctl.h HAVE_SYS_IOCTL_H )
@@ -68,22 +75,36 @@ endif( )
# sys/time.h (tdeioslave/sftp, ksmserver, ksplashml)
-if( BUILD_KSMSERVER OR BUILD_KSPLASHML OR BUILD_TDEIOSLAVES)
+if( BUILD_KSMSERVER OR BUILD_KSPLASHML OR BUILD_TDEIOSLAVES )
check_include_file( sys/time.h HAVE_SYS_TIME_H )
check_include_files( "sys/time.h;time.h" TIME_WITH_SYS_TIME )
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 )
+# libssh (tdeioslave/sftp)
+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" )
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( )
+
+
+# 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 ${CMAKE_DL_LIBS} )
+ 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( )
@@ -100,20 +121,11 @@ if( NOT HAVE_CRYPT )
endif( NOT HAVE_CRYPT )
-# hal (ksmserver, tdeioslaves)
-if( WITH_HAL )
- pkg_search_module( HAL hal )
- if( NOT HAL_FOUND )
- tde_message_fatal( "hal is required, but was not found on your system" )
- endif( )
-endif( )
-
-
# tdehwlib (drkonqi, kcontrol, kicker, ksmserver, tdeioslaves, tdm)
if( WITH_TDEHWLIB )
tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TDE_INCLUDE_DIR}" )
check_cxx_source_compiles( "
- #include <kdemacros.h>
+ #include <tdemacros.h>
#ifndef __TDE_HAVE_TDEHWLIB
#error tdecore is not build with tdehwlib
#endif
@@ -124,14 +136,15 @@ if( WITH_TDEHWLIB )
if( NOT HAVE_TDEHWLIB )
tde_message_fatal( "tdehwlib is required, but not built in tdecore" )
endif( NOT HAVE_TDEHWLIB )
+ set( TDEHW_LIBRARIES "tdehw-shared" )
endif( )
-# udev (tsak)
-if( BUILD_TSAK )
- pkg_search_module( UDEV udev )
+# udev (tsak, tdekbdledsync)
+if( BUILD_TSAK OR BUILD_TDEKBDLEDSYNC )
+ pkg_search_module( UDEV libudev )
if( NOT UDEV_FOUND )
- tde_message_fatal( "udev is required, but was not found on your system" )
+ tde_message_fatal( "udev library is required, but was not found on your system" )
endif( )
endif( )
@@ -243,12 +256,12 @@ if( WITH_LIBCONFIG )
endif( )
-# pcre (twin/compton-tde)
-if( WITH_PCRE )
- pkg_search_module( LIBPCRE libpcre )
- if( NOT LIBPCRE_FOUND )
- tde_message_fatal( "pcre support is requested, but not found on your system" )
- endif( NOT LIBPCRE_FOUND )
+# pcre2 (twin/compton-tde)
+if( WITH_PCRE2 )
+ pkg_check_modules( LIBPCRE2 libpcre2-8 libpcre2-posix )
+ if( NOT LIBPCRE2_FOUND )
+ tde_message_fatal( "pcre2 support was requested, but not found on your system" )
+ endif( )
endif( )
@@ -283,7 +296,9 @@ if( WITH_XSCREENSAVER )
endif( )
endif( )
+ tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${XSS_INCLUDE_DIRS}" )
check_include_file( X11/extensions/scrnsaver.h HAVE_XSCREENSAVER_H )
+ tde_restore( CMAKE_REQUIRED_INCLUDES )
if( HAVE_XSSLIB AND HAVE_XSCREENSAVER_H )
set( HAVE_XSCREENSAVER 1 )
else( )
@@ -294,10 +309,10 @@ if( WITH_XSCREENSAVER )
# where xscreensaver stores its executables. So give the user the possibility
# to define XSCREENSAVER_DIR and speficy the location manually.
include( FindXscreensaver.cmake ) # not really good practise
- if( NOT XSCREENSAVER_DIR )
+ if( NOT XSCREENSAVER_DIRS )
tde_message_fatal(
- "xscreensaver is requested, but cmake can not determine the location of XSCREENSAVER_DIR
- You have to either specify it manually with e.g. -DXSCREENSAVER_DIR=/usr/lib/misc/xscreensaver/
+ "xscreensaver is requested, but cmake can not determine the location of XSCREENSAVER_DIRS
+ You have to either specify it manually with e.g. -DXSCREENSAVER_DIRS=/usr/lib/misc/xscreensaver/
or make sure that xscreensaver installed properly" )
endif( )
@@ -434,27 +449,6 @@ if( BUILD_KDESKTOP )
endif( )
-# dbus-tqt (ksmserver, kicker, tdeioslaves(media))
-if( WITH_HAL AND (BUILD_KSMSERVER OR BUILD_KICKER OR BUILD_TDEIOSLAVES) )
-
- # check for dbus-tqt
- # dbus-tqt need Qt flags
- pkg_check_modules( DBUS_TQT REQUIRED dbus-tqt )
- tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
- set( CMAKE_REQUIRED_INCLUDES ${DBUS_TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS} ${TQT_INCLUDE_DIRS})
- set( CMAKE_REQUIRED_LIBRARIES ${DBUS_TQT_LDFLAGS} ${TQT_LDFLAGS} ${QT_LDFLAGS} )
- check_cxx_source_compiles("
- #include <tqt.h>
- #include <dbus/connection.h>
- int main(int, char**) { return 0; } "
- HAVE_DBUS_QT3_07 )
- tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
- if( NOT HAVE_DBUS_QT3_07 )
- tde_message_fatal( "dbus-tqt is required, but was not found on your system" )
- endif( )
-
-endif( )
-
# check for krb5
if( WITH_KRB5 )
pkg_search_module( KRB5 krb5 )
@@ -465,7 +459,6 @@ if( WITH_KRB5 )
endif( NOT HAVE_KRB_KADM_H )
endif( NOT KRB5_FOUND )
set( HAVE_KRB5 1 )
- set( LIBTDELDAP_LIBRARIES "tdeldap" )
endif( )
# check for libr
@@ -474,8 +467,205 @@ 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( )
+
+#
+# For kxkb, try to find the path to the Xkb rules files:
+#
+# 1: ask for the path from xkeyboard-config's pkg-config file
+# 2: ask for the path from xkbcomp's pkg-config file
+# 3: look under the "FILES" heading in the man page for setxkbmap
+# 4: take the prefix/libdir from xkbfile's pkg-config file and try the
+# "${prefix}/share/X11" and "${libdir}/X11" directories
+#
+# Alternatively, just take an overriding value from the command line.
+#
+
+if( BUILD_KXKB )
+
+ if( NOT X11_XKB_RULES_DIR )
+ 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_get_variable( KB_RULES_DIR xkbcomp xkbconfigdir )
+ if( KB_RULES_DIR )
+ string(REGEX REPLACE "/xkb$" "/" X11_XKB_RULES_DIR "${KB_RULES_DIR}" )
+ endif( )
+ endif( )
+
+ if( NOT X11_XKB_RULES_DIR )
+ execute_process(
+ COMMAND man -P cat setxkbmap
+ OUTPUT_VARIABLE SETXKBMAP_OUTPUT
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE SETXKBMAP_OUTPUT
+ ERROR_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE SETXKBMAP_RC
+ )
+ if( "${SETXKBMAP_RC}" STREQUAL "0" AND
+ "${SETXKBMAP_OUTPUT}" MATCHES "\n.*FILES.*\n[^/]*(/[^\n]*/)xkb.*\n" )
+ if( EXISTS "${CMAKE_MATCH_1}xkb" )
+ set( X11_XKB_RULES_DIR "${CMAKE_MATCH_1}" )
+ endif( )
+ endif( )
+ endif( )
+
+ if( NOT X11_XKB_RULES_DIR )
+ 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
+ PATHS "${KB_RULES_PREFIX}/share/X11"
+ "${KB_RULES_LIBDIR}/X11"
+ PATH_SUFFIXES xkb/rules
+ NO_DEFAULT_PATH
+ )
+ if( RULES_FILE )
+ string( REGEX REPLACE "/xkb/rules/(xorg|xfree86)$" "/" X11_XKB_RULES_DIR "${RULES_FILE}" )
+ endif( )
+ endif( )
+ endif( )
+
+ if( X11_XKB_RULES_DIR )
+ if( NOT "${X11_XKB_RULES_DIR}" MATCHES "/$" )
+ set( X11_XKB_RULES_DIR "${X11_XKB_RULES_DIR}/" )
+ endif( )
+ message( STATUS "Adding ${X11_XKB_RULES_DIR} to XKb rules directory search" )
+ else( )
+ 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 )
+
+# XInput (kcontrol/input/touchpad.cpp)
+if( BUILD_KCONTROL )
+ pkg_search_module( XINPUT xi )
+ if( NOT XINPUT_FOUND )
+ tde_message_fatal( "XInput is required, but was not found on your system" )
+ endif( )
+endif ( BUILD_KCONTROL )
+
+
+check_include_files( "sys/time.h;sys/loadavg.h" HAVE_SYS_LOADAVG_H )