From 00121e98309de93f6c510b61b91938931e64efed Mon Sep 17 00:00:00 2001 From: Stefan Hertenberger Date: Sat, 3 Sep 2016 09:34:15 +0200 Subject: [PATCH] add NetBSD support --- miniupnpc/Makefile | 9 ++++++++- miniupnpc/minissdpc.c | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile index 99a6930..b7826ca 100644 --- a/miniupnpc/Makefile +++ b/miniupnpc/Makefile @@ -38,6 +38,9 @@ CFLAGS += -DMINIUPNPC_SET_SOCKET_TIMEOUT CFLAGS += -DMINIUPNPC_GET_SRC_ADDR CFLAGS += -D_BSD_SOURCE CFLAGS += -D_DEFAULT_SOURCE +ifeq ($(OS), NetBSD) +CFLAGS += -D_NETBSD_SOURCE +endif ifneq ($(OS), FreeBSD) ifneq ($(OS), Darwin) #CFLAGS += -D_POSIX_C_SOURCE=200112L @@ -136,7 +139,11 @@ endif LIBDIR ?= lib # install directories -INSTALLPREFIX ?= $(PREFIX)/usr +ifeq ($(strip $(PREFIX)),) +INSTALLPREFIX ?= /usr +else +INSTALLPREFIX ?= $(PREFIX) +endif INSTALLDIRINC = $(INSTALLPREFIX)/include/miniupnpc INSTALLDIRLIB = $(INSTALLPREFIX)/$(LIBDIR) INSTALLDIRBIN = $(INSTALLPREFIX)/bin diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c index a6380df..dc4f947 100644 --- a/miniupnpc/minissdpc.c +++ b/miniupnpc/minissdpc.c @@ -11,6 +11,9 @@ #include #include #include +#if defined (__NetBSD__) +#include +#endif #if defined(_WIN32) || defined(__amigaos__) || defined(__amigaos4__) #ifdef _WIN32 #include