$OpenBSD: patch-configure_in,v 1.1 2004/01/24 13:52:39 naddy Exp $
--- configure.in.orig	2001-05-15 04:54:05.000000000 +0200
+++ configure.in	2004-01-21 23:03:20.000000000 +0100
@@ -43,10 +43,13 @@ if test "$SLANG_LIB_LOC" != "" ; then 
 	CFLAGS="-L$SLANG_LIB_LOC $CFLAGS"
 fi
 
+AC_SEARCH_LIBS(tgetent, termcap terminfo termlib)
+
 dnl The function we check for in libslang is important, because
 dnl we need to make sure we have the right version of slang.
-AC_CHECK_LIB(slang, SLsig_block_signals,, 
-	AC_MSG_ERROR(can't find required slang library or library is obsolete. Try setting the SLANG_LIB_LOC environment variable to point to the directory containing the slang library.))
+AC_CHECK_LIB(slang, SLsig_block_signals,
+	[AC_DEFINE(HAVE_LIBSLANG) LIBS="-lslang -lm $LIBS"],
+	AC_MSG_ERROR(can't find required slang library or library is obsolete. Try setting the SLANG_LIB_LOC environment variable to point to the directory containing the slang library.), -lm)
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -98,27 +101,6 @@ else
 	AC_MSG_WARN(pdmenu will be built without GPM mouse support.)
 fi
 
-dnl If we cannot find terminfo, link with termcap.
-Terminfo_Dirs="/usr/lib/terminfo \
-	/usr/share/lib/terminfo \
-	/usr/local/lib/terminfo"
-TERMCAP=yes
-AC_MSG_CHECKING(for terminfo)
-for terminfo_dir in $Terminfo_Dirs
-do
-	if test -d $terminfo_dir; then
-		AC_MSG_RESULT(found)
-		TERMCAP=""
-		break
-	fi
-done
-if test "$TERMCAP"; then
-	AC_MSG_RESULT(not found)
-	AC_CHECK_LIB(termcap,tgetent)
-	# Note that if this fails, we continue and make probably dies with
-	# an error. Unless terminfo is hiding somewhere else..
-fi
-
 AC_CHECK_PROG(DATE_PROG,date,yes,no)
 if test "$DATE_PROG" = yes ; then
 	AC_MSG_CHECKING(for GNU compatable date utility)
