Add compilation support for GNU/kFreeBSD
Commit Message
Debian recently announced that it added GNU/kFreeBSD as supported
distribution. It consists of an FreeBSD kernel and the usual debian
userspace tools and libraries. It uses the glibc with some extra
(free)bsd libraries to support bsd-only functions like devname and
strlcpy.
batmand should instantly work on this platform if a BSD developer would
port the bsd compatibility layer again to (Open|Free)BSD.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
batman/Makefile | 5 +++++
batman/bsd/tun.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
@@ -44,6 +44,11 @@ ifeq ($(UNAME),Darwin)
OS_C= $(BSD_C) $(POSIX_C)
endif
+ifeq ($(UNAME),GNU/kFreeBSD)
+OS_C= $(BSD_C) $(POSIX_C)
+LDFLAGS+= -lfreebsd -lbsd
+endif
+
ifeq ($(UNAME),FreeBSD)
OS_C= $(BSD_C) $(POSIX_C)
endif
@@ -71,7 +71,7 @@ static int open_tun_any(char *dev_name, size_t dev_name_size)
}
return -1;
}
-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
static int open_tun_any(char *dev_name, size_t dev_name_size)
{
int fd;