]> granicus.if.org Git - libevent/commitdiff
Correctly detect openssl on windows
authorSebastian Hahn <sebastian@torproject.org>
Thu, 5 May 2011 14:27:55 +0000 (16:27 +0200)
committerNick Mathewson <nickm@torproject.org>
Fri, 6 May 2011 14:58:06 +0000 (10:58 -0400)
configure.in

index abc0dbab916b0e34b2429a9849848ab2ee1957d9..5085edea9552505b31d8b7319691a2f9de7dbe72 100644 (file)
@@ -116,15 +116,30 @@ fi
 AM_CONDITIONAL(ZLIB_REGRESS, [test "$have_zlib" = "yes"])
 
 dnl See if we have openssl.  This doesn't go in LIBS either.
+if test "$bwin32" = true; then
+  EV_LIB_WS32=-lws2_32
+  EV_LIB_GDI=-lgdi32
+else
+  EV_LIB_WS32=
+  EV_LIB_GDI=
+fi
+AC_SUBST(EV_LIB_WS32)
+AC_SUBST(EV_LIB_GDI)
+
+AC_CHECK_HEADERS([openssl/bio.h])
+
 if test "$enable_openssl" = "yes"; then
 save_LIBS="$LIBS"
 LIBS=""
 OPENSSL_LIBS=""
 have_openssl=no
 AC_SEARCH_LIBS([SSL_new], [ssl],
-               [have_openssl=yes
-               OPENSSL_LIBS="$LIBS -lcrypto"
-               AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl])])
+       [have_openssl=yes
+       OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32"
+       AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl])],
+       [have_openssl=no
+       AC_DEFINE(HAVE_OPENSSL, 0, [Define if the system lacks openssl])],
+       [-lcrypto $EV_LIB_GDI $EV_LIB_WS32])
 LIBS="$save_LIBS"
 AC_SUBST(OPENSSL_LIBS)
 fi