/[gentoo-x86]/sys-apps/rng-tools/files/test-for-argp.patch
Gentoo

Contents of /sys-apps/rng-tools/files/test-for-argp.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Thu Jul 19 10:44:13 2012 UTC (10 months ago) by blueness
Branch: MAIN
CVS Tags: HEAD
Patch configure.ac to search for arpg in glibc or libargp, bug #292191

(Portage version: 2.1.10.65/cvs/Linux x86_64)

1 On glibc systems, argp is provided by libc. However, on
2 uclibc and other systems which lack argp in their C library,
3 argp might be provided by a stand alone library, libargp.
4 This patch adds tests to the build system to find who provides
5 argp.
6
7 X-Gentoo-Bug: 292191
8 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=292191
9 Reported-by: Ed Wildgoose <gentoo@wildgooses.com>
10 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
11
12
13 --- configure.ac.orig 2012-05-26 22:45:42.753478198 +0000
14 +++ configure.ac 2012-05-27 00:36:23.175844081 +0000
15 @@ -47,6 +47,28 @@
16 dnl Checks for optional library functions
17 dnl -------------------------------------
18
19 +dnl First check if we have argp available from libc
20 +AC_LINK_IFELSE(
21 + [AC_LANG_PROGRAM(
22 + [#include <argp.h>],
23 + [int argc=1; char *argv[]={"test"}; argp_parse(0,argc,argv,0,0,0); return 0;]
24 + )],
25 + [libc_has_argp="true"],
26 + [libc_has_argp="false"]
27 +)
28 +
29 +dnl If libc doesn't provide argp, then test for libargp
30 +if test "$libc_has_argp" = "false" ; then
31 + AC_MSG_WARN("libc does not have argp")
32 + AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
33 +
34 + if test "$have_argp" = "false"; then
35 + AC_MSG_ERROR("no libargp found")
36 + else
37 + LIBS+=" -largp"
38 + fi
39 +fi
40 +
41 dnl -----------------
42 dnl Configure options
43 dnl -----------------

  ViewVC Help
Powered by ViewVC 1.1.13