Makefile.am | 2 ++ configure.ac | 20 ++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 05a72e7..7908937 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,6 +36,8 @@ SUFFIXES = .h BUILT_SOURCES = $(myhtopheaders) htop_SOURCES = $(myhtopheaders) $(myhtopsources) config.h +htop_LDADD = $(NCURSES_LIBS) + profile: $(MAKE) all CFLAGS="" AM_CPPFLAGS="-pg -O2" diff --git a/configure.ac b/configure.ac index ff6901b..6226d90 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,7 @@ AC_DISABLE_SHARED AC_ENABLE_STATIC AC_PROG_LIBTOOL +PKG_PROG_PKG_CONFIG # Checks for libraries. AC_CHECK_LIB([m], [ceil], [], [missing_libraries="$missing_libraries libm"]) @@ -89,16 +89,20 @@ fi AC_ARG_ENABLE(unicode, [AC_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="yes") if test "x$enable_unicode" = xyes; then - AC_CHECK_LIB([ncursesw], [refresh], [], [ - missing_libraries="$missing_libraries libncursesw" - AC_MSG_ERROR([You may want to use --disable-unicode or install libncursesw.]) + PKG_CHECK_MODULES([NCURSES], [ncursesw],[ + AC_CHECK_LIB([ncursesw], [refresh], [], [ + missing_libraries="$missing_libraries libncursesw" + AC_MSG_ERROR([You may want to use --disable-unicode or install libncursesw.]) + ]) + AC_CHECK_HEADERS([ncursesw/curses.h],[:], + [AC_CHECK_HEADERS([ncurses/ncurses.h],[:], + [AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])]) ]) - AC_CHECK_HEADERS([ncursesw/curses.h],[:], - [AC_CHECK_HEADERS([ncurses/ncurses.h],[:], - [AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])]) else - AC_CHECK_LIB([ncurses], [refresh], [], [missing_libraries="$missing_libraries libncurses"]) - AC_CHECK_HEADERS([curses.h],[:],[missing_headers="$missing_headers $ac_header"]) + PKG_CHECK_MODULES([NCURSES], [ncurses],[ + AC_CHECK_LIB([ncurses], [refresh], [], [missing_libraries="$missing_libraries libncurses"]) + AC_CHECK_HEADERS([curses.h],[:],[missing_headers="$missing_headers $ac_header"]) + ]) fi if test ! -z "$missing_libraries"; then