public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile (blueness)" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/rng-tools/files: test-for-argp.patch
Date: Thu, 19 Jul 2012 10:44:14 +0000 (UTC)	[thread overview]
Message-ID: <20120719104414.18CE020065@flycatcher.gentoo.org> (raw)

blueness    12/07/19 10:44:14

  Added:                test-for-argp.patch
  Log:
  Patch configure.ac to search for arpg in glibc or libargp, bug #292191
  
  (Portage version: 2.1.10.65/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  sys-apps/rng-tools/files/test-for-argp.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/rng-tools/files/test-for-argp.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/rng-tools/files/test-for-argp.patch?rev=1.1&content-type=text/plain

Index: test-for-argp.patch
===================================================================
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>


--- configure.ac.orig	2012-05-26 22:45:42.753478198 +0000
+++ configure.ac	2012-05-27 00:36:23.175844081 +0000
@@ -47,6 +47,28 @@
 dnl Checks for optional library functions
 dnl -------------------------------------
 
+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 -----------------






                 reply	other threads:[~2012-07-19 10:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120719104414.18CE020065@flycatcher.gentoo.org \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox