Skip to content

Commit df99500

Browse files
ffontainetridge
authored andcommitted
configure.ac: use pkg-config to retrieve openssl dependencies
Use pkg-config to retrieve openssl dependencies such as -latomic and avoids the following build failure when building statically on architectures such as sparc: /home/autobuild/autobuild/instance-1/output-1/host/lib/gcc/sparc-buildroot-linux-uclibc/10.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/autobuild/autobuild/instance-1/output-1/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib/libcrypto.a(threads_pthread.o): in function `CRYPTO_atomic_add': threads_pthread.c:(.text+0x208): undefined reference to `__atomic_is_lock_free' Fixes: - http://autobuild.buildroot.org/results/49abbaa1eab94b248bff434b40728065d687e278 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
1 parent 1c5ebdc commit df99500

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

configure.ac

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,11 +452,15 @@ AH_TEMPLATE([USE_OPENSSL],
452452
if test x"$enable_openssl" != x"no"; then
453453
if test x"$ac_cv_header_openssl_md4_h" = x"yes" && test x"$ac_cv_header_openssl_md5_h" = x"yes"; then
454454
AC_MSG_RESULT(yes)
455-
AC_SEARCH_LIBS(EVP_MD_CTX_copy, crypto,
455+
PKG_CHECK_MODULES(LIBCRYPTO, libcrypto,
456456
[AC_DEFINE(USE_OPENSSL)
457-
enable_openssl=yes],
458-
[err_msg="$err_msg$nl- Failed to find EVP_MD_CTX_copy function in openssl crypto lib.";
459-
no_lib="$no_lib openssl"])
457+
enable_openssl=yes
458+
LIBS="$LIBS $LIBCRYPTO_LIBS"],
459+
[AC_SEARCH_LIBS(EVP_MD_CTX_copy, crypto,
460+
[AC_DEFINE(USE_OPENSSL)
461+
enable_openssl=yes],
462+
[err_msg="$err_msg$nl- Failed to find EVP_MD_CTX_copy function in openssl crypto lib.";
463+
no_lib="$no_lib openssl"])])
460464
else
461465
AC_MSG_RESULT(no)
462466
err_msg="$err_msg$nl- Failed to find openssl/md4.h and openssl/md5.h for openssl crypto lib support."

0 commit comments

Comments
 (0)