build: add ENABLE_EXAMPLE macro on enable-example condition
Previously, the ENABLE_EXAMPLE was only an AM_CONDITIONAL and therefore
not passed down to the source environment via config.h. This fixes
that.
Change-Id: I8e02112f12c4aaef22eda76cc9e50b9bf7f32dda
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/configure.ac b/configure.ac
index 05e87cd..97d54d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,10 @@
AS_HELP_STRING([--enable-example], [Enable example blob handler])
)
AM_CONDITIONAL(ENABLE_EXAMPLE, [test "x$enable_example" = "xyes"])
+AS_IF([test "x$enable_example" = "xyes"],
+ [AC_DEFINE(ENABLE_EXAMPLE, [1], [Build and install the example handler.])],
+ [AC_DEFINE(ENABLE_EXAMPLE, [0], [Do not build and install the example handler.])]
+)
# Create configured output
AC_CONFIG_FILES([Makefile test/Makefile])