]> granicus.if.org Git - libevent/commitdiff
autotools/win32: fix searching ssl library
authorAzat Khuzhin <a3at.mail@gmail.com>
Mon, 8 Aug 2016 15:10:56 +0000 (18:10 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Tue, 9 Aug 2016 12:47:58 +0000 (15:47 +0300)
configure.ac
m4/libevent_openssl.m4

index 5df1b907c725ff5ce8e14a9316f6adec7a9f0d3a..315d97a5469d3df1d875fbc998c4262e104e5bfd 100644 (file)
@@ -778,7 +778,7 @@ fi
 # check if we have and should use openssl
 AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
 if test "x$enable_openssl" = "xyes"; then
-       AC_SEARCH_LIBS([ERR_remove_thread_state], [crypto],
+       AC_SEARCH_LIBS([ERR_remove_thread_state], [crypto eay32],
                [AC_DEFINE(HAVE_ERR_REMOVE_THREAD_STATE, 1, [Define to 1 if you have ERR_remove_thread_stat().])])
 fi
 
index 3cb064a0bd369308e00f754e33e3fda2123e245e..c20405950319e73ebe4367e7f3817b4e66178720 100644 (file)
@@ -26,12 +26,17 @@ case "$enable_openssl" in
        save_LIBS="$LIBS"
        LIBS=""
        OPENSSL_LIBS=""
-       AC_SEARCH_LIBS([SSL_new], [ssl],
-           [have_openssl=yes
-           OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"],
-           [have_openssl=no],
-           [-lcrypto $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD])
-       LIBS="$save_LIBS"
+       for lib in crypto eay32; do
+               # clear cache
+               unset ac_cv_search_SSL_new
+               AC_SEARCH_LIBS([SSL_new], [ssl ssl32],
+                   [have_openssl=yes
+                   OPENSSL_LIBS="$LIBS -l$lib $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"],
+                   [have_openssl=no],
+                   [-l$lib $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD])
+               LIBS="$save_LIBS"
+               test "$have_openssl" = "yes" && break
+       done
        ;;
     esac
     AC_SUBST(OPENSSL_INCS)