~ubuntu-branches/ubuntu/quantal/libssh/quantal

« back to all changes in this revision

Viewing changes to ConfigureChecks.cmake

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2011-03-13 22:06:00 UTC
  • mfrom: (1.1.9 upstream) (4.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110313220600-bbqbkcj8zelnfbbo
Tags: 0.4.8-2
* Upload to unstable
* debian/control: Add texlive-fonts-recommended to Build-Depends-Indep
  (Closes: #608319)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
set(BINARYDIR ${CMAKE_BINARY_DIR})
18
18
set(SOURCEDIR ${CMAKE_SOURCE_DIR})
19
19
 
20
 
if(CMAKE_COMPILER_IS_GNUCC)
21
 
check_c_compiler_flag("-fvisibility=hidden" WITH_VISIBILITY_HIDDEN)
22
 
endif(CMAKE_COMPILER_IS_GNUCC)
 
20
function(COMPILER_DUMPVERSION _OUTPUT_VERSION)
 
21
    execute_process(
 
22
        COMMAND
 
23
            ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} -dumpversion
 
24
        OUTPUT_VARIABLE _COMPILER_VERSION
 
25
    )
 
26
 
 
27
    string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
 
28
           _COMPILER_VERSION "${_COMPILER_VERSION}")
 
29
 
 
30
    set(${_OUTPUT_VERSION} ${_COMPILER_VERSION} PARENT_SCOPE)
 
31
endfunction()
 
32
 
 
33
if(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW AND NOT OS2)
 
34
    compiler_dumpversion(GNUCC_VERSION)
 
35
    if (NOT GNUCC_VERSION EQUAL 34)
 
36
        check_c_compiler_flag("-fvisibility=hidden" WITH_VISIBILITY_HIDDEN)
 
37
    endif (NOT GNUCC_VERSION EQUAL 34)
 
38
endif(CMAKE_COMPILER_IS_GNUCC AND NOT MINGW AND NOT OS2)
23
39
 
24
40
# HEADER FILES
25
41
check_include_file(argp.h HAVE_ARGP_H)
39
55
    set(HAVE_GETHOSTBYNAME TRUE)
40
56
  endif (HAVE_WSPIAPI_H OR HAVE_WS2TCPIP_H)
41
57
 
42
 
  check_function_exists(vsnprintf HAVE_VSNPRINTF)
43
 
  if(NOT HAVE_VSNPRINTF)
44
 
      check_function_exists(_vsnprintf_s HAVE__VSNPRINTF_S)
45
 
      check_function_exists(_vsnprintf HAVE__VSNPRINTF)
46
 
  endif(NOT HAVE_VSNPRINTF)
47
 
  check_function_exists(snprintf HAVE_SNPRINTF)
48
 
  if(NOT HAVE_SNPRINTF)
49
 
      check_function_exists(_snprintf HAVE__SNPRINTF)
50
 
      check_function_exists(_snprintf_s HAVE__SNPRINTF_S)
51
 
  endif(NOT HAVE_SNPRINTF)
52
 
  check_function_exists(strncpy HAVE_STRNCPY)
53
 
 
54
58
  set(HAVE_SELECT TRUE)
55
59
endif (WIN32)
56
60
 
65
69
 
66
70
# FUNCTIONS
67
71
 
 
72
check_function_exists(strncpy HAVE_STRNCPY)
 
73
check_function_exists(vsnprintf HAVE_VSNPRINTF)
 
74
check_function_exists(snprintf HAVE_SNPRINTF)
 
75
 
 
76
if (WIN32)
 
77
    check_function_exists(_vsnprintf_s HAVE__VSNPRINTF_S)
 
78
    check_function_exists(_vsnprintf HAVE__VSNPRINTF)
 
79
    check_function_exists(_snprintf HAVE__SNPRINTF)
 
80
    check_function_exists(_snprintf_s HAVE__SNPRINTF_S)
 
81
endif (WIN32)
 
82
 
68
83
if (UNIX)
69
84
  # libsocket (Solaris)
70
85
  check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
120
135
endif (WITH_DEBUG_CALLTRACE)
121
136
 
122
137
# ENDIAN
123
 
test_big_endian(WORDS_BIGENDIAN)
 
138
if (NOT WIN32)
 
139
    test_big_endian(WORDS_BIGENDIAN)
 
140
endif (NOT WIN32)