Browse Source

- add libnl

master
vanhofen 2 years ago
parent
commit
081ff470ab
  1. 17
      package/libnl/libnl.mk
  2. 30
      package/libnl/patches/0001-build-add-Libs.private-field-in-libnl-pkg-config-fil.patch
  3. 37
      package/libnl/patches/0002-Add-musl-workaround-to-the-libc-compat.h-copy.patch

17
package/libnl/libnl.mk

@ -0,0 +1,17 @@
################################################################################
#
# libnl
#
################################################################################
LIBNL_VERSION = 3.5.0
LIBNL_DIR = libnl-$(LIBNL_VERSION)
LIBNL_SOURCE = libnl-$(LIBNL_VERSION).tar.gz
LIBNL_SITE = https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(LIBNL_VERSION))
LIBNL_CONF_OPTS = \
--disable-cli \
--disable-unit-tests
libnl: | $(TARGET_DIR)
$(call autotools-package)

30
package/libnl/patches/0001-build-add-Libs.private-field-in-libnl-pkg-config-fil.patch

@ -0,0 +1,30 @@
From db0d59cd06f3ffd350379847c0885e1bfb85af0f Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Sat, 7 Mar 2015 11:34:42 +0100
Subject: [PATCH] build: add Libs.private field in libnl pkg-config file
In order to support static linking, the libnl pkg-config file should
indicate in its Libs.private field the libraries that libnl-3.0.a
requires. The LIBS variable contains the appropriate list of
libraries: -lm in all cases, and -lpthread when pthread support is
enabled. This allows to statically link applications against libnl
properly.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
libnl-3.0.pc.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/libnl-3.0.pc.in b/libnl-3.0.pc.in
index b87e3dc..ddbc999 100644
--- a/libnl-3.0.pc.in
+++ b/libnl-3.0.pc.in
@@ -7,4 +7,5 @@ Name: libnl
Description: Convenience library for netlink sockets
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lnl-@MAJ_VERSION@
+Libs.private: @LIBS@
Cflags: -I${includedir}/libnl@MAJ_VERSION@
--
2.1.0

37
package/libnl/patches/0002-Add-musl-workaround-to-the-libc-compat.h-copy.patch

@ -0,0 +1,37 @@
From be07fdbc9658de19304defa7538f219cd3f21ec0 Mon Sep 17 00:00:00 2001
From: Baruch Siach <baruch@tkos.co.il>
Date: Sun, 12 Mar 2017 08:52:20 +0200
Subject: [PATCH] Add musl workaround to the libc-compat.h copy
The libc-compat.h kernel header uses glibc specific macros to solve conflicts
with libc provided headers. This patch makes libc-compat.h work also for musl
libc.
Future rebase note: when upstream updates libc-compat.h some additional macro
definitions will be needed. See the Buildroot iproute2 patch
package/iproute2/0001-Add-the-musl-workaround-to-the-libc-compat.h-copy.patch.
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
Upstream status: libc-compat.h is a local copy of a kernel headers. A proper
musl fix must go to the kernel first.
---
include/linux-private/linux/libc-compat.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux-private/linux/libc-compat.h b/include/linux-private/linux/libc-compat.h
index 9bed5b6ae4d9..e2562a819464 100644
--- a/include/linux-private/linux/libc-compat.h
+++ b/include/linux-private/linux/libc-compat.h
@@ -49,7 +49,7 @@
#define _LIBC_COMPAT_H
/* We have included glibc headers... */
-#if defined(__GLIBC__)
+#if 1
/* Coordinate with glibc netinet/in.h header. */
#if defined(_NETINET_IN_H)
--
2.11.0
Loading…
Cancel
Save