+do_have_ssl="no";
+AC_CHECK_LIB(ssl, SSL_read, [
+ AC_CHECK_LIB(crypto, X509_new, [
+ AC_CHECK_HEADERS(openssl/ssl.h openssl/err.h openssl/rand.h, [
+ do_have_ssl="yes";
+ ])
+ ])
+])
+
+if test x"$do_have_ssl" = xyes; then
+ LIBS="$LIBS -lssl -lcrypto"
+ AC_DEFINE([HAVE_SSL], 1, [Define if you are using SSL])
+fi
+