summaryrefslogtreecommitdiff
blob: 0ffbd0cff257ff854926f7f254a72a5a5909c3a6 (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
diff --git a/configure.ac b/configure.ac
index 9cf6a53..cbc649d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,17 +18,21 @@ AC_PROG_CC
 
 # Platform specific ncurses check.
 AC_CANONICAL_HOST
-AS_CASE([$host_os],
-  [darwin*],
-    [
-      AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])])
-      AC_CHECK_HEADER(curses.h)
-    ],
-  [
-    AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])])
-    AC_CHECK_HEADER(ncursesw/curses.h)
-  ]
-)
+PKG_CHECK_MODULES([NCURSES], [ncursesw], [], [
+  PKG_CHECK_MODULES([NCURSES], [ncurses], [], [
+    AS_CASE([$host_os],
+      [darwin*],
+        [
+          AC_CHECK_LIB(ncurses, killwchar, [], [AC_MSG_ERROR([Could not find ncurses library])])
+          AC_CHECK_HEADER(curses.h)
+        ],
+      [
+        AC_CHECK_LIB(ncursesw, killwchar, [], [AC_MSG_ERROR([Could not find ncursesw library])])
+        AC_CHECK_HEADER(ncursesw/curses.h)
+      ]
+    )
+  ])
+])
 
 # Checks for libraries.
 AC_CHECK_LIB(m, cos, [], [AC_MSG_ERROR([Could not find m library])])
diff --git a/src/Makefile.am b/src/Makefile.am
index 5765613..ee411a9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,3 +15,5 @@ hh_SOURCES = 									\
 	hstr_regexp.c include/hstr_regexp.h			\
 	radixsort.c include/radixsort.h 			\
 	hstr.c 
+
+hh_LDADD = $(NCURSES_LIBS)