From 58559a5b64a3634460536d6397ca382a54b599f0 Mon Sep 17 00:00:00 2001 From: Gustavo Zacarias Date: Sun, 7 Aug 2016 11:35:20 +0200 Subject: [PATCH] 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 Signed-off-by: Thomas Petazzoni --- Makefile.am | 1 + configure.ac | 4 +++- watch.c | 4 +--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 5d96b7a5..9f052c0e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 \ diff --git a/configure.ac b/configure.ac index e553e999..75976d8d 100644 --- a/configure.ac +++ b/configure.ac @@ -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])], diff --git a/watch.c b/watch.c index 69c8fc80..215b4bf5 100644 --- a/watch.c +++ b/watch.c @@ -52,10 +52,8 @@ # define _XOPEN_SOURCE_EXTENDED 1 # include # include -# include -#else -# include #endif /* WITH_WATCH8BIT */ +#include #ifdef FORCE_8BIT # undef isprint