CMake libunbound fixups.

1. ub_ctx_set_stub is in unbound.h, not unbound-events.h.
2. Only bother looking for unbound event API if enabled.
3. If building stub only, ensure all libunbound items are off. This is necessary in case we first configure without stub only, and then change to stub only.

Fixes #463
This commit is contained in:
Jim Hague 2020-03-04 09:45:52 +00:00
parent 822d8ad703
commit f01e7188c8
1 changed files with 13 additions and 3 deletions

View File

@ -489,9 +489,19 @@ if (NOT ENABLE_STUB_ONLY)
set(CMAKE_REQUIRED_INCLUDES ${LIBUNBOUND_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${LIBUNBOUND_LIBRARIES})
check_include_file(unbound-event.h HAVE_UNBOUND_EVENT_H)
check_symbol_exists(ub_ctx_create_ub_event "unbound-event.h" HAVE_UNBOUND_EVENT_API)
check_symbol_exists(ub_ctx_set_stub "unbound-event.h" HAVE_UB_CTX_SET_STUB)
check_symbol_exists(ub_ctx_set_stub "unbound.h" HAVE_UB_CTX_SET_STUB)
if (ENABLE_UNBOUND_EVENT_API)
check_include_file(unbound-event.h HAVE_UNBOUND_EVENT_H)
check_symbol_exists(ub_ctx_create_ub_event "unbound-event.h" HAVE_UNBOUND_EVENT_API)
endif ()
else ()
# Ensure we're not using libunbound items.
set(HAVE_LIBUNBOUND 0)
set(HAVE_UNBOUND_EVENT_H 0)
set(HAVE_UNBOUND_EVENT_API 0)
set(HAVE_UB_CTX_SET_STUB 0)
endif ()
# Event loop extension