summaryrefslogtreecommitdiff
blob: 84bd0b70ff87867cd873e4aae1bcee6561cf1619 (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
From c662db58448fefe86184117e6bab5799e43eccf1 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 1 Jan 2012 02:26:16 -0500
Subject: [PATCH] search ncurses via pkg-config first

Newer ncurses installs include pkg-config files which tell us the right
-I/-L paths we need, so default to that before trying the legacy ways.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 configure.ac |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1f61ae4..05308be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,7 @@ AC_PROG_CC
 AC_PROG_LN_S
 AC_ISC_POSIX
 AC_SYS_LARGEFILE
+PKG_PROG_PKG_CONFIG
 
 dnl Internationalization macros.
 
@@ -439,6 +440,23 @@ AC_CHECK_FUNCS(getopt_long)
 dnl Checks for libraries.
 
 if eval "test x$CURSES_LIB_NAME = x"; then
+    if test x$enable_utf8 != xno; then
+	PKG_CHECK_MODULES([NCURSESW], [ncursesw], [
+	    CURSES_LIB=$NCURSESW_LIBS
+	    CPPFLAGS="$NCURSESW_CFLAGS $CPPFLAGS"
+	    CURSES_LIB_NAME=ncursesw
+	    CURSES_LIB_WIDE=yes
+	], [:])
+    else
+	PKG_CHECK_MODULES([NCURSES], [ncurses], [
+	    CURSES_LIB=$NCURSES_LIBS
+	    CPPFLAGS="$NCURSES_CFLAGS $CPPFLAGS"
+	    CURSES_LIB_NAME=ncurses
+	], [:])
+    fi
+fi
+
+if eval "test x$CURSES_LIB_NAME = x"; then
     AC_CHECK_HEADERS(ncurses.h)
 
     if test x$enable_utf8 != xno; then
-- 
1.7.6.1