Allow JSON use on all apps except fan control

Added a `--disable-json-control` configure flag that can be added to the
use of `--enable-json` to disable the use of JSON for fan control in
favor of using a YAML based config. This only disables the use of JSON
for fan control while still enabling the use of JSON on the other fan
applications that support it.

Tested:
    Configured with `--enable-json` enables all fan apps to use JSON
    Configured with `--enable-json --disable-json-control` enables all
fan apps except fan control to use JSON
    Using `--enable-json --disable-json-control` fan control uses YAML
based configs.
    The use of only `--disable-json-control` has no affect and all fan
apps use YAML based configs

Change-Id: Id48310d1fea558e4957c8dbc58aaee7512b004f1
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 97f6e38..d9e02b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,12 +65,15 @@
     AS_HELP_STRING([--disable-presence], [Disable fan presence package.]))
 AC_ARG_ENABLE([control],
     AS_HELP_STRING([--disable-control], [Disable fan control package.]))
+AC_ARG_ENABLE([json-control],
+    AS_HELP_STRING([--disable-json-control], [Disable the use of JSON to configure fan control in favor of YAML.]))
 AC_ARG_ENABLE([cooling-type],
     AS_HELP_STRING([--disable-cooling-type], [Disable cooling-type package.]))
 AC_ARG_ENABLE([monitor],
     AS_HELP_STRING([--disable-monitor], [Disable monitor]))
 
 AM_CONDITIONAL([WANT_JSON], [test "x$enable_json" == "xyes"])
+AM_CONDITIONAL([WANT_JSON_CONTROL], [test "x$enable_json" == "xyes" -a "x$enable_json_control" != "xno"])
 AM_CONDITIONAL([WANT_PRESENCE], [test "x$enable_presence" != "xno"])
 AM_CONDITIONAL([WANT_CONTROL], [test "x$enable_control" != "xno"])
 AM_CONDITIONAL([WANT_COOLING_TYPE], [test "x$enable_cooling_type" != "xno"])
@@ -130,7 +133,7 @@
                        [Root path for persisting zone property states])
 
     # Use runtime(json) config, otherwise default to compile time(yaml) config
-    AM_COND_IF([WANT_JSON],
+    AM_COND_IF([WANT_JSON_CONTROL],
     [
         AC_CHECK_HEADER(nlohmann/json.hpp, ,
                 [AC_MSG_ERROR([Could not find nlohmann/json.hpp... nlohmann/json package required])])
diff --git a/control/Makefile.am b/control/Makefile.am
index da67ee5..27a5c83 100644
--- a/control/Makefile.am
+++ b/control/Makefile.am
@@ -30,7 +30,7 @@
 	${PHOSPHOR_DBUS_INTERFACES_CFLAGS} \
 	-flto
 
-if WANT_JSON
+if WANT_JSON_CONTROL
 SUBDIRS = json .
 phosphor_fan_control_LDADD += ${builddir}/json/libfan-control-json.la
 phosphor_fan_control_SOURCES += json_parser.cpp