Merge branch 'pkg-config-ncursesw' into 'master'

configure.ac: use pkg-config to get ncursesw header location

Don't assume ncursesw headers are in ../usr/include/ncursesw/..
On a pure build/system without legacy ncurses that may not be true.
Since we're using pkg-config let it provide the correct include path.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

See merge request !23
This commit is contained in:
Craig Small 2016-08-15 11:16:21 +00:00
commit 3db39cd9ed
3 changed files with 5 additions and 4 deletions

View File

@ -102,6 +102,7 @@ slabtop_SOURCES = slabtop.c lib/strutils.c lib/fileutils.c
slabtop_LDADD = $(LDADD) @NCURSES_LIBS@
watch_SOURCES = watch.c lib/strutils.c lib/fileutils.c
watch_LDADD = @WATCH_NCURSES_LIBS@ $(CYGWINFLAGS)
watch_CFLAGS = @WATCH_NCURSES_CFLAGS@
top_top_SOURCES = \
top/top.h \
top/top.c \

View File

@ -134,7 +134,8 @@ else
])
AM_CONDITIONAL(WITH_NCURSES, true)
if test "$enable_watch8bit" = yes; then
PKG_CHECK_MODULES([NCURSESW], [ncursesw], [WATCH_NCURSES_LIBS="$NCURSESW_LIBS"], [
PKG_CHECK_MODULES([NCURSESW], [ncursesw], [WATCH_NCURSES_LIBS="$NCURSESW_LIBS"]
[WATCH_NCURSES_CFLAGS="$NCURSESW_CFLAGS"], [
AC_CHECK_LIB([ncursesw], [addwstr], [WATCH_NCURSES_LIBS=-lncursesw],
[AC_MSG_ERROR([Cannot find ncurses wide library ncursesw with --enable-watch8bit])])
])
@ -144,6 +145,7 @@ else
fi
AC_SUBST([NCURSES_LIBS])
AC_SUBST([WATCH_NCURSES_LIBS])
AC_SUBST([WATCH_NCURSES_CFLAGS])
AC_ARG_WITH([systemd],
[AS_HELP_STRING([--with-systemd], [enable systemd support])],

View File

@ -52,10 +52,8 @@
# define _XOPEN_SOURCE_EXTENDED 1
# include <wchar.h>
# include <wctype.h>
# include <ncursesw/ncurses.h>
#else
# include <ncurses.h>
#endif /* WITH_WATCH8BIT */
#include <ncurses.h>
#ifdef FORCE_8BIT
# undef isprint