cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] Explicitly link to the nettle/gcrypt libraries

From: Dave Reisner <d_at_falconindy.com>
Date: Thu, 26 Jan 2012 19:02:32 -0500

On Fri, Jan 27, 2012 at 01:50:35AM +0200, Martin Storsjo wrote:
> When support for nettle was added in 64f328c787ab, I overlooked
> the fact that AC_CHECK_LIB doesn't add the tested lib to LIBS
> if the check succeeded, if a custom success code block was present.
> (The previous version of the check had an empty block for
> successful checks, adding the lib to LIBS implicitly.)
>
> Therefore, explicitly add either nettle or gcrypt to LIBS, after
> deciding which one to use. Even if they can be linked in
> transitively, it is safer to actually link explicitly to them.
>
> This fixes building with gnutls with linkers that don't allow
> linking transitively, such as for windows.

Note that binutils as of 2.22 disables transitive linking by default, so
this is good futureproofing for linux as well.

> ---
> Sorry for not noticing this earlier...
>
> configure.ac | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index cc7f888..8920280 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1824,6 +1824,9 @@ if test "$GNUTLS_ENABLED" = "1"; then
> if test "$USE_GNUTLS_NETTLE" = "1"; then
> AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
> AC_SUBST(USE_GNUTLS_NETTLE, [1])
> + LIBS="$LIBS -lnettle"
> + else
> + LIBS="$LIBS -lgcrypt"
> fi
> fi
>
> --
> 1.7.2.5
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-01-27