diff mbox series

[1/1] iproute2: fix compilation failure when using libintl-full

Message ID HK0PR01MB275498D9DFD98EEF26077A1EAD609@HK0PR01MB2754.apcprd01.prod.exchangelabs.com
State Not Applicable
Delegated to: Petr Štetiar
Headers show
Series iproute2: fix compilation failure when using libintl-full | expand

Commit Message

Ian Cooper March 27, 2021, 12:11 p.m. UTC
Version 5.11.0 introduces a new check for libbpf. This check fails
during link with an undefined reference to `libintl_dgettext'. Patch
the Makefile and configure script to handle the case where libintl
is used.

Signed-off-by: Ian Cooper <iancooper@hotmail.com>
---
 package/network/utils/iproute2/Makefile             |  3 ++-
 .../utils/iproute2/patches/400-intl-full.patch      | 13 +++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)
 create mode 100644 package/network/utils/iproute2/patches/400-intl-full.patch
diff mbox series

Patch

diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index b1a137c18f..456d5aab57 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -47,7 +47,7 @@  $(call Package/iproute2/Default)
   VARIANT:=ipfull
   PROVIDES:=ip
   ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
-  DEPENDS:=+libnl-tiny +libbpf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
+  DEPENDS:=+libnl-tiny +libbpf +(PACKAGE_devlink||PACKAGE_rdma):libmnl $(INTL_DEPENDS)
 endef
 
 define Package/tc-tiny
@@ -157,6 +157,7 @@  MAKE_FLAGS += \
 	HAVE_ELF=$(HAVE_ELF) \
 	HAVE_MNL=$(HAVE_MNL) \
 	HAVE_CAP=$(HAVE_CAP) \
+	INTL="$(if $(INTL_FULL),$(INTL_LDFLAGS) -lintl)" \
 	IPT_LIB_DIR=/usr/lib/iptables \
 	XT_LIB_DIR=/usr/lib/iptables \
 	FPIC="$(FPIC)" \
diff --git a/package/network/utils/iproute2/patches/400-intl-full.patch b/package/network/utils/iproute2/patches/400-intl-full.patch
new file mode 100644
index 0000000000..fe88aeed38
--- /dev/null
+++ b/package/network/utils/iproute2/patches/400-intl-full.patch
@@ -0,0 +1,13 @@ 
+Index: iproute2-5.11.0/configure
+===================================================================
+--- iproute2-5.11.0.orig/configure
++++ iproute2-5.11.0/configure
+@@ -259,7 +259,7 @@ int main(int argc, char **argv) {
+ }
+ EOF
+
+-    $CC -o $TMPDIR/libbpf_test $TMPDIR/libbpf_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS >/dev/null 2>&1
++    $CC -o $TMPDIR/libbpf_test $TMPDIR/libbpf_test.c $LIBBPF_CFLAGS $LIBBPF_LDLIBS $INTL >/dev/null 2>&1
+     local ret=$?
+
+     rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test