$NetBSD: patch-aa,v 1.1 2000/07/16 18:17:31 kim Exp $

--- configure.in.orig	Fri May  5 16:14:49 2000
+++ configure.in	Sun Jul 16 12:09:57 2000
@@ -49,13 +49,13 @@
 
 dnl Checks for libraries.
 
-AC_CACHE_CHECK([for readline in readline.h],
+AC_CACHE_CHECK([for readline in readline.h with libedit],
 	[g_cv_readline],[
 	save_LIBS="$LIBS"
-	LIBS="-lreadline $LIBS"
+	LIBS="-ledit -ltermcap $LIBS"
 	AC_TRY_LINK([
 		#include <stdio.h>
-		#include <readline/readline.h>
+		#include <readline.h>
 		],
 		[readline(NULL);],
 		[g_cv_readline=yes],[g_cv_readline=no])
@@ -63,8 +63,29 @@
 ])
 	
 if test $g_cv_readline = yes ; then
-	LIBS="$LIBS -lreadline"
+	LIBS="$LIBS -ledit -ltermcap"
 	AC_DEFINE(HAVE_READLINE)
+	AC_DEFINE(HAVE_LIBEDIT)
+fi
+
+if test $g_cv_readline = no ; then
+	AC_CACHE_CHECK([for readline in readline.h],
+		[g_cv_readline],[
+		save_LIBS="$LIBS"
+		LIBS="-lreadline $LIBS"
+		AC_TRY_LINK([
+			#include <stdio.h>
+			#include <readline/readline.h>
+			],
+			[readline(NULL);],
+			[g_cv_readline=yes],[g_cv_readline=no])
+		LIBS="$save_LIBS"
+	])
+		
+	if test $g_cv_readline = yes ; then
+		LIBS="$LIBS -lreadline"
+		AC_DEFINE(HAVE_READLINE)
+	fi
 fi
 
 if test $g_cv_readline = no ; then
