summaryrefslogtreecommitdiff
blob: 40ee0066e3d37ef7b32880f1ea0f98abc813366d (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
--- a/configure.ac
+++ b/configure.ac
@@ -17,11 +17,8 @@
 dnl Check for programs
 AC_PROG_CC_C99
 AC_PROG_INSTALL
-AX_WITH_CURSES
+PKG_PROG_PKG_CONFIG
 
-AS_IF([ test "x$ax_cv_curses" = xno ],
-	[AC_MSG_ERROR([No curses support detected.])
-	])
 
 dnl =======================================================
 dnl initialize variables
@@ -83,6 +80,19 @@
 esac
 AM_CONDITIONAL([HAVE_WINDOWS], [test $HAVE_WINDOWS -eq 1])
 
+dnl ncurses
+
+PKG_CHECK_MODULES([ncurses], [ncurses],[
+	LIBS="$LIBS $ncurses_LIBS"
+	ax_cv_curses_color=yes
+	ax_cv_curses_mouse=yes
+	ax_cv_curses_enhanced=yes
+	AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if the Ncurses library is present])
+	AC_SUBST([CURSES_LIB],[$ncurses_LIBS])
+	],
+	[AC_MSG_ERROR([No curses support detected.])])
+
+
 dnl multi-byte character support
 
 AC_ARG_ENABLE([multibyte],
@@ -207,12 +217,6 @@
 
 dnl Optional - curses getmouse support
 
-dnl AC_CHECK_LIB depends on being able to prepend a '-l', remove the '-l' from CURSES_LIB first
-AC_CHECK_LIB([$(expr substr $CURSES_LIB 3 99)],
-		[getmouse],
-		[ax_cv_curses_mouse=yes],
-		[ax_cv_curses_mouse=no])
-
 AC_ARG_ENABLE([mouse], 
 	AS_HELP_STRING([--enable-mouse],
 		[Enable curses getmouse support @<:@default=yes@:>@]),