TDE utility programs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

229 lines
6.9 KiB

  1. #################################################
  2. #
  3. # (C) 2012 Golubev Alexander
  4. # fatzer2 (AT) gmail.com
  5. #
  6. # Improvements and feedback are welcome
  7. #
  8. # This file is released under GPL >= 2
  9. #
  10. #################################################
  11. # required stuff
  12. tde_setup_architecture_flags( )
  13. include(TestBigEndian)
  14. test_big_endian(WORDS_BIGENDIAN)
  15. tde_setup_largefiles( )
  16. find_package( TQt )
  17. find_package( TDE )
  18. ##### check for gcc visibility support #########
  19. if( WITH_GCC_VISIBILITY )
  20. tde_setup_gcc_visibility( )
  21. endif( )
  22. ##### ark #######################################
  23. if( BUILD_ARK )
  24. check_symbol_exists( strlcpy string.h HAVE_STRLCPY_PROTO )
  25. check_symbol_exists( strlcat string.h HAVE_STRLCAT_PROTO )
  26. endif( BUILD_ARK )
  27. ##### kcalc #####################################
  28. if( BUILD_KCALC )
  29. check_type_size( "unsigned long" SIZEOF_UNSIGNED_LONG )
  30. check_include_file( "stdlib.h" HAVE_STDLIB_H )
  31. check_include_file( "ieeefp.h" HAVE_IEEEFP_H )
  32. # NOTE: this check could be insufficiant for build on some
  33. # buggy, very old or unusual system configurations
  34. check_type_size( "long double" SIZEOF_LONG_DOUBLE)
  35. if( SIZEOF_LONG_DOUBLE )
  36. set( HAVE_LONG_DOUBLE 1 )
  37. endif( SIZEOF_LONG_DOUBLE )
  38. set( CMAKE_REQUIRED_LIBRARIES m )
  39. check_symbol_exists( "fabsl" "math.h" HAVE_L_FUNCS)
  40. check_symbol_exists( "isinf" "math.h" HAVE_FUNC_ISINF)
  41. check_symbol_exists( "round" "math.h" HAVE_FUNC_ROUND)
  42. check_symbol_exists( "roundl" "math.h" HAVE_FUNC_ROUNDL)
  43. # also libgmp is requred
  44. set( CMAKE_REQUIRED_LIBRARIES gmp )
  45. # most functions are defined as macros so we can't use check_library exists
  46. check_symbol_exists( "gmp_asprintf" "gmp.h" HAVE_GMPLIB )
  47. set( CMAKE_REQUIRED_LIBRARIES )
  48. if( HAVE_GMPLIB )
  49. set( GMP_LIBRARY gmp CACHE INTERNAL "" )
  50. else( )
  51. tde_message_fatal( "libgmp is required, but was not found on your system" )
  52. endif( )
  53. endif ( BUILD_KCALC )
  54. ##### klaptopdaemon #############################
  55. if( BUILD_KLAPTOPDAEMON )
  56. # stdint.h
  57. check_include_file( "stdint.h" HAVE_STDINT_H )
  58. if( NOT HAVE_STDINT_H )
  59. tde_message_fatal( "stdint.h header is required, but was not found on your system" )
  60. endif( NOT HAVE_STDINT_H )
  61. # NetBSD apm support
  62. check_include_files( "unistd.h;machine/apm_bios.h" HAVE_MACHINE_APM_BIOS_H )
  63. check_include_files( "unistd.h;dev/apm/apmio.h" HAVE_DEV_APM_APMIO_H )
  64. # xtest
  65. pkg_search_module( XTEST xtst )
  66. if( XTEST_FOUND )
  67. set( HAVE_XTEST 1 )
  68. else( XTEST_FOUND )
  69. tde_message_fatal( "libXtst is requested, but was not found on your system" )
  70. endif( XTEST_FOUND )
  71. if( WITH_XSCREENSAVER )
  72. pkg_search_module( XSCREENSAVER xscrnsaver )
  73. if( XSCREENSAVER_FOUND )
  74. set( HAVE_XSCREENSAVER 1 )
  75. else( XSCREENSAVER_FOUND )
  76. tde_message_fatal( "xscreensaver is requested, but was not found on your system" )
  77. endif( )
  78. endif( WITH_XSCREENSAVER )
  79. endif( BUILD_KLAPTOPDAEMON )
  80. ##### klaptopdaemon and ksim ####################
  81. if( ( BUILD_KLAPTOPDAEMON AND WITH_DPMS ) OR ( BUILD_KSIM AND WITH_SENSORS ) )
  82. pkg_search_module( XEXT xext )
  83. if( XEXT_FOUND )
  84. if( WITH_DPMS )
  85. set( CMAKE_REQUIRED_LIBRARIES ${XEXT_LIBRARIES} )
  86. check_symbol_exists( DPMSInfo
  87. "X11/Xlib.h;X11/extensions/dpms.h"
  88. HAVE_DPMSINFO_PROTO )
  89. set( CMAKE_REQUIRED_LIBRARIES )
  90. set( HAVE_DPMS 1 )
  91. endif( WITH_DPMS )
  92. else( XEXT_FOUND )
  93. tde_message_fatal( "libXext is requested, but was not found on your system" )
  94. endif( XEXT_FOUND )
  95. endif( )
  96. ##### kmilo #####################################
  97. if( BUILD_KMILO )
  98. # FIXME: If anybody will ever compile trinity for POWERPC and especialy for
  99. # POWERBOOK he or she should test workability of those modules
  100. if( WITH_POWERBOOK OR WITH_POWERBOOK2 )
  101. check_library_exists( "pbb" "init_libpbb" "" HAVE_PBBIPC_LIBRARY )
  102. check_include_file( "pbbipc.h" HAVE_PBBIPC_H )
  103. check_include_file( "pbb.h" HAVE_PBB_H )
  104. if( HAVE_PBBIPC_LIBRARY AND ( ( WITH_POWERBOOK AND HAVE_PBBIPC_H ) OR
  105. ( WITH_POWERBOOK2 AND HAVE_PBB_H ) ) )
  106. set( PBB_LIBRARY pbb CACHE INTERNAL "" )
  107. else()
  108. tde_message_fatal( "suitable pbbuttonosd is required, but was not found on your system" )
  109. endif()
  110. endif( WITH_POWERBOOK OR WITH_POWERBOOK2 )
  111. endif( BUILD_KMILO )
  112. ##### ksim ######################################
  113. if ( BUILD_KSIM )
  114. check_include_file( "sys/statvfs.h" HAVE_SYS_STATVFS_H )
  115. check_include_file( "sys/statfs.h" HAVE_SYS_STATFS_H )
  116. check_include_file( "sys/vfs.h" HAVE_SYS_VFS_H )
  117. check_include_file( "sys/mount.h" HAVE_SYS_MOUNT_H )
  118. check_include_file( "mntent.h" HAVE_MNTENT_H )
  119. check_include_file( "sys/ucred.h" HAVE_SYS_UCRED_H )
  120. check_include_file( "sys/mnttab.h" HAVE_SYS_MNTTAB_H )
  121. check_include_file( "sys/loadavg.h" HAVE_SYS_LOADAVG_H )
  122. check_function_exists( getloadavg HAVE_GETLOADAVG )
  123. check_function_exists( statfs HAVE_STATFS )
  124. check_function_exists( statvfs HAVE_STATVFS )
  125. check_function_exists( getmntinfo HAVE_GETMNTINFO )
  126. if( HAVE_GETMNTINFO )
  127. check_cxx_source_compiles("
  128. #include <sys/types.h>
  129. #include <sys/statvfs.h>
  130. int main(){
  131. struct statvfs *mntbufp;
  132. int flags;
  133. return getmntinfo(&mntbufp, flags);
  134. }"
  135. GETMNTINFO_USES_STATVFS )
  136. endif( HAVE_GETMNTINFO )
  137. check_c_source_compiles(
  138. "#include <linux/kernel.h>
  139. int main() { struct sysinfo system;
  140. int totalhigh = system.totalhigh;
  141. int freehigh = system.freehigh; return 0; }"
  142. HAVE_SYSINFO_HIGH )
  143. if( WITH_SNMP )
  144. check_include_file( "net-snmp/net-snmp-config.h" HAVE_NET_SNMP_NET_SNMP_CONFIG_H )
  145. check_library_exists( netsnmp init_snmp "" HAVE_NETSNMP )
  146. if( HAVE_NET_SNMP_NET_SNMP_CONFIG_H AND HAVE_NETSNMP )
  147. set( NETSNMP_LIBRARIES netsnmp )
  148. else ()
  149. tde_message_fatal( "netsnmp is required, but was not found on your system" )
  150. endif ()
  151. endif( WITH_SNMP )
  152. check_library_exists( devstat selectdevs "" HAVE_DEVSTAT_SELECTDEVS )
  153. if( HAVE_DEVSTAT_SELECTDEVS )
  154. set( DEVSTAT_LIBRARIES devstat )
  155. else( )
  156. check_library_exists( devstat devstat_selectdevs "" HAVE_DEVSTAT_DEVSTAT_SELECTDEVS )
  157. if( HAVE_DEVSTAT_DEVSTAT_SELECTDEVS )
  158. set( DEVSTAT_LIBRARIES devstat )
  159. endif( )
  160. endif( HAVE_DEVSTAT_SELECTDEVS )
  161. endif ( BUILD_KSIM )
  162. ##### superkaramba ##############################
  163. if ( BUILD_SUPERKARAMBA )
  164. check_include_file( "sys/types.h" HAVE_SYS_TYPES_H )
  165. find_package( PythonLibs )
  166. if( NOT PYTHONLIBS_FOUND )
  167. tde_message_fatal( "python is required, but was not found on your system" )
  168. endif( NOT PYTHONLIBS_FOUND )
  169. if( WITH_TDENEWSTUFF )
  170. set( HAVE_TDENEWSTUFF 1 )
  171. set( TDENEWSTUFF_LIBRARIES tdenewstuff-shared )
  172. endif( WITH_TDENEWSTUFF )
  173. if( WITH_XMMS )
  174. set( HAVE_XMMS 1 )
  175. endif( WITH_XMMS )
  176. if( ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" )
  177. check_library_exists( kvm kvm_getswapinfo "" HAVE_LIBKVM )
  178. if( HAVE_LIBKVM )
  179. set( LIBKVM_LIBRARIES kvm )
  180. endif( )
  181. endif( )
  182. endif ( BUILD_SUPERKARAMBA )