Skip to content

Commit

Permalink
Use pkg-info to detect library flags to link against ncurses
Browse files Browse the repository at this point in the history
  • Loading branch information
kripton committed Mar 21, 2020
1 parent 79ca37d commit 7471f2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Expand Up @@ -437,6 +437,9 @@ AM_CONDITIONAL([HAVE_LIBFTD2XX], [test "x$have_libftd2xx" = xyes])
AC_CHECK_HEADERS([curses.h ncurses/curses.h]) AC_CHECK_HEADERS([curses.h ncurses/curses.h])
AC_CHECK_LIB([ncurses], [initscr], [have_ncurses="yes"]) AC_CHECK_LIB([ncurses], [initscr], [have_ncurses="yes"])
AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncurses" = xyes]) AM_CONDITIONAL([HAVE_NCURSES], [test "x$have_ncurses" = xyes])
# Defines libncurses_LIBS that we can use to link against ncurses
# Needed since >=ncurses-6 where -ltinfo is needed in addition to -lncurses
PKG_CHECK_MODULES(libncurses, [ncurses >= 5])


# pthread # pthread
ACX_PTHREAD([ ACX_PTHREAD([
Expand Down
4 changes: 2 additions & 2 deletions examples/Makefile.mk
Expand Up @@ -91,9 +91,9 @@ examples_ola_uni_stats_LDADD = $(EXAMPLE_COMMON_LIBS)
if HAVE_NCURSES if HAVE_NCURSES
bin_PROGRAMS += examples/ola_dmxconsole examples/ola_dmxmonitor bin_PROGRAMS += examples/ola_dmxconsole examples/ola_dmxmonitor
examples_ola_dmxconsole_SOURCES = examples/ola-dmxconsole.cpp examples_ola_dmxconsole_SOURCES = examples/ola-dmxconsole.cpp
examples_ola_dmxconsole_LDADD = $(EXAMPLE_COMMON_LIBS) -lncurses examples_ola_dmxconsole_LDADD = $(EXAMPLE_COMMON_LIBS) $(libncurses_LIBS)
examples_ola_dmxmonitor_SOURCES = examples/ola-dmxmonitor.cpp examples_ola_dmxmonitor_SOURCES = examples/ola-dmxmonitor.cpp
examples_ola_dmxmonitor_LDADD = $(EXAMPLE_COMMON_LIBS) -lncurses examples_ola_dmxmonitor_LDADD = $(EXAMPLE_COMMON_LIBS) $(libncurses_LIBS)
endif endif


noinst_PROGRAMS += examples/ola_throughput examples/ola_latency noinst_PROGRAMS += examples/ola_throughput examples/ola_latency
Expand Down

0 comments on commit 7471f2e

Please sign in to comment.