summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2016-02-15 20:07:26 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-16 11:15:44 +0000
commit94ecc846f9b33fcec039936643c49728eedfefb7 (patch)
treec4348acf7d3f2d2f6067ccedaa35fde3dc6d71ee /meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
parente3d879c5c222bc27b2e78cdb097aab9820f2c68b (diff)
downloadopenembedded-core-contrib-94ecc846f9b33fcec039936643c49728eedfefb7.tar.gz
rng-tools: fix the build with musl
musl doesn't provide argp, so we need argp-standalone, as we do for uclibc. Rather than passing in -largp via the recipe, patch the configure script to provide an argument for the libargp usage and check for it when needed, and use PACKAGECONFIG. The initial patch to check for libargp and use it if available came from Gentoo. The patches are kept separate despite the second modifying what the first does, in order to keep the history/origin clear. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch')
-rw-r--r--meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch b/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
new file mode 100644
index 0000000000..4bd9d31c0e
--- /dev/null
+++ b/meta/recipes-support/rng-tools/rng-tools/0001-If-the-libc-is-lacking-argp-use-libargp.patch
@@ -0,0 +1,60 @@
+From 99679fda405e535a282f04a4decc2381154a749f Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Mon, 15 Feb 2016 15:59:58 -0700
+Subject: [PATCH 1/2] If the libc is lacking argp, use libargp
+
+Patch pulled from Gentoo:
+
+ On glibc systems, argp is provided by libc. However, on
+ uclibc and other systems which lack argp in their C library,
+ argp might be provided by a stand alone library, libargp.
+ This patch adds tests to the build system to find who provides
+ argp.
+
+ X-Gentoo-Bug: 292191
+ X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=292191
+ Reported-by: Ed Wildgoose <gentoo@wildgooses.com>
+ Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
+
+Upstream-Status: Pending
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+---
+ configure.ac | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 27a2dba..04fcd25 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -82,6 +82,28 @@ AS_IF(
+ ]
+ )
+
++dnl First check if we have argp available from libc
++AC_LINK_IFELSE(
++ [AC_LANG_PROGRAM(
++ [#include <argp.h>],
++ [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;]
++ )],
++ [libc_has_argp="true"],
++ [libc_has_argp="false"]
++)
++
++dnl If libc doesn't provide argp, then test for libargp
++if test "$libc_has_argp" = "false" ; then
++ AC_MSG_WARN("libc does not have argp")
++ AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
++
++ if test "$have_argp" = "false"; then
++ AC_MSG_ERROR("no libargp found")
++ else
++ LIBS+=" -largp"
++ fi
++fi
++
+ dnl -----------------
+ dnl Configure options
+ dnl -----------------
+--
+2.2.1
+