From 8439f426fc3436b8b2ec7fe80956fb18c6d3000f Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 27 Oct 2015 19:50:01 +0100 Subject: [PATCH] Fix examples FTBFS for --enable-termcap builds Signed-off-by: Joachim Nilsson --- configure.ac | 1 + examples/Makefile.am | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d506844..c59d488 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,7 @@ AC_ARG_ENABLE(termcap, [AS_HELP_STRING([--enable-termcap], [Use termcap library to query terminal size.])], AC_DEFINE([CONFIG_USE_TERMCAP], 1, [Define to use the termcap library for terminal size.])) +AM_CONDITIONAL([USE_LIBTERMCAP], [test "$enable_termcap" != no]) AM_CFLAGS="-std=gnu99 $inline_cflags -W -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow -Wcast-qual" AC_SUBST(AM_CFLAGS) diff --git a/examples/Makefile.am b/examples/Makefile.am index 2b5d47a..db231d9 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,6 +1,11 @@ AUTOMAKE_OPTIONS = foreign noinst_PROGRAMS = testit cli -LDADD = $(top_builddir)/src/libeditline.la $(TERMLIBS) +LDADD = $(top_builddir)/src/libeditline.la AM_CFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include AM_LDFLAGS = -static + +if USE_LIBTERMCAP +LDADD += -ltermcap +endif +