-if test -n "$with_openssl"; then
- CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include"
- LDFLAGS="${LDFLAGS} -L${with_openssl}/lib"
+if $use_gnutls; then
+ AC_CHECK_HEADER(gnutls/gnutls.h, [
+ AC_DEFINE(USE_GNUTLS)
+ AC_CHECK_LIB(gnutls, gnutls_global_init, LIBS="-lgnutls $LIBS")],
+ [GnuTLS is selected, but it is not installed])
+else
+ if test -n "$with_openssl"; then
+ CPPFLAGS="$CPPFLAGS -I${with_openssl}/include"
+ LDFLAGS="$LDFLAGS -L${with_openssl}/lib"
+ fi
+ AC_CHECK_HEADER(openssl/ssl.h, [
+ AC_CHECK_LIB(crypto, BIO_accept, LIBS="-lcrypto $LIBS")
+ AC_CHECK_LIB(ssl, SSL_CTX_new, LIBS="-lssl $LIBS")],
+ AC_MSG_ERROR([OpenSSL not installed - please install first]))