build: add configure flag for metadata handlers
Error metadata handlers are compiled based on a specific compile flag
(-DPROCESS_META), which in turn is set if a configure flag is enabled
(--enable-metadata-processing).
Change-Id: I77319f38cfd219bb831f9a3ee731441211e7bb9b
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/configure.ac b/configure.ac
index 93c3526..7055888 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,6 +77,12 @@
AS_IF([test "x$CALLOUTS_YAML" == "x"], \
[CALLOUTS_YAML="callouts-example.yaml"])
+# Compile error metadata handlers if we're asked to do so.
+AC_ARG_ENABLE([metadata-processing],
+ AS_HELP_STRING([--enable-metadata-processing], [Compile metadata handlers]),
+ [AX_APPEND_COMPILE_FLAGS([-DPROCESS_META], [CXXFLAGS])]
+)
+
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile test/Makefile])
AC_CONFIG_FILES([phosphor-logging.pc])