bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] use libcrypto routines in gnulib


From: Pádraig Brady
Subject: Re: [PATCH] use libcrypto routines in gnulib
Date: Tue, 03 Dec 2013 00:03:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

On 12/02/2013 10:48 PM, Paul Eggert wrote:
> On 12/02/2013 01:05 PM, Pádraig Brady wrote:
>> each project would have
>> to add LIB_CRYPTO_MD5 etc. to their list of libs similarly
>> to the coreutils patch I had inline in my previous mail.
> 
> Thanks for explaining.
> 
> I tried that for Emacs and came up with the patch
> appended to this message.  Unfortunately, it means that Emacs
> is now linked with a command of this form:
> 
>   gcc $(objects) ... -lcrypto -lcrypto -lcrypto -lcrypto ...
> 
> because Emacs calls md5, sha1, sha256 and sha512 and there's a
> separate LIB_CRYPTO_XXX for each algorithm.  This works, but
> it's a bit ugly.  How about adding support for LIB_CRYPTO,
> so that there's only one -lcrypto in the above line?
> LIB_CRYPTO can be the concatenation of tall the LIB_CRYPTO_XXXs with
> duplicates removed.  That would simplify the following patch,
> since I'd need to add just LIB_CRYPTO.  Perhaps we could even
> dispense with the LIB_CRYPTO_XXX macros for now; they shouldn't
> be needed unless we know of an O.S. where they differ from each
> other.
> 
> === modified file 'src/Makefile.in'
> --- src/Makefile.in    2013-11-27 18:25:44 +0000
> +++ src/Makefile.in    2013-12-02 22:26:31 +0000
> @@ -139,6 +139,10 @@
>  
>  address@hidden@
>  address@hidden@
> address@hidden@
> address@hidden@
> address@hidden@
> address@hidden@
>  address@hidden@
>  address@hidden@
>  address@hidden@
> @@ -403,6 +407,8 @@
>  LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
>     $(LIBX_OTHER) $(LIBSOUND) \
>     $(RSVG_LIBS) $(IMAGEMAGICK_LIBS) $(LIB_ACL) $(LIB_CLOCK_GETTIME) \
> +   $(LIB_CRYPTO_MD5) $(LIB_CRYPTO_SHA1) \
> +   $(LIB_CRYPTO_SHA256) $(LIB_CRYPTO_SHA512) \
>     $(LIB_EACCESS) $(LIB_FDATASYNC) $(LIB_TIMER_TIME) $(DBUS_LIBS) \
>     $(LIB_EXECINFO) $(XRANDR_LIBS) $(XINERAMA_LIBS) \
>     $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \

I separated them to give support for picking the best
library for a particular routine.  Separating the libs
now means we could do this transparently in future.
However this probably is a bit over engineered, and
selection on a per library basis is fine.

I've adjusted my gnulib patch to only export a single LIB_CRYPTO,
and that can be transparently mapped to any other crypto libraries
that we might add in future. Adjusted patch is attached.

thanks,
Pádraig.

Attachment: gnulib-libcrypto.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]