diff --git a/CMakeLists.txt b/CMakeLists.txt index d69b452e..8508c3ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,20 +49,6 @@ include(CTest) include(GNUInstallDirs) include(TestBigEndian) -# Directories -if (DEFINED CMAKE_INSTALL_FULL_RUNSTATEDIR) - set(RUNSTATEDIR "${CMAKE_INSTALL_FULL_RUNSTATEDIR}") -else () - set(RUNSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run") -endif () -install(DIRECTORY - DESTINATION ${RUNSTATEDIR} - DIRECTORY_PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE - ) - # Target Platform if (WIN32 OR MINGW OR MSYS OR CYGWIN) set(HOSTOS "windows") @@ -117,6 +103,8 @@ option(ENABLE_NATIVE_STUB_DNSSEC "Enable/disable native stub DNSSEC support." ON option(ENABLE_STUB_ONLY "Restricts resolution modes to STUB." ON) option(ENABLE_UNBOUND_EVENT_API "Enable usage of libunbound's event API." ON) +option(BUILD_STUBBY "Compile and install stubby, the (stub) resolver daemon." OFF) + # Above names chosen for user consistency. Now define substituted names. set(REQ_DEBUG ${ENABLE_DEBUG_REQ}) set(SCHED_DEBUG ${ENABLE_DEBUG_SCHED}) @@ -174,17 +162,6 @@ set(MAXIMUM_UPSTREAM_OPTION_SPACE 3000) # Values derived from options. set(GETDNS_COMPILATION_COMMENT "${PACKAGE_NAME} ${GETDNS_VERSION} configured on ${CURRENT_DATE} for the ${API_VERSION} version of the API") -# Does the compiler accept the "format" attribute? -try_compile(HAVE_ATTR_FORMAT - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test_format_attr.c - ) -# Does the compiler accept the "unused" attribute? -try_compile(HAVE_ATTR_UNUSED - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tests/test_unused_attr.c - ) - # Compiler flags if (MSVC) # The Visual Studio C compiler is C90 with some of C99 and C11. @@ -760,3 +737,7 @@ install(CODE "message(\"\ *** on the default location when there is no active external\n\ *** trust anchor management keeping it up-to-date.\n\ ***\")") + +if (BUILD_STUBBY) + add_subdirectory(stubby) +endif () diff --git a/cmake/tests/test_format_attr.c b/cmake/tests/test_format_attr.c deleted file mode 100644 index 591690f6..00000000 --- a/cmake/tests/test_format_attr.c +++ /dev/null @@ -1,13 +0,0 @@ -#include - -void f(char *format, ...) __attribute__ ((format (printf, 1, 2))); - -void f(char *format, ...) -{ -} - -int main (int ac, char *av[]) -{ - f("%s", "str"); - return 0; -} diff --git a/cmake/tests/test_unused_attr.c b/cmake/tests/test_unused_attr.c deleted file mode 100644 index 5b729724..00000000 --- a/cmake/tests/test_unused_attr.c +++ /dev/null @@ -1,13 +0,0 @@ -#include - -void f (char *u __attribute__((unused))); - -void f(char *u) -{ -} - -int main (int ac, char *av[]) -{ - f("str"); - return 0; -} diff --git a/stubby b/stubby index b0d3154a..42a37b01 160000 --- a/stubby +++ b/stubby @@ -1 +1 @@ -Subproject commit b0d3154af61e1b46a30b56d239dc074273642217 +Subproject commit 42a37b0125b5a4d0985c86608a62d76e804c10ca