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 +