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
53
54
55
|
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,7 +25,7 @@ iftop_SOURCES = addr_hash.c edline.c hash.c iftop.c ns_hash.c \
# addrs_ioctl.c addrs_dlpi.c dlcommon.c \
# stringmap.c cfgfile.c
-
+iftop_LDADD = $(ncurses_LIBS)
noinst_HEADERS = addr_hash.h ether.h ethertype.h extract.h hash.h iftop.h \
integers.h ip.h llc.h ns_hash.h options.h resolver.h \
--- a/configure.ac
+++ b/configure.ac
@@ -348,29 +348,27 @@
dnl AC_SEARCH_LIBS....
dnl
-AC_MSG_CHECKING([for a curses library containing mvchgat])
-oldLIBS=$LIBS
-for curseslib in ncursesw curses ncurses ; do
- LIBS="$oldLIBS -l$curseslib"
- AC_TRY_LINK([
+PKG_CHECK_MODULES([ncurses], [ncursesw], [foundcurseslib="$ncurses_LIBS"], [
+ PKG_CHECK_MODULES([ncurses], [ncurses], [foundcurseslib="$ncurses_LIBS"], [
+ AC_MSG_CHECKING([for a curses library containing mvchgat])
+ oldLIBS=$LIBS
+ for curseslib in ncursesw curses ncurses ; do
+ LIBS="$oldLIBS -l$curseslib"
+ AC_TRY_LINK([
#include <$curseslib.h>
], [
mvchgat(0, 0, 1, A_REVERSE, 0, NULL)
], [
- foundcurseslib=$curseslib
+ foundcurseslib=-l$curseslib
break
])
-done
-
-if test x$foundcurseslib = x ; then
- AC_MSG_RESULT([none found])
+ done
+ ],
AC_MSG_ERROR([Curses! Foiled again!
(Can't find a curses library supporting mvchgat.)
Consider installing ncurses.])
-else
- AC_MSG_RESULT([-l$foundcurseslib])
-fi
-
+ )
+])
dnl
dnl POSIX threads. Different systems like different combinations of flags,
|