build: There is no need to check for system libraries on Linux.

This commit is contained in:
Andreas Schneider
2010-09-08 11:19:22 +02:00
parent 031c06419b
commit 4f75fdcd14
2 changed files with 29 additions and 26 deletions

View File

@@ -29,6 +29,7 @@ set(CMAKE_MODULE_PATH
# add definitions # add definitions
include(DefineCMakeDefaults) include(DefineCMakeDefaults)
include(DefinePlatformDefaults)
include(DefineCompilerFlags) include(DefineCompilerFlags)
include(DefineInstallationPaths) include(DefineInstallationPaths)
include(DefineOptions.cmake) include(DefineOptions.cmake)

View File

@@ -81,33 +81,35 @@ if (WIN32)
endif (WIN32) endif (WIN32)
if (UNIX) if (UNIX)
# libsocket (Solaris) if (NOT LINUX)
check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET) # libsocket (Solaris)
if (HAVE_LIBSOCKET) check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket) if (HAVE_LIBSOCKET)
endif (HAVE_LIBSOCKET) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
# libnsl (Solaris) endif (HAVE_LIBSOCKET)
check_library_exists(nsl gethostbyname "" HAVE_LIBNSL) # libnsl (Solaris)
if (HAVE_LIBNSL) check_library_exists(nsl gethostbyname "" HAVE_LIBNSL)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl) if (HAVE_LIBNSL)
endif (HAVE_LIBNSL) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl)
# libresolv endif (HAVE_LIBNSL)
check_library_exists(resolv hstrerror "" HAVE_LIBRESOLV) # libresolv
if (HAVE_LIBRESOLV) check_library_exists(resolv hstrerror "" HAVE_LIBRESOLV)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} resolv) if (HAVE_LIBRESOLV)
endif (HAVE_LIBRESOLV) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} resolv)
check_library_exists(rt nanosleep "" HAVE_LIBRT) endif (HAVE_LIBRESOLV)
# librt check_library_exists(rt nanosleep "" HAVE_LIBRT)
if (HAVE_LIBRT) # librt
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt) if (HAVE_LIBRT)
endif (HAVE_LIBRT) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
endif (HAVE_LIBRT)
endif (NOT LINUX)
check_function_exists(getaddrinfo HAVE_GETADDRINFO) check_function_exists(getaddrinfo HAVE_GETADDRINFO)
check_function_exists(gethostbyname HAVE_GETHOSTBYNAME) check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
check_function_exists(poll HAVE_POLL) check_function_exists(poll HAVE_POLL)
check_function_exists(select HAVE_SELECT) check_function_exists(select HAVE_SELECT)
check_function_exists(cfmakeraw HAVE_CFMAKERAW) check_function_exists(cfmakeraw HAVE_CFMAKERAW)
check_function_exists(regcomp HAVE_REGCOMP) check_function_exists(regcomp HAVE_REGCOMP)
endif (UNIX) endif (UNIX)
set(LIBSSH_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "libssh required system libraries") set(LIBSSH_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "libssh required system libraries")