From c3fac3856ad0e825b53caeffe7d1eb2e6e08dd3b Mon Sep 17 00:00:00 2001 From: Amarnath Valluri Date: Thu, 17 Oct 2013 11:01:55 +0300 Subject: [PATCH] build: enable/disable examples support --- Makefile.am | 5 ++++- configure.ac | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 03ccf40..f72224d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,6 @@ -SUBDIRS = common daemon lib examples +SUBDIRS = common daemon lib +if BUILD_EXAMPLES + SUBDIRS += examples +endif ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac index 5714dd1..af11ca1 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,11 @@ if test "x$enable_debug" = "xyes" ; then AC_DEFINE(ENABLE_DEBUG, [1], [Enable debug features]) fi +# build example +AC_ARG_ENABLE(examples, + [--enable-examples example applications], + [enable_examples=$enable_examples], [enable_examples=no]) +AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = "xyes"]) # Checks for header files. AC_CHECK_HEADERS([string.h]) @@ -65,5 +70,10 @@ common/Makefile daemon/Makefile lib/Makefile lib/message-port.pc -examples/Makefile ]) + +if test "x$enable_examples" = "xyes"; then + AC_OUTPUT([ + examples/Makefile + ]) +fi -- 2.7.4