From e86b27a2da04a2fd7a800258789c2ab8b9e69139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Tacza=C5=82a?= Date: Tue, 2 Oct 2018 13:06:36 +0200 Subject: [PATCH] Adding support for QNX7.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id01e2880aa5cadc0e93a46b95fe675e1938051fa Signed-off-by: Bartosz TaczaƂa --- client/CMakeLists.txt | 6 ++++++ lib/socks_mosq.c | 3 +++ src/CMakeLists.txt | 17 +++++++++-------- src/conf_includedir.c | 2 +- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index a34198d551..660bf1ac6a 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -11,8 +11,14 @@ endif (${WITH_SRV} STREQUAL ON) add_executable(mosquitto_pub pub_client.c ${shared_src}) add_executable(mosquitto_sub sub_client.c sub_client_output.c ${shared_src}) + target_link_libraries(mosquitto_pub libmosquitto) target_link_libraries(mosquitto_sub libmosquitto) +if (QNX) + target_link_libraries(mosquitto_pub socket) + target_link_libraries(mosquitto_sub socket) +endif() + install(TARGETS mosquitto_pub RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}") install(TARGETS mosquitto_sub RUNTIME DESTINATION "${BINDIR}" LIBRARY DESTINATION "${LIBDIR}") diff --git a/lib/socks_mosq.c b/lib/socks_mosq.c index f8f006a401..ffb895a7c2 100644 --- a/lib/socks_mosq.c +++ b/lib/socks_mosq.c @@ -21,6 +21,9 @@ and the Eclipse Distribution License is available at #include #ifdef WIN32 # include +#elif __QNX__ +# include +# include #else # include #endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dab82a481e..187d0aac6f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,17 +126,18 @@ if (HAVE_GETADDRINFO_A) endif (HAVE_GETADDRINFO_A) - if (UNIX) if (APPLE) set (MOSQ_LIBS ${MOSQ_LIBS} dl m) - else (APPLE) - set (MOSQ_LIBS ${MOSQ_LIBS} dl m) - find_library(LIBRT rt) - if (LIBRT) - set (MOSQ_LIBS ${MOSQ_LIBS} rt) - endif (LIBRT) - endif (APPLE) + elseif(QNX) + set(MOSQ_LIBS ${MOSQ_LIBS} m socket) + else(APPLE) + set (MOSQ_LIBS ${MOSQ_LIBS} dl m) + find_library(LIBRT rt) + if (LIBRT) + set (MOSQ_LIBS ${MOSQ_LIBS} rt) + endif (LIBRT) + endif (APPLE) endif (UNIX) if (WIN32) diff --git a/src/conf_includedir.c b/src/conf_includedir.c index 43da9a1645..783a404863 100644 --- a/src/conf_includedir.c +++ b/src/conf_includedir.c @@ -36,7 +36,7 @@ and the Eclipse Distribution License is available at # include #endif -#if !defined(WIN32) && !defined(__CYGWIN__) +#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__QNX__) # include #endif