1 From 7868dc7103b40484d177985bb04270250a50e262 Mon Sep 17 00:00:00 2001
2 From: Dan Fandrich <dan@coneharvesters.com>
3 Date: Thu, 19 Mar 2015 23:41:10 +0100
4 Subject: [PATCH] cyassl: detect the library as renamed wolfssl
6 This change was made in CyaSSL/WolfSSL ver. 3.4.0
8 configure.ac | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
9 1 file changed, 57 insertions(+), 3 deletions(-)
13 @@ -1578,8 +1578,10 @@ if test "$curl_ssl_msg" = "$init_ssl_msg
14 AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
17 - dnl these can only exist if openssl exists
18 - dnl yassl doesn't have SSL_get_shutdown
19 + dnl These can only exist if OpenSSL exists
20 + dnl Older versions of Cyassl (some time before 2.9.4) don't have
21 + dnl SSL_get_shutdown (but this check won't actually detect it there
22 + dnl as it's a macro that needs the header files be included)
24 AC_CHECK_FUNCS( RAND_status \
26 @@ -1943,6 +1945,10 @@ if test "$curl_ssl_msg" = "$init_ssl_msg
30 + dnl This should be reworked to use pkg-config instead
32 + cyassllibname=cyassl
34 if test -z "$OPT_CYASSL" ; then
35 dnl check for lib in system default first
37 @@ -1984,7 +1990,55 @@ if test "$curl_ssl_msg" = "$init_ssl_msg
49 + if test "x$USE_CYASSL" != "xyes"; then
50 + dnl libcyassl renamed to libwolfssl as of 3.4.0
51 + addld=-L$OPT_CYASSL/lib$libsuff
52 + addcflags=-I$OPT_CYASSL/include
53 + cyassllib=$OPT_CYASSL/lib$libsuff
55 + LDFLAGS="$LDFLAGS $addld"
56 + if test "$addcflags" != "-I/usr/include"; then
57 + CPPFLAGS="$CPPFLAGS $addcflags"
60 + cyassllibname=wolfssl
61 + my_ac_save_LIBS="$LIBS"
62 + LIBS="-l$cyassllibname -lm $LIBS"
64 + AC_MSG_CHECKING([for CyaSSL_Init in -lwolfssl])
67 +/* These aren't needed for detection and confuse WolfSSL.
68 + They are set up properly later if it is detected. */
70 +#undef SIZEOF_LONG_LONG
71 +#include <cyassl/ssl.h>
73 + return CyaSSL_Init();
77 + AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
78 + AC_SUBST(USE_CYASSL, [1])
81 + curl_ssl_msg="enabled (CyaSSL)"
89 + LIBS="$my_ac_save_LIBS"
92 if test "x$USE_CYASSL" = "xyes"; then
93 @@ -1996,7 +2050,7 @@ if test "$curl_ssl_msg" = "$init_ssl_msg
94 dnl Versions since at least 2.9.4 renamed error.h to error-ssl.h
95 AC_CHECK_HEADERS(cyassl/error-ssl.h)
97 - LIBS="-lcyassl -lm $LIBS"
98 + LIBS="-l$cyassllibname -lm $LIBS"
100 if test -n "$cyassllib"; then
101 dnl when shared libs were found in a path that the run-time