1From 8e273c688aa235ed9c68570a700d31596bac14df Mon Sep 17 00:00:00 2001
2From: Giulio Benetti <giulio.benetti@micronovasrl.com>
3Date: Mon, 15 Oct 2018 19:07:05 +0200
4Subject: [PATCH 1/2] configure: fix AC_CHECK_FUNCS(EVP_sha224 EVP_sha384 ...)
5 failure on static linking
6
7If building as static lib, AC_CHECK_FUNCS(EVP_sha224 EVP_sha384 ...)
8fails due to missing -lz in $LIBS.
9At the moment, $LIBS contains $LIBCRYPTO only discarding previous $LIBS
10content.
11
12Add $LIBS to:
13LIBS="$LIBCRYPTO"
14as:
15LIBS="$LIBCRYPTO $LIBS"
16This way $LIBS will contain -lz at the end of linking command that in
17static linking build is mandatory.
18
19Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
20---
21 configure.d/config_os_libs2 | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2
25index 81788a209..93044000b 100644
26--- a/configure.d/config_os_libs2
27+++ b/configure.d/config_os_libs2
28@@ -321,7 +321,7 @@ if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then
29             AC_DEFINE(HAVE_LIBCRYPTO, 1,
30                 [Define to 1 if you have the OpenSSL library (-lcrypto or -leay32).])
31             netsnmp_save_LIBS="$LIBS"
32-            LIBS="$LIBCRYPTO"
33+            LIBS="$LIBCRYPTO $LIBS"
34             AC_CHECK_FUNCS([AES_cfb128_encrypt]dnl
35                            [EVP_sha224        EVP_sha384        ]dnl
36                            [EVP_MD_CTX_create EVP_MD_CTX_destroy]dnl
37--
382.17.1
39
40