From 83866b378628e6290bf435f5ae04a6d6de72d0e5 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Wed, 16 Jan 2019 19:10:20 +0100 Subject: [PATCH] Only compile the monitor example application if ncurses is available. --- configure.ac | 4 ++++ examples/.gitignore | 1 + examples/Makefile.am | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 275bf5f1..2309d358 100644 --- a/configure.ac +++ b/configure.ac @@ -96,6 +96,10 @@ PKG_CHECK_MODULES([CMOCKA], [cmocka >= 1.1.0], [cmocka=true], [cmocka=false]) PKG_CHECK_MODULES([LXC], [lxc >= 2.0.0], [lxc=true], [lxc=false]) AM_CONDITIONAL(BLACKBOX_TESTS, test "$cmocka" = true -a "$lxc" = true) +dnl Additional example code +PKG_CHECK_MODULES([NCURSES], [ncurses >= 5], [curses=true], [curses=false]) +AM_CONDITIONAL(CURSES, test "$curses" = true) + dnl Install test binaries AC_ARG_ENABLE([install_tests], [AS_HELP_STRING([--enable-install-tests], [include test binaries in installation])], diff --git a/examples/.gitignore b/examples/.gitignore index a1f84221..681b8897 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -4,3 +4,4 @@ chat chatpp manynodes meshlinkapp +monitor diff --git a/examples/Makefile.am b/examples/Makefile.am index 9ce812d2..9243cafb 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -18,5 +18,7 @@ manynodes_LDADD = ${top_builddir}/src/libmeshlink.la channels_SOURCES = channels.c channels_LDADD = ${top_builddir}/src/libmeshlink.la +if CURSES monitor_SOURCES = monitor.c -monitor_LDADD = ${top_builddir}/src/libmeshlink.la -lcurses -lm +monitor_LDADD = ${top_builddir}/src/libmeshlink.la $(NCURSES_LIBS) -lm +endif -- 2.39.5