[FFmpeg-devel] [PATCH] tools: add benchmark for hash functions.

James Almer jamrial at gmail.com
Fri May 17 23:20:33 CEST 2013

On 17/05/13 12:44 PM, Nicolas George wrote:
> diff --git a/libavutil/Makefile b/libavutil/Makefile
> index 5dc61e1..89d70b9 100644
> --- a/libavutil/Makefile
> +++ b/libavutil/Makefile
> @@ -152,6 +152,8 @@ TESTPROGS = adler32                                                     \
> -TOOLS = ffhash ffeval ffescape
> +TOOLS = ffhash ffeval ffescape hash_bench
> +
> +tools/hash_bench: ELIBS = -lcrypto

TOOLS-$(CONFIG_OPENSSL) = hash_bench

Even though it's possible to build this if you have openssl disabled in ffmpeg as 
long as the former is installed, on systems where it's not compilation will fail.

A possible way to deal with that is to make a configure check for openssl headers 
just for this tool, and separate from the optional checks.
Something like

check_header openssl/ssl.h

And then TOOLS-$(HAVE_OPENSSL_SSL_H) = hash_bench
Which would let people with openssl build this tool without having to enable the 
library on ffmpeg, and at the same time prevent breaking make alltools for those 
without it.

For that matter, if libcrypto is not guaranteed to be available on every openssl 
installation, then i guess the only safe solution would be to build this tool only 
when ffmpeg is configured with openssl support, and removing the ELIBS line.
I say this because the current configure checks seem to consider a case where 
libcrypto is not present.


More information about the ffmpeg-devel mailing list