$NetBSD: patch-aa,v 1.3 2004/12/14 19:53:49 xtraeme Exp $

--- configure.ac.orig	2004-09-27 10:01:49.000000000 +0200
+++ configure.ac	2004-11-30 00:30:27.000000000 +0100
@@ -238,12 +238,21 @@
 AC_ARG_ENABLE(openssl,
 	[  --enable-openssl    Attempt to use OpenSSL for SSL support.],
 	[ac_cv_enable_openssl=$enableval], [ac_cv_enable_openssl=yes])
-if test x"$ac_cv_enable_openssl" = xyes; then
-	PKG_CHECK_MODULES(OPENSSL, openssl >= 0.9.7, :, ac_cv_enable_openssl=no)
-	if test x$ac_cv_enable_openssl = xyes; then
-		AC_DEFINE(USE_OPENSSL, 1, Define if you want OpenSSL support)
-	fi
+if test $ac_cv_enable_openssl = yes; then
+        AC_MSG_CHECKING([if openssl is available])
+        OPENSSL_LIBS="$LIBS -lssl -lcrypto"
+        AC_TRY_LINK([
+#include <openssl/opensslv.h>
+],      [ return OPENSSL_VERSION_NUMBER; ],
+        [ AC_MSG_RESULT(yes)
+          AC_DEFINE(USE_OPENSSL, 1, Define if you want OpenSSL support.) ],
+        [ AC_MSG_RESULT(no)
+          OPENSSL_LIBS="$ac_save_LIBS"
+	  ac_cv_enable_openssl=no ])
+else
+	AC_MSG_RESULT(no)
 fi
+
 AC_SUBST(OPENSSL_CFLAGS)
 AC_SUBST(OPENSSL_LIBS)
 
