summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
blob: d5976b393eb201368fd9e50586c059673eb9b4e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
###########################################
#                                         #
#  Improvements and feedback are welcome  #
#                                         #
#  This file is released under GPL >= 3   #
#                                         #
###########################################


# required stuff
find_package( TQt )
find_package( TDE )

tde_setup_architecture_flags( )

include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

tde_setup_largefiles( )

set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}:${LIB_INSTALL_DIR}/pkgconfig" )


##### check for gcc visibility support

if( WITH_GCC_VISIBILITY )
  tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )


##### check for libgmp

pkg_search_module( GMP gmp )
if( NOT GMP_FOUND )
  find_library( GMP_LIBRARIES gmp )
  if( NOT GMP_LIBRARIES )
    tde_message_fatal( "libgmp is required but not found on your system" )
  endif()
endif( )


##### check for avahi

if( WITH_ZEROCONF )
  pkg_search_module( AVAHI_TQT avahi-tqt )
  pkg_search_module( AVAHI_CLIENT avahi-client )
  if( NOT AVAHI_TQT_FOUND OR NOT AVAHI_CLIENT_FOUND OR AVAHI_CLIENT_VERSION VERSION_LESS "0.6.10")
    tde_message_fatal( "avahi >= 0.6.10 support is requested, but not found on your system" )
  endif( )
endif( )


##### check for geoip

if( WITH_SYSTEM_GEOIP )
  pkg_search_module( GEOIP geoip )
  if( NOT GEOIP_FOUND )
    tde_message_fatal( "GeoIP is required but was not found on your system" )
  endif( )
  set( USE_SYSTEM_GEOIP 1 )
  # The use of the system-wide geoip database disables the use of the builtin one
  set( WITH_BUILTIN_GEOIP OFF )
endif( )


##### check for various fuctions, headers and types

check_function_exists( posix_fallocate   HAVE_POSIX_FALLOCATE )
check_function_exists( posix_fallocate64 HAVE_POSIX_FALLOCATE64 )
check_function_exists( fopen64           HAVE_FOPEN64 )
check_function_exists( ftruncate64       HAVE_FTRUNCATE64 )
check_function_exists( lseek64           HAVE_LSEEK64 )
check_function_exists( mmap64            HAVE_MMAP64 )
check_function_exists( munmap64          HAVE_MUNMAP64 )
check_function_exists( statvfs           HAVE_STATVFS )
check_function_exists( statvfs64         HAVE_STATVFS64 )

check_function_exists( fseeko64 _HAVE_FSEEKO64 )
check_function_exists( ftello64 _HAVE_FTELLO64 )
if( _HAVE_FSEEKO64 AND _HAVE_FTELLO64 )
  set( HAVE_FSEEKO64 1 )
endif( )

check_function_exists( stat64  _HAVE_STAT64 )
check_function_exists( fstat64 _HAVE_FSTAT64 )
if( _HAVE_FSTAT64 AND _HAVE_STAT64 )
  set( HAVE_STAT64 1 )
endif( )

check_include_file( "xfs/xfs.h" HAVE_XFS_XFS_H )

tde_save_and_set( CMAKE_REQUIRED_INCLUDES )
check_cxx_source_compiles( "
  #include <xfs/xfs.h>
  int main() { __s64 u; return 0; } "
  HAVE___S64
)
check_cxx_source_compiles( "
  #include <xfs/xfs.h>
  int main() { __u64 u; return 0; } "
  HAVE___U64
)
tde_restore( CMAKE_REQUIRED_INCLUDES )