build: enable/disable examples support
authorAmarnath Valluri <amarnath.valluri@linux.intel.com>
Thu, 17 Oct 2013 08:01:55 +0000 (11:01 +0300)
committerAmarnath Valluri <amarnath.valluri@linux.intel.com>
Thu, 17 Oct 2013 08:12:01 +0000 (11:12 +0300)
Makefile.am
configure.ac

index 03ccf40..f72224d 100644 (file)
@@ -1,3 +1,6 @@
-SUBDIRS = common daemon lib examples
+SUBDIRS = common daemon lib 
+if BUILD_EXAMPLES
+    SUBDIRS += examples
+endif
 
 ACLOCAL_AMFLAGS = -I m4
index 5714dd1..af11ca1 100644 (file)
@@ -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