diff --git a/Makefile.am b/Makefile.am index 2e791b9..95378d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,11 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libeditline.pc doc_DATA = README.md LICENSE EXTRA_DIST = README.md LICENSE ChangeLog.md INSTALL.md -SUBDIRS = src include man examples +SUBDIRS = src include man + +if ENABLE_EXAMPLES +SUBDIRS += examples +endif ## Generate MD5 checksum file MD5 = md5sum diff --git a/configure.ac b/configure.ac index 6f5b032..880f6f1 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,10 @@ AC_ARG_ENABLE(terminal-bell, AC_ARG_ENABLE(termcap, AS_HELP_STRING([--enable-termcap], [Use termcap library to query terminal size.])) +AC_ARG_ENABLE([examples], + [AC_HELP_STRING([--enable-examples], [Build examples/ directory])], + [], [enable_examples=no]) + # # Check what features have been enabled # @@ -82,6 +86,8 @@ AS_IF([test "x$enable_sigstop" = "xyes"], AS_IF([test "x$enable_terminal_bell" = "xyes"], AC_DEFINE(CONFIG_TERMINAL_BELL, 1, [Define to enable terminal bell on completion.])) +AM_CONDITIONAL([ENABLE_EXAMPLES], [test "$enable_examples" = yes]) + # Check for a termcap compatible library if enabled AS_IF([test "x$enable_termcap" = "xyes"], AC_DEFINE(CONFIG_USE_TERMCAP, 1, [Define to use the termcap library for terminal size.])