From patchwork Thu Apr 9 10:45:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 5383 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by open-mesh.net (8.14.3/8.13.4/Debian-3sarge3) with SMTP id n39Au7dr003203 for ; Thu, 9 Apr 2009 10:56:08 GMT Received: (qmail invoked by alias); 09 Apr 2009 10:46:01 -0000 Received: from i59F6B6CB.versanet.de (EHLO localhost) [89.246.182.203] by mail.gmx.net (mp059) with SMTP; 09 Apr 2009 12:46:01 +0200 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX1/FPd5JnK3FxfrR6AlvQLv6hbgFKWlZQdWflDgN+h DvWsfrdyLSGhFa From: Sven Eckelmann To: b.a.t.m.a.n@open-mesh.net Date: Thu, 9 Apr 2009 12:45:59 +0200 Message-Id: <1239273959-7911-1-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.6.2.2 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53 Subject: [B.A.T.M.A.N.] [PATCH] Add compilation support for GNU/kFreeBSD X-BeenThere: b.a.t.m.a.n@open-mesh.net X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2009 10:56:08 -0000 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 --- batman/Makefile | 5 +++++ batman/bsd/tun.c | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/batman/Makefile b/batman/Makefile index 509217d..0f6e61f 100644 --- a/batman/Makefile +++ b/batman/Makefile @@ -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 diff --git a/batman/bsd/tun.c b/batman/bsd/tun.c index 2629bcd..2c571c0 100644 --- a/batman/bsd/tun.c +++ b/batman/bsd/tun.c @@ -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;