Correctly detect openssl on windows

This commit is contained in:
Sebastian Hahn 2011-05-05 16:27:55 +02:00 committed by Nick Mathewson
parent ceb03b90c4
commit 66193853fd

View File

@ -116,6 +116,18 @@ fi
AM_CONDITIONAL(ZLIB_REGRESS, [test "$have_zlib" = "yes"]) AM_CONDITIONAL(ZLIB_REGRESS, [test "$have_zlib" = "yes"])
dnl See if we have openssl. This doesn't go in LIBS either. 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 if test "$enable_openssl" = "yes"; then
save_LIBS="$LIBS" save_LIBS="$LIBS"
LIBS="" LIBS=""
@ -123,8 +135,11 @@ OPENSSL_LIBS=""
have_openssl=no have_openssl=no
AC_SEARCH_LIBS([SSL_new], [ssl], AC_SEARCH_LIBS([SSL_new], [ssl],
[have_openssl=yes [have_openssl=yes
OPENSSL_LIBS="$LIBS -lcrypto" OPENSSL_LIBS="$LIBS -lcrypto $EV_LIB_GDI $EV_LIB_WS32"
AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl])]) 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" LIBS="$save_LIBS"
AC_SUBST(OPENSSL_LIBS) AC_SUBST(OPENSSL_LIBS)
fi fi