summaryrefslogtreecommitdiff
path: root/src/ipcpd/shim-udp/CMakeLists.txt
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-16 18:41:48 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-08-16 18:43:47 +0200
commit6c50a54ee1725959b166d6ad5f6ca58204433a8e (patch)
tree6f9a20850e0eec5ca2709ed4ed24f1ccb983cf04 /src/ipcpd/shim-udp/CMakeLists.txt
parent1139fc0aa0869485566c0c3ed0c9f2d2ecf00cb4 (diff)
downloadouroboros-6c50a54ee1725959b166d6ad5f6ca58204433a8e.tar.gz
ouroboros-6c50a54ee1725959b166d6ad5f6ca58204433a8e.zip
ipcpd: shim-udp: Change nsupdate and nslookup check
Previously it was up to the admin to choose whether or not to enable DDNS. Now the build just checks if the executables can be found, and if they are available DDNS functionality is enabled, else it is disabled.
Diffstat (limited to 'src/ipcpd/shim-udp/CMakeLists.txt')
-rw-r--r--src/ipcpd/shim-udp/CMakeLists.txt45
1 files changed, 17 insertions, 28 deletions
diff --git a/src/ipcpd/shim-udp/CMakeLists.txt b/src/ipcpd/shim-udp/CMakeLists.txt
index 71f9e1d1..c63bd29c 100644
--- a/src/ipcpd/shim-udp/CMakeLists.txt
+++ b/src/ipcpd/shim-udp/CMakeLists.txt
@@ -31,32 +31,6 @@ IF(NOT CMAKE_HAVE_GETHOSTBYNAME)
ENDIF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
ENDIF(NOT CMAKE_HAVE_GETHOSTBYNAME)
-# Enable DNS by default
-if (NOT DISABLE_DNS MATCHES True)
- # Find the nsupdate executable
- find_program(NSUPDATE_EXECUTABLE
- NAMES nsupdate
- DOC "The nsupdate tool that enables DDNS")
-
- if (${NSUPDATE_EXECUTABLE} STREQUAL "NSUPDATE_EXECUTABLE-NOTFOUND")
- message(FATAL_ERROR "Could not find nsupdate, which is needed for DDNS")
- else()
- message("-- Found nsupdate: ${NSUPDATE_EXECUTABLE}")
- endif()
-
- # Find the nslookup executable
- find_program(NSLOOKUP_EXECUTABLE
- NAMES nslookup
- DOC "The nslookup tool that resolves DNS names")
-
- if (${NSLOOKUP_EXECUTABLE} STREQUAL "NSLOOKUP_EXECUTABLE-NOTFOUND")
- message(FATAL_ERROR
- "Could not find nslookup, which is needed for DNS resolution")
- else()
- message("-- Found nslookup: ${NSLOOKUP_EXECUTABLE}")
- endif()
-endif()
-
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/shim_udp_config.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/shim_udp_config.h")
@@ -72,8 +46,23 @@ add_executable (ipcpd-shim-udp ${SHIM_UDP_SOURCES} ${IPCP_SOURCES}
target_link_libraries (ipcpd-shim-udp LINK_PUBLIC ouroboros
${PROTOBUF_C_LIBRARY})
-# Enable DNS by default
-if (NOT DISABLE_DNS MATCHES True)
+# Find the nsupdate executable
+find_program(NSUPDATE_EXECUTABLE
+ NAMES nsupdate
+ DOC "The nsupdate tool that enables DDNS")
+
+# Find the nslookup executable
+find_program(NSLOOKUP_EXECUTABLE
+ NAMES nslookup
+ DOC "The nslookup tool that resolves DNS names")
+
+if (${NSUPDATE_EXECUTABLE} STREQUAL "NSUPDATE_EXECUTABLE-NOTFOUND")
+ message("-- Could not find nsupdate. Disabling DDNS functionality.")
+elseif (${NSLOOKUP_EXECUTABLE} STREQUAL "NSLOOKUP_EXECUTABLE-NOTFOUND")
+ message("-- Could not find nslookup. Disabling DNS lookups.")
+else ()
+ message("-- Found nsupdate: ${NSUPDATE_EXECUTABLE}")
+ message("-- Found nslookup: ${NSLOOKUP_EXECUTABLE}")
MACRO_ADD_COMPILE_FLAGS(ipcpd-shim-udp -DCONFIG_OUROBOROS_ENABLE_DNS)
endif()