summaryrefslogtreecommitdiff
path: root/net/gnut/patches/patch-aa
blob: 7d70ac8d72f3cd0e353b9f4da23c1d84f03c0b0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$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