mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-11 10:40:27 +09:00
Fix linking on solaris.
libresolv and librt are required.
This commit is contained in:
@@ -57,6 +57,16 @@ if (UNIX)
|
|||||||
if (HAVE_LIBNSL)
|
if (HAVE_LIBNSL)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl)
|
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl)
|
||||||
endif (HAVE_LIBNSL)
|
endif (HAVE_LIBNSL)
|
||||||
|
# libresolv
|
||||||
|
check_library_exists(resolve hstrerror "" HAVE_LIBRESOLV)
|
||||||
|
if (HAVE_LIBRESOLV)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} resolv)
|
||||||
|
endif (HAVE_LIBRESOLV)
|
||||||
|
check_library_exists(rt nanosleep "" HAVE_LIBRT)
|
||||||
|
# librt
|
||||||
|
if (HAVE_LIBRT)
|
||||||
|
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} rt)
|
||||||
|
endif (HAVE_LIBRT)
|
||||||
|
|
||||||
check_function_exists(getaddrinfo HAVE_GETADDRINFO)
|
check_function_exists(getaddrinfo HAVE_GETADDRINFO)
|
||||||
check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
|
check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
|
||||||
@@ -65,6 +75,7 @@ if (UNIX)
|
|||||||
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")
|
||||||
|
|
||||||
# LIBRARIES
|
# LIBRARIES
|
||||||
if (CRYPTO_FOUND)
|
if (CRYPTO_FOUND)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ if (WITH_STATIC_LIB)
|
|||||||
endif (WITH_STATIC_LIB)
|
endif (WITH_STATIC_LIB)
|
||||||
|
|
||||||
set(LIBSSH_LINK_LIBRARIES
|
set(LIBSSH_LINK_LIBRARIES
|
||||||
|
${LIBSSH_REQUIRED_LIBRARIES}
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -35,13 +36,6 @@ if (WIN32)
|
|||||||
)
|
)
|
||||||
endif (WIN32)
|
endif (WIN32)
|
||||||
|
|
||||||
if (HAVE_LIBNSL)
|
|
||||||
set(LIBSSH_LINK_LIBRARIES
|
|
||||||
${LIBSSH_LINK_LIBRARIES}
|
|
||||||
nsl
|
|
||||||
)
|
|
||||||
endif (HAVE_LIBNSL)
|
|
||||||
|
|
||||||
if (HAVE_LIBSOCKET)
|
if (HAVE_LIBSOCKET)
|
||||||
set(LIBSSH_LINK_LIBRARIES
|
set(LIBSSH_LINK_LIBRARIES
|
||||||
${LIBSSH_LINK_LIBRARIES}
|
${LIBSSH_LINK_LIBRARIES}
|
||||||
|
|||||||
Reference in New Issue
Block a user