Fixes for building on NetBSD.

Closes #258.

Thanks to Daniel Ölschlegel.
This commit is contained in:
Roger A. Light 2018-08-09 15:21:40 +01:00
parent c757cb0912
commit 10b19a42ed
6 changed files with 12 additions and 13 deletions

View File

@ -30,6 +30,9 @@ Library:
- Fix connection problems when mosquitto_loop_start() was called before
mosquitto_connect_async(). Closes #848.
Build:
- Fixes for building on NetBSD. Closes #258.
1.5 - 20180502
==============

View File

@ -34,4 +34,8 @@
# define _POSIX_C_SOURCE 200809L
#endif
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__SYMBIAN32__) || defined(__QNX__)
# define HAVE_NETINET_IN_H
#endif
#endif

View File

@ -130,7 +130,7 @@ LIB_LDFLAGS:=${LDFLAGS}
BROKER_CFLAGS:=${LIB_CFLAGS} ${CPPFLAGS} -DVERSION="\"${VERSION}\"" -DWITH_BROKER
CLIENT_CFLAGS:=${CFLAGS} ${CPPFLAGS} -I../lib -DVERSION="\"${VERSION}\""
ifneq ($(or $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD)),)
ifneq ($(or $(findstring $(UNAME),FreeBSD), $(findstring $(UNAME),OpenBSD), $(findstring $(UNAME),NetBSD)),)
BROKER_LIBS:=-lm
else
BROKER_LIBS:=-ldl -lm
@ -277,7 +277,7 @@ localedir=${prefix}/share/locale
STRIP?=strip
ifeq ($(WITH_STRIP),yes)
STRIP_OPTS:=-s --strip-program=${CROSS_COMPILE}${STRIP}
STRIP_OPTS?=-s --strip-program=${CROSS_COMPILE}${STRIP}
endif
ifeq ($(WITH_EPOLL),yes)

View File

@ -20,7 +20,7 @@ Contributors:
#include <stdio.h>
#include <sys/types.h>
#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER) && !defined(WIN32) && !defined(__SYMBIAN32__) && !defined(__ANDROID__) && !defined(__UCLIBC__) && !defined(__OpenBSD__)
#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER) && defined(__GLIBC__)
#define REAL_WITH_MEMORY_TRACKING
#endif

View File

@ -37,17 +37,12 @@ Contributors:
#include <sys/endian.h>
#endif
#ifdef __FreeBSD__
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef __SYMBIAN32__
#include <netinet/in.h>
#endif
#ifdef __QNX__
#include <net/netbyte.h>
#include <netinet/in.h>
#endif
#ifdef WITH_TLS

View File

@ -36,15 +36,12 @@ Contributors:
#include <tcpd.h>
#endif
#ifdef __FreeBSD__
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
# include <sys/socket.h>
#endif
#ifdef __QNX__
#include <netinet/in.h>
#include <net/netbyte.h>
#include <sys/socket.h>
#endif
#include "mosquitto_broker_internal.h"