From 7c0375e506d80776dac64bfd9afb94fde63954a8 Mon Sep 17 00:00:00 2001 From: Antonio Huete Jimenez Date: Sat, 14 Jan 2017 00:17:33 +0000 Subject: [PATCH] task: Fix build in SunOS-like environments. Tested in: - OpenIndiana 2816291 - OmniOS bed3013 - SmartOS 20161129T003638Z --- CMakeLists.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bf785e89..5ca6cacfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,26 @@ else (HAVE_UUID_UNPARSE_LOWER) message ("-- Found libuuid, using internal uuid_unparse_lower") endif (HAVE_UUID_UNPARSE_LOWER) +if (SOLARIS) + # accept() is in libsocket according to its manpage + message("-- Looking for libsocket") + find_library (SOCKET_LIBRARY NAMES socket) + if (SOCKET_LIBRARY) + set (TASK_LIBRARIES ${TASK_LIBRARIES} ${SOCKET_LIBRARY}) + else (SOCKET_LIBRARY) + message(FATAL_ERROR "-- libsocket not found.") + endif (SOCKET_LIBRARY) + + # inet_ntop() is in libnsl according to its manpage + message("-- Looking for libnsl") + find_library (NSL_LIBRARY NAMES nsl) + if (NSL_LIBRARY) + set (TASK_LIBRARIES ${TASK_LIBRARIES} ${NSL_LIBRARY}) + else (NSL_LIBRARY) + message(FATAL_ERROR "-- libnsl not found.") + endif (NSL_LIBRARY) +endif (SOLARIS) + # Set the package language. if (LANGUAGE) set (PACKAGE_LANGUAGE ${LANGUAGE})