]> Git Repo - secp256k1.git/commitdiff
build: fix OpenSSL EC detection on macOS
authorfanquake <[email protected]>
Thu, 9 Apr 2020 07:55:11 +0000 (15:55 +0800)
committerfanquake <[email protected]>
Thu, 9 Apr 2020 09:14:06 +0000 (17:14 +0800)
build-aux/m4/bitcoin_secp.m4
configure.ac

index 3b3975cbdda81d9a96f7bece460c3d126ecc97b1..1b2b71e6abaffd62323cf3f6f7ec903af5b82421 100644 (file)
@@ -38,6 +38,8 @@ AC_DEFUN([SECP_OPENSSL_CHECK],[
   fi
 if test x"$has_libcrypto" = x"yes" && test x"$has_openssl_ec" = x; then
   AC_MSG_CHECKING(for EC functions in libcrypto)
+  CPPFLAGS_TEMP="$CPPFLAGS"
+  CPPFLAGS="$CRYPTO_CPPFLAGS $CPPFLAGS"
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
     #include <openssl/ec.h>
     #include <openssl/ecdsa.h>
@@ -51,6 +53,7 @@ if test x"$has_libcrypto" = x"yes" && test x"$has_openssl_ec" = x; then
     ECDSA_SIG_free(sig_openssl);
   ]])],[has_openssl_ec=yes],[has_openssl_ec=no])
   AC_MSG_RESULT([$has_openssl_ec])
+  CPPFLAGS="$CPPFLAGS_TEMP"
 fi
 ])
 
index cbcd17537dceed82ce494c00af7f4e536c751ec5..7f762fa31ba7e8d9e60dd9d2c5fa2dc2dc656afa 100644 (file)
@@ -46,6 +46,7 @@ case $host_os in
          if test x$openssl_prefix != x; then
            PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
            export PKG_CONFIG_PATH
+           CRYPTO_CPPFLAGS="-I$openssl_prefix/include"
          fi
          if test x$gmp_prefix != x; then
            GMP_CPPFLAGS="-I$gmp_prefix/include"
@@ -451,7 +452,7 @@ if test x"$use_tests" = x"yes"; then
   if test x"$has_openssl_ec" = x"yes"; then
     if test x"$enable_openssl_tests" != x"no"; then
       AC_DEFINE(ENABLE_OPENSSL_TESTS, 1, [Define this symbol if OpenSSL EC functions are available])
-      SECP_TEST_INCLUDES="$SSL_CFLAGS $CRYPTO_CFLAGS"
+      SECP_TEST_INCLUDES="$SSL_CFLAGS $CRYPTO_CFLAGS $CRYPTO_CPPFLAGS"
       SECP_TEST_LIBS="$CRYPTO_LIBS"
 
       case $host in
This page took 0.026773 seconds and 4 git commands to generate.