summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-udp/CMakeLists.txt
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-04-26 18:16:08 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-04-26 18:16:08 +0200
commita17657c4321dc0770e5431467261eb2bc579f79c (patch)
tree9f64215f326c3847699ae8856ae9cd0d609cbfac /src/ipcpd/shim-udp/CMakeLists.txt
parent45b7d79088174303193f8772c9b14fed2011551e (diff)
downloadouroboros-a17657c4321dc0770e5431467261eb2bc579f79c.tar.gz
ouroboros-a17657c4321dc0770e5431467261eb2bc579f79c.zip
shim-udp: resolve dst_name using DNS
This commits adds the gethostbyname call to resolve the dst_name for a flow allocation using DNS. The DNS server should be specified using the method mandated by the system (e.g. added to /etc/resolv.conf).
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