summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-udp/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/ipcpd/shim-udp/CMakeLists.txt')
-rw-r--r--src/ipcpd/shim-udp/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ipcpd/shim-udp/CMakeLists.txt b/src/ipcpd/shim-udp/CMakeLists.txt
index 27907880..f730fa3a 100644
--- a/src/ipcpd/shim-udp/CMakeLists.txt
+++ b/src/ipcpd/shim-udp/CMakeLists.txt
@@ -10,6 +10,21 @@ include_directories(${CURRENT_BINARY_PARENT_DIR})
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_BINARY_DIR}/include)
+# Find library needed for gethostbyname.
+include(CheckFunctionExists)
+CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+IF(NOT CMAKE_HAVE_GETHOSTBYNAME)
+ CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ IF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+ ELSE (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+ IF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+ SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+ ENDIF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+ ENDIF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ENDIF(NOT CMAKE_HAVE_GETHOSTBYNAME)
+
SET(IPCP_SHIM_UDP_TARGET ipcpd-shim-udp CACHE STRING "IPCP_SHIM_UDP_TARGET")
set(SHIM_UDP_SOURCES