1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at http://curl.haxx.se/docs/copyright.html.
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 #***************************************************************************
23 # File version for 'aclocal' use. Keep it a single number.
27 dnl CURL_CHECK_OPENSSL_API_HEADERS
28 dnl -------------------------------------------------
29 dnl Find out OpenSSL headers API version, as reported
30 dnl by OPENSSL_VERSION_NUMBER. No runtime checks
31 dnl allowed here for cross-compilation support.
32 dnl HAVE_OPENSSL_API_HEADERS is defined as apprpriate
33 dnl only for systems which actually run the configure
34 dnl script. Config files generated manually or in any
35 dnl other way shall not define this.
37 AC_DEFUN([CURL_CHECK_OPENSSL_API_HEADERS], [
41 AC_MSG_CHECKING([for OpenSSL headers version])
42 CURL_CHECK_DEF([OPENSSL_VERSION_NUMBER], [
44 # include <openssl/crypto.h>
49 if test "$curl_cv_have_def_OPENSSL_VERSION_NUMBER" = "yes"; then
50 tst_verlen=`expr "$curl_cv_def_OPENSSL_VERSION_NUMBER" : '.*'`
51 case "x$tst_verlen" in
53 tst_vermaj=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 3`
54 tst_vermin=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 4`
55 tst_verfix=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 5`
56 tst_api=0x$tst_vermaj$tst_vermin$tst_verfix
59 tst_vermaj=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 3`
60 tst_vermin=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 5`
61 tst_verfix=`echo $curl_cv_def_OPENSSL_VERSION_NUMBER | cut -c 7`
62 tst_api=0x$tst_vermaj$tst_vermin$tst_verfix
69 0x110) tst_show="1.1.0" ;;
70 0x102) tst_show="1.0.2" ;;
71 0x101) tst_show="1.0.1" ;;
72 0x100) tst_show="1.0.0" ;;
73 0x099) tst_show="0.9.9" ;;
74 0x098) tst_show="0.9.8" ;;
75 0x097) tst_show="0.9.7" ;;
76 0x096) tst_show="0.9.6" ;;
77 0x095) tst_show="0.9.5" ;;
78 0x094) tst_show="0.9.4" ;;
79 0x093) tst_show="0.9.3" ;;
80 0x092) tst_show="0.9.2" ;;
81 0x091) tst_show="0.9.1" ;;
82 *) tst_show="unknown" ;;
84 tst_show="$tst_show - $curl_cv_def_OPENSSL_VERSION_NUMBER"
88 AC_MSG_RESULT([$tst_show])
90 dnl if test "$tst_api" != "unknown"; then
91 dnl AC_DEFINE_UNQUOTED(HAVE_OPENSSL_API_HEADERS, $tst_api,
92 dnl [OpenSSL headers configure time API. Defined only by configure script.
93 dnl No matter what, do not ever define this manually or by any other means.])
95 curl_openssl_api_headers=$tst_api
99 dnl CURL_CHECK_OPENSSL_API_LIBRARY
100 dnl -------------------------------------------------
101 dnl Find out OpenSSL library API version, performing
102 dnl only link tests in order to avoid getting fooled
103 dnl by mismatched OpenSSL headers. No runtime checks
104 dnl allowed here for cross-compilation support.
105 dnl HAVE_OPENSSL_API_LIBRARY is defined as apprpriate
106 dnl only for systems which actually run the configure
107 dnl script. Config files generated manually or in any
108 dnl other way shall not define this.
110 dnl Most probably we should not bother attempting to
111 dnl detect OpenSSL library development API versions
112 dnl 0.9.9 and 1.1.0. For our intended use, detecting
113 dnl released versions should be good enough.
115 dnl Given that currently we are not using the result
116 dnl of this check, except for informative purposes,
117 dnl lets try to figure out everything.
119 AC_DEFUN([CURL_CHECK_OPENSSL_API_LIBRARY], [
123 AC_MSG_CHECKING([for OpenSSL library version])
124 if test "$tst_api" = "unknown"; then
128 AC_LANG_FUNC_LINK_TRY([SSL_CTX_set_not_resumbl_sess_cb])
135 AC_LANG_FUNC_LINK_TRY([SSL_CTX_set_not_resumable_session_callback])
142 if test "$tst_api" = "unknown"; then
144 AC_LANG_FUNC_LINK_TRY([SSL_CONF_CTX_new])
149 if test "$tst_api" = "unknown"; then
151 AC_LANG_FUNC_LINK_TRY([SSL_renegotiate_abbreviated])
156 if test "$tst_api" = "unknown"; then
158 AC_LANG_FUNC_LINK_TRY([OBJ_add_sigid])
163 if test "$tst_api" = "unknown"; then
165 AC_LANG_FUNC_LINK_TRY([ERR_set_mark])
170 if test "$tst_api" = "unknown"; then
172 AC_LANG_FUNC_LINK_TRY([ERR_peek_last_error])
177 if test "$tst_api" = "unknown"; then
179 AC_LANG_FUNC_LINK_TRY([c2i_ASN1_OBJECT])
184 if test "$tst_api" = "unknown"; then
186 AC_LANG_FUNC_LINK_TRY([SSL_CTX_set_purpose])
191 if test "$tst_api" = "unknown"; then
193 AC_LANG_FUNC_LINK_TRY([OBJ_obj2txt])
198 if test "$tst_api" = "unknown"; then
200 AC_LANG_FUNC_LINK_TRY([SSL_get_verify_depth])
205 if test "$tst_api" = "unknown"; then
207 AC_LANG_FUNC_LINK_TRY([SSL_library_init])
212 if test "$tst_api" = "unknown"; then
214 AC_LANG_FUNC_LINK_TRY([SSL_CTX_set_cipher_list])
220 0x110) tst_show="1.1.0" ;;
221 0x102) tst_show="1.0.2" ;;
222 0x101) tst_show="1.0.1" ;;
223 0x100) tst_show="1.0.0" ;;
224 0x099) tst_show="0.9.9" ;;
225 0x098) tst_show="0.9.8" ;;
226 0x097) tst_show="0.9.7" ;;
227 0x096) tst_show="0.9.6" ;;
228 0x095) tst_show="0.9.5" ;;
229 0x094) tst_show="0.9.4" ;;
230 0x093) tst_show="0.9.3" ;;
231 0x092) tst_show="0.9.2" ;;
232 0x091) tst_show="0.9.1" ;;
233 *) tst_show="unknown" ;;
235 AC_MSG_RESULT([$tst_show])
237 dnl if test "$tst_api" != "unknown"; then
238 dnl AC_DEFINE_UNQUOTED(HAVE_OPENSSL_API_LIBRARY, $tst_api,
239 dnl [OpenSSL library link time API. Defined only by configure script.
240 dnl No matter what, do not ever define this manually or by any other means.])
242 curl_openssl_api_library=$tst_api
246 dnl CURL_CHECK_OPENSSL_API
247 dnl -------------------------------------------------
249 AC_DEFUN([CURL_CHECK_OPENSSL_API], [
251 CURL_CHECK_OPENSSL_API_HEADERS
252 CURL_CHECK_OPENSSL_API_LIBRARY
256 AC_MSG_CHECKING([for OpenSSL headers and library versions matching])
257 if test "$curl_openssl_api_headers" = "unknown" ||
258 test "$curl_openssl_api_library" = "unknown"; then
260 tst_warns="Can not compare OpenSSL headers and library versions."
261 elif test "$curl_openssl_api_headers" != "$curl_openssl_api_library"; then
263 tst_warns="OpenSSL headers and library versions do not match."
265 AC_MSG_RESULT([$tst_match])
266 if test "$tst_match" != "yes"; then
267 AC_MSG_WARN([$tst_warns])