From dceb02f444fa3bcdb5efdd0bcd1896b0b196b1f3 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sat, 8 Sep 2018 10:24:12 +0100 Subject: [PATCH] Make it easier to build without bundled uthash.h. Use "make WITH_BUNDLED_DEPS=no". --- ChangeLog.txt | 3 +++ config.mk | 6 ++++++ src/CMakeLists.txt | 5 +++++ src/{ => deps}/uthash.h | 0 4 files changed, 14 insertions(+) rename src/{ => deps}/uthash.h (100%) diff --git a/ChangeLog.txt b/ChangeLog.txt index f0095a57..15ea64bc 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,6 +5,9 @@ Broker: - Fix build when using WITH_ADNS=yes. - Fix incorrect call to setsockopt() for TCP_NODELAY. Closes #941. +Build: +- Make it easier to build with bundled uthash.h using "WITH_BUNDLED_DEPS=no". + 1.5.1 - 20180816 ================ diff --git a/config.mk b/config.mk index fd3a4a81..113ed6a3 100644 --- a/config.mk +++ b/config.mk @@ -92,6 +92,9 @@ WITH_STATIC_LIBRARIES:=no # Build with epoll support. WITH_EPOLL:=yes +# Build with bundled uthash.h +WITH_BUNDLED_DEPS:=yes + # ============================================================================= # End of user configuration # ============================================================================= @@ -287,3 +290,6 @@ ifeq ($(WITH_EPOLL),yes) endif endif +ifeq ($(WITH_BUNDLED_DEPS),yes) + BROKER_CFLAGS:=$(BROKER_CFLAGS) -Ideps +endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 017c21b2..dab82a48 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -51,6 +51,11 @@ set (MOSQ_SRCS ../lib/will_mosq.c ../lib/will_mosq.h) +option(WITH_BUNDLED_DEPS "Build with bundled dependencies?" ON) +if (${WITH_BUNDLED_DEPS} STREQUAL ON) + include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/src/deps) +endif (${WITH_BUNDLED_DEPS} STREQUAL ON) + option(INC_BRIDGE_SUPPORT "Include bridge support for connecting to other brokers?" ON) if (${INC_BRIDGE_SUPPORT} STREQUAL ON) diff --git a/src/uthash.h b/src/deps/uthash.h similarity index 100% rename from src/uthash.h rename to src/deps/uthash.h