summaryrefslogtreecommitdiff
blob: 5c11e7682b596f71f295560ba0cf6de7b6fedb6b (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
diff --git a/configure.ac b/configure.ac
index 2d79f35..b82dd49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,11 +17,8 @@ AC_CONFIG_MACRO_DIR([m4])
 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 @@ mingw32* | windows*)
 esac
 AM_CONDITIONAL([HAVE_WINDOWS], [test $HAVE_WINDOWS -eq 1])
 
+dnl ncursesw
+
+PKG_CHECK_MODULES([ncursesw], [ncursesw],[
+	LIBS="$LIBS $ncursesw_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],[$ncursesw_LIBS])
+	],
+	[AC_MSG_ERROR([No curses support detected.])])
+
+
 dnl multi-byte character support
 
 AC_ARG_ENABLE([multibyte],
@@ -207,12 +217,6 @@ AM_CONDITIONAL(ENABLE_HELP_SCREEN, test x$enable_help_screen = xyes)
 
 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@:>@]),