]> git.ipfire.org Git - thirdparty/coreutils.git/commit
sort: dynamically link -lcrypto if -R
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 26 Feb 2024 01:13:12 +0000 (17:13 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 26 Feb 2024 02:55:16 +0000 (18:55 -0800)
commit7f57ac2d20c144242953a8dc7d95b02df0244751
tree35dc709ac33c87ad08f345a5b2e33ef2ce30a9cd
parent9b6c25510bdb54b4f7f9abbfaf6d136c65202d99
sort: dynamically link -lcrypto if -R

This saves time in the usual case, which does not need -lcrypto.
* configure.ac (DLOPEN_LIBCRYPTO): New macro.
* src/sort.c [DLOPEN_LIBCRYPTO && HAVE_OPENSSL_MD5]: New macros
MD5_Init, MD5_Update, MD5_Final.  Include "md5.h" after defining
them.  Include <dlfcn.h>, and define new functions link_failure
and symbol_address.
(link_libcrypto): New function.
(random_md5_state_init): Call it before using crypto functions.
configure.ac
src/sort.c