Skip to content

Commit 894aed5

Browse files
ejohnstownphilljj
authored andcommitted
configure: honor a cached wolfCrypt_Init result
Run the wolfSSL link probe under AC_CACHE_CHECK with AC_CHECK_LIB's cache name, so a preset ac_cv_lib_wolfssl_wolfCrypt_Init=yes skips the link test. The mingw cert-store CI job relies on this, as it has no cross-built wolfSSL to link against.
1 parent 02f6e9c commit 894aed5

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

‎configure.ac‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,19 +106,23 @@ AC_ARG_WITH(wolfssl,
106106
# Probe the wolfSSL functions through their headers. AC_CHECK_LIB and
107107
# AC_CHECK_FUNCS declare the symbol without extern "C", so with CC=g++ the
108108
# link looks for a mangled name and fails.
109-
AC_MSG_CHECKING([for wolfCrypt_Init in -lwolfssl])
109+
# The cache variable keeps AC_CHECK_LIB's name so a preset
110+
# ac_cv_lib_wolfssl_wolfCrypt_Init=yes still skips the link test.
110111
LIBS="-lwolfssl $LIBS"
111-
AC_LINK_IFELSE(
112-
[AC_LANG_PROGRAM([[#ifdef WOLFSSL_USER_SETTINGS
113-
#include <wolfssl/wolfcrypt/settings.h>
114-
#else
115-
#include <wolfssl/options.h>
116-
#endif
117-
#include <wolfssl/wolfcrypt/wc_port.h>]],
118-
[[return wolfCrypt_Init();]])],
119-
[AC_MSG_RESULT([yes])],
120-
[AC_MSG_RESULT([no])
121-
AC_MSG_ERROR([libwolfssl is required for ${PACKAGE}. It can be obtained from https://www.wolfssl.com/download.html/ .])])
112+
AC_CACHE_CHECK([for wolfCrypt_Init in -lwolfssl],
113+
[ac_cv_lib_wolfssl_wolfCrypt_Init],
114+
[AC_LINK_IFELSE(
115+
[AC_LANG_PROGRAM([[#ifdef WOLFSSL_USER_SETTINGS
116+
#include <wolfssl/wolfcrypt/settings.h>
117+
#else
118+
#include <wolfssl/options.h>
119+
#endif
120+
#include <wolfssl/wolfcrypt/wc_port.h>]],
121+
[[return wolfCrypt_Init();]])],
122+
[ac_cv_lib_wolfssl_wolfCrypt_Init=yes],
123+
[ac_cv_lib_wolfssl_wolfCrypt_Init=no])])
124+
AS_IF([test "x$ac_cv_lib_wolfssl_wolfCrypt_Init" != "xyes"],
125+
[AC_MSG_ERROR([libwolfssl is required for ${PACKAGE}. It can be obtained from https://www.wolfssl.com/download.html/ .])])
122126

123127
AC_MSG_CHECKING([for wc_ecc_set_rng])
124128
AC_LINK_IFELSE(

0 commit comments

Comments
 (0)