From ca6ac7339b177876bb1743f9ad742cc2ec969556 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sat, 22 Sep 2018 16:20:25 +0200
Subject: Haiku networking functions lives in lnetwork


diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 5d43b36..00ea1b0 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -244,6 +244,11 @@ if (UNIX)
             set(HAVE_GETADDRINFO TRUE)
             set(_REQUIRED_LIBRARIES ${_REQUIRED_LIBRARIES} socket)
         endif (HAVE_LIBSOCKET)
+        check_library_exists(network getaddrinfo "" HAVE_LIBNETWORK)
+        if (HAVE_LIBNETWORK)
+            set(HAVE_GETADDRINFO TRUE)
+            set(_REQUIRED_LIBRARIES ${_REQUIRED_LIBRARIES} network)
+        endif (HAVE_LIBNETWORK)
 
         # libnsl/inet_pton (Solaris)
         check_library_exists(nsl inet_pton "" HAVE_LIBNSL)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a576cf7..7f0fbd9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -16,6 +16,13 @@ if (WIN32)
   )
 endif (WIN32)
 
+if (HAVE_LIBNETWORK)
+  set(LIBSSH_LINK_LIBRARIES
+    ${LIBSSH_LINK_LIBRARIES}
+    network
+  )
+endif (HAVE_LIBNETWORK)
+
 if (OPENSSL_CRYPTO_LIBRARIES)
   set(LIBSSH_PRIVATE_INCLUDE_DIRS
     ${LIBSSH_PRIVATE_INCLUDE_DIRS}
-- 
2.30.2

