summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
blob: 83bcbfc6d2dd240dace4b3faba561e666f352a3d (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
#################################################
#
#  (C) 2010-2011 Serghei Amelian
#  serghei (DOT) amelian (AT) gmail.com
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

# required stuff

tde_setup_architecture_flags( )

include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

tde_setup_largefiles( )

find_package( TQt )
find_package( TDE )


##### check for gcc visibility support #########

if( WITH_GCC_VISIBILITY )
  tde_setup_gcc_visibility( )
endif( )


check_include_file( "sys/stropts.h" HAVE_SYS_STROPTS_H )
check_function_exists( "mkfifo" HAVE_MKFIFO )
check_symbol_exists( "getline" "stdio.h" HAVE_GETLINE )


##### check for berkeley db ####################
# we need at least bdb 4.1, but I do not check for version
# because this is really old and trinity will not
# working anyway on such old systems
find_file( USE_DB_H_PATH NAMES "db5/db.h" "db4/db.h" "db.h" )

check_c_source_compiles("
    #include <${USE_DB_H_PATH}>
    #include <stddef.h>
    int main() { DB *db; db->open(db, 0, 0, NULL, DB_BTREE, DB_CREATE, 0644); } "
  HAVE_BERKELEY_DB )

if( HAVE_BERKELEY_DB )
  find_library( BDB_LIBRARY db PATH_SUFFIXES db5 db4 )
endif( )

if( NOT BDB_LIBRARY )
  tde_message_fatal( "berkeley db is required, but was not found on your system" )
endif( )


##### check for subversion #####################
if( WITH_VCS_SUBVERSION )
  pkg_search_module( APR apr-1 )
  if( NOT APR_FOUND )
    tde_message_fatal( "apr-1 are requested, but not found on your system" )
  endif( )

  tde_save( CMAKE_REQUIRED_INCLUDES )
  set( CMAKE_REQUIRED_INCLUDES ${APR_INCLUDE_DIRS} )
  check_include_file_cxx( "subversion-1/svn_types.h" HAVE_SUBVERSION_1_SVN_TYPES_H )
  tde_restore( CMAKE_REQUIRED_INCLUDES )

  check_library_exists( svn_client-1 svn_client_version "" HAVE_SVN_CLIENT_1 )

  if( NOT (HAVE_SUBVERSION_1_SVN_TYPES_H AND HAVE_SVN_CLIENT_1) )
    tde_message_fatal( "svn_client-1 are requested, but not found on your system" )
  endif( )

  set( SVN_LIBRARIES svn_client-1 svn_subr-1 svn_ra-1 )
endif( )


##### check for gnu tar extensions #############
if( NOT TAR )
  message( STATUS "Checking if tar supports GNU extensions" )
  foreach( TAR_CMD tar gtar gnutar )
    if( NOT TAR )
      execute_process(
        COMMAND ${TAR_CMD} --version
        OUTPUT_VARIABLE TAR_VERSION
        ERROR_VARIABLE TAR_VERSION
      )
      if( "${TAR_VERSION}" MATCHES "(GNU tar)" )
        set( TAR "${TAR_CMD}" CACHE INTERNAL "" FORCE )
      endif( )
    endif( )
  endforeach( TAR_CMD )
  if( TAR )
    message( STATUS "Checking if tar supports GNU extensions - ${TAR}" )
  else( )
    tde_message_fatal( "tar with GNU extensions is required but not found on your system" )
  endif( )
endif( )