From 1b27fcfcf7424bbb866f6398b0c6070f82b6f73d Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Sat, 24 Feb 2018 03:18:15 -0500 Subject: [PATCH] curl-openssl.m4: Fix version check for OpenSSL 1.1.1 - Add OpenSSL 1.1.1 to the header/library version lists. - Detect OpenSSL 1.1.1 library using its function ERR_clear_last_mark, which was added in that version. Prior to this change an erroneous header/library mismatch was caused by lack of OpenSSL 1.1.1 detection. I tested using openssl-1.1.1-pre1. --- m4/curl-openssl.m4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/m4/curl-openssl.m4 b/m4/curl-openssl.m4 index 20c312658..391099b69 100644 --- a/m4/curl-openssl.m4 +++ b/m4/curl-openssl.m4 @@ -29,7 +29,7 @@ dnl ------------------------------------------------- dnl Find out OpenSSL headers API version, as reported dnl by OPENSSL_VERSION_NUMBER. No runtime checks dnl allowed here for cross-compilation support. -dnl HAVE_OPENSSL_API_HEADERS is defined as apprpriate +dnl HAVE_OPENSSL_API_HEADERS is defined as appropriate dnl only for systems which actually run the configure dnl script. Config files generated manually or in any dnl other way shall not define this. @@ -66,6 +66,7 @@ AC_DEFUN([CURL_CHECK_OPENSSL_API_HEADERS], [ ;; esac case $tst_api in + 0x111) tst_show="1.1.1" ;; 0x110) tst_show="1.1.0" ;; 0x102) tst_show="1.0.2" ;; 0x101) tst_show="1.0.1" ;; @@ -121,6 +122,13 @@ AC_DEFUN([CURL_CHECK_OPENSSL_API_LIBRARY], [ tst_api="unknown" # AC_MSG_CHECKING([for OpenSSL library version]) + if test "$tst_api" = "unknown"; then + AC_LINK_IFELSE([ + AC_LANG_FUNC_LINK_TRY([ERR_clear_last_mark]) + ],[ + tst_api="0x111" + ]) + fi if test "$tst_api" = "unknown"; then case $host in *-*-vms*) @@ -217,6 +225,7 @@ AC_DEFUN([CURL_CHECK_OPENSSL_API_LIBRARY], [ ]) fi case $tst_api in + 0x111) tst_show="1.1.1" ;; 0x110) tst_show="1.1.0" ;; 0x102) tst_show="1.0.2" ;; 0x101) tst_show="1.0.1" ;; -- 2.40.0