$NetBSD: patch-ab,v 1.2 2000/04/03 16:52:17 tron Exp $

--- configure.in.orig	Tue Feb 22 14:19:04 2000
+++ configure.in	Mon Apr  3 18:47:04 2000
@@ -28,16 +28,14 @@
 )
 
 checkssldir() { :
-    if test -d "$1/certs"; then
-        if test -f "$1/include/openssl/ssl.h"; then
-            AC_DEFINE(HAVE_OPENSSL)
-            ssldir="$1"
-            return 0
-        fi
-        if test -f "$1/include/ssl.h"; then
-            ssldir="$1"
-            return 0
-        fi
+    if test -f "$1/include/openssl/ssl.h"; then
+        AC_DEFINE(HAVE_OPENSSL)
+        ssldir="$1"
+        return 0
+    fi
+    if test -f "$1/include/ssl.h"; then
+        ssldir="$1"
+        return 0
     fi
     return 1
 }
@@ -88,8 +86,9 @@
 LIBS="-lwrap $saved_LIBS"
 AC_TRY_LINK([int hosts_access(); int allow_severity, deny_severity;],
 [hosts_access()],
-[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_LIBWRAP)],
-[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS")
+[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_LIBWRAP) wrap_LIB="-lwrap"],
+[AC_MSG_RESULT(no)])
+LIBS="$saved_LIBS"
 
 dnl Add SSL includes and libraries
 CFLAGS="$CFLAGS -I$ssldir/include"
@@ -122,6 +121,8 @@
 
 dnl Checks for library functions.
 AC_CHECK_FUNCS(getopt snprintf vsnprintf openpty _getpty)
+
+LIBS="$LIBS $wrap_LIB"
 
 AC_OUTPUT(Makefile stunnel.8)
 
