From dc887f5011834d5a9a6ec5deb8781c6bfd88c474 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 8 May 2011 23:12:06 +0200 Subject: [PATCH] Ensure proper linking with OpenSSL with recent versions of MinGW. --- configure.in | 2 +- m4/openssl.m4 | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/configure.in b/configure.in index daeffefc..a19b2aa6 100644 --- a/configure.in +++ b/configure.in @@ -67,7 +67,7 @@ case $host_os in *mingw*) AC_DEFINE(HAVE_MINGW, 1, [MinGW]) [ rm -f src/device.c; cp -f src/mingw/device.c src/device.c ] - LIBS="$LIBS -lws2_32" + LIBS="$LIBS -lws2_32 -lgdi32 -lcrypt32" ;; *) AC_MSG_ERROR("Unknown operating system.") diff --git a/m4/openssl.m4 b/m4/openssl.m4 index 8d4a24bf..59f0d450 100644 --- a/m4/openssl.m4 +++ b/m4/openssl.m4 @@ -26,19 +26,15 @@ AC_DEFUN([tinc_OPENSSL], [AC_MSG_ERROR([OpenSSL header files not found.]); break] ) + AC_CHECK_LIB(crypto, EVP_EncryptInit_ex, + [LIBS="-lcrypto $LIBS"], + [AC_MSG_ERROR([OpenSSL libraries not found.])] + ) + case $host_os in *mingw*) - AC_CHECK_LIB(crypto, EVP_EncryptInit_ex, - [LIBS="$LIBS -lcrypto -lgdi32 -lcrypt32"], - [AC_MSG_ERROR([OpenSSL libraries not found.])] - ) ;; *) - AC_CHECK_LIB(crypto, EVP_EncryptInit_ex, - [LIBS="$LIBS -lcrypto"], - [AC_MSG_ERROR([OpenSSL libraries not found.])] - ) - AC_CHECK_FUNC(dlopen, [], [AC_CHECK_LIB(dl, dlopen, -- 2.39.5