Update led-manager to use JSON

Current LED manager uses compile time generated led-gen.hpp and creates
DBus objects for the groups.
We would need this changed to use the generated JSON.

Tested: JSON used at runtime when --enable-json given at configure time.
led-gen.hpp not created when using JSON and led-gen.hpp created by
default when using YAML at build time.

Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: I781f8cb090ece8b87730e6c97795624282857c64
diff --git a/configure.ac b/configure.ac
index 9529fe9..988363e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,17 @@
 LEDGEN="$PYTHON $srcdir/parse_led.py -i $YAML_PATH"
 AC_SUBST(LEDGEN)
 
+# JSON configuration file
+AC_ARG_VAR(LED_JSON_FILE, [The LED configuration JSON file])
+AS_IF([test "x$LED_JSON_FILE" == "x"], [LED_JSON_FILE="/usr/share/phosphor-led-manager/led-group-config.json"])
+AC_DEFINE_UNQUOTED([LED_JSON_FILE], ["$LED_JSON_FILE"], [The LED configuration JSON file])
+
+# enable JSON configuration
+AC_ARG_ENABLE([use_json],
+    AS_HELP_STRING([--enable-use_json], [Enable JSON configuration.]))
+AC_DEFINE([LED_USE_JSON],[],[Enable JSON configuration.])
+AM_CONDITIONAL([LED_USE_JSON], [test "x$enable-use_json" == "xyes"])
+
 AC_DEFINE(CALLOUT_FWD_ASSOCIATION, "callout", [The name of the callout's forward association.])
 AC_DEFINE(CALLOUT_REV_ASSOCIATION, "fault", [The name of the callout's reverse association.])
 AC_DEFINE(ELOG_ENTRY, "entry", [Path element indicates an error log entry under logging namespace.])