]> code.ossystems Code Review - openembedded-core.git/commitdiff
net-tools: Link with libintl on uclibc
authorKhem Raj <raj.khem@gmail.com>
Tue, 29 Dec 2015 01:22:42 +0000 (01:22 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 22 Jan 2016 23:42:47 +0000 (23:42 +0000)
libintl is needed explicitly on linker cmdline on uclibc since the APIs
are not in libc itelf.

Fix build on musl

Signed-off-by: Khem Raj <raj.khem@gmail.com>
meta/recipes-extended/net-tools/net-tools/musl-fixes.patch [new file with mode: 0644]
meta/recipes-extended/net-tools/net-tools_1.60-26.bb

diff --git a/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch b/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch
new file mode 100644 (file)
index 0000000..f694d59
--- /dev/null
@@ -0,0 +1,100 @@
+Adjust headers for non-glibc cases
+especially exposed by musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: net-tools-1.60/lib/inet6_gr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet6_gr.c
++++ net-tools-1.60/lib/inet6_gr.c
+@@ -23,7 +23,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifndef __GLIBC__
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h>      /* glibc doesn't have this */
+ #endif
+ #include "version.h"
+Index: net-tools-1.60/lib/inet6_sr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet6_sr.c
++++ net-tools-1.60/lib/inet6_sr.c
+@@ -23,10 +23,10 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#ifdef __GLIBC__
+-#include <net/route.h>
+-#else
++#ifdef HAVE_IPV6_ROUTE_H
+ #include <netinet6/ipv6_route.h>      /* glibc does not have this */
++#else
++#include <net/route.h>
+ #endif
+ #include "version.h"
+ #include "net-support.h"
+Index: net-tools-1.60/lib/inet_sr.c
+===================================================================
+--- net-tools-1.60.orig/lib/inet_sr.c
++++ net-tools-1.60/lib/inet_sr.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ #include <unistd.h>
++#include <asm-generic/param.h>
+ #include "version.h"
+ #include "net-support.h"
+ #include "pathnames.h"
+Index: net-tools-1.60/lib/util-ank.c
+===================================================================
+--- net-tools-1.60.orig/lib/util-ank.c
++++ net-tools-1.60/lib/util-ank.c
+@@ -14,6 +14,7 @@
+  * Rani Assaf <rani@magic.metawire.com> 980929:       resolve addresses
+  */
++#include <limits.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+Index: net-tools-1.60/mii-tool.c
+===================================================================
+--- net-tools-1.60.orig/mii-tool.c
++++ net-tools-1.60/mii-tool.c
+@@ -47,10 +47,6 @@ static char Version[] = "$Id: mii-tool.c
+ #include <net/if.h>
+ #include <linux/sockios.h>
+-#ifndef __GLIBC__
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ #include "mii.h"
+ #include "version.h"
+Index: net-tools-1.60/netstat.c
+===================================================================
+--- net-tools-1.60.orig/netstat.c
++++ net-tools-1.60/netstat.c
+@@ -87,6 +87,7 @@
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <asm-generic/param.h>
+ #include "net-support.h"
+ #include "pathnames.h"
+Index: net-tools-1.60/slattach.c
+===================================================================
+--- net-tools-1.60.orig/slattach.c
++++ net-tools-1.60/slattach.c
+@@ -44,6 +44,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <getopt.h>
++#include <termios.h>
+ #include <linux/if_slip.h>
+ #if defined(__GLIBC__)
index 632aee75903e6b636f404ea2225160c9bd1acfdc..14b8e494bf31de22f966dfa829156e109cc2b3a6 100644 (file)
@@ -11,6 +11,7 @@ SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/
            file://net-tools-config.h \
            file://net-tools-config.make \
            file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \
+           file://musl-fixes.patch \
           "
 
 # for this package we're mostly interested in tracking debian patches,
@@ -32,6 +33,9 @@ UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/"
 inherit gettext
 
 do_patch[depends] = "quilt-native:do_populate_sysroot"
+
+LDFLAGS_append_libc-uclibc = " -lintl "
+
 # The Makefile is lame, no parallel build
 PARALLEL_MAKE = ""