Skip to content

Commit

Permalink
Adding support for QNX7.0.0
Browse files Browse the repository at this point in the history
Change-Id: Id01e2880aa5cadc0e93a46b95fe675e1938051fa
Signed-off-by: Bartosz Taczała <[email protected]>
  • Loading branch information
Bartosz Taczała authored and ralight committed Nov 6, 2018
1 parent eff8fab commit e86b27a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
3 changes: 3 additions & 0 deletions lib/socks_mosq.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ and the Eclipse Distribution License is available at
#include <limits.h>
#ifdef WIN32
# include <ws2tcpip.h>
#elif __QNX__
# include <sys/socket.h>
# include <netinet/in.h>
#else
# include <arpa/inet.h>
#endif
Expand Down
17 changes: 9 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/conf_includedir.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ and the Eclipse Distribution License is available at
# include <ws2tcpip.h>
#endif

#if !defined(WIN32) && !defined(__CYGWIN__)
#if !defined(WIN32) && !defined(__CYGWIN__) && !defined(__QNX__)
# include <sys/syslog.h>
#endif

Expand Down

0 comments on commit e86b27a

Please sign in to comment.