Skip to content

Commit 2b4cf41

Browse files
committed
Use pkg-config always when possible, with failover to manual checks for libcrypto
1 parent 7b2fc1c commit 2b4cf41

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

build-aux/m4/bitcoin_secp.m4

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ AC_MSG_RESULT([$has_64bit_asm])
1616

1717
dnl
1818
AC_DEFUN([SECP_OPENSSL_CHECK],[
19-
if test x"$use_pkgconfig" = x"yes"; then
20-
: #NOP
19+
has_libcrypto=no
2120
m4_ifdef([PKG_CHECK_MODULES],[
2221
PKG_CHECK_MODULES([CRYPTO], [libcrypto], [has_libcrypto=yes],[has_libcrypto=no])
2322
if test x"$has_libcrypto" = x"yes"; then
@@ -27,11 +26,16 @@ if test x"$use_pkgconfig" = x"yes"; then
2726
LIBS="$TEMP_LIBS"
2827
fi
2928
])
30-
else
31-
AC_CHECK_HEADER(openssl/crypto.h,[AC_CHECK_LIB(crypto, main,[has_libcrypto=yes; CRYPTO_LIBS=-lcrypto; AC_DEFINE(HAVE_LIBCRYPTO,1,[Define this symbol if libcrypto is installed])]
32-
)])
33-
LIBS=
34-
fi
29+
if test x$has_libcrypto = xno; then
30+
AC_CHECK_HEADER(openssl/crypto.h,[
31+
AC_CHECK_LIB(crypto, main,[
32+
has_libcrypto=yes
33+
CRYPTO_LIBS=-lcrypto
34+
AC_DEFINE(HAVE_LIBCRYPTO,1,[Define this symbol if libcrypto is installed])
35+
])
36+
])
37+
LIBS=
38+
fi
3539
if test x"$has_libcrypto" = x"yes" && test x"$has_openssl_ec" = x; then
3640
AC_MSG_CHECKING(for EC functions in libcrypto)
3741
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[

configure.ac

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@ if test x"$ac_cv_prog_cc_c89" = x"no"; then
2727
AC_MSG_ERROR([c89 compiler support required])
2828
fi
2929

30-
case $host in
31-
*mingw*)
32-
use_pkgconfig=no
33-
;;
34-
*)
35-
use_pkgconfig=yes
36-
;;
37-
esac
38-
3930
case $host_os in
4031
*darwin*)
4132
if test x$cross_compiling != xyes; then

0 commit comments

Comments
 (0)