Add configure option to control how fails behave

Different platforms have different requirements for handling
hwmon sysfs access failures.

The default behavior is now that the application will terminate
if a hardware read fails, and rely on systemd restarting it
as a way of doing retries.

The new configure option --enable-remove-from-dbus-on-fail will
cause the application to remove the property permanently from D-Bus
and never try to access it again, but not fail out.  This was the
previous (recently added) default behavior.

Change-Id: I6367f2e3e072a2ca9a3da700d4de1b6c34b219ff
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 540491e..68df2bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,6 +50,17 @@
     AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
 )
 
+AC_ARG_ENABLE([remove-from-dbus-on-fail],
+    AS_HELP_STRING([--enable-remove-from-dbus-on-fail], [Remove properties from D-Bus on access failures])
+)
+
+AC_ARG_VAR(REMOVE_ON_FAIL, [Remove properties from D-Bus on access failures])
+
+AS_IF([test "x$enable_remove_from_dbus_on_fail" == "xyes"],
+      [REMOVE_ON_FAIL="yes"]
+      AC_DEFINE_UNQUOTED([REMOVE_ON_FAIL], ["$REMOVE_ON_FAIL"], [Remove properties from D-Bus on access failures])
+)
+
 AC_ARG_VAR(BUSNAME_PREFIX, [The DBus busname prefix.])
 AC_ARG_VAR(SENSOR_ROOT, [The DBus sensors namespace root.])
 AS_IF([test "x$BUSNAME_PREFIX" == "x"], [BUSNAME_PREFIX="xyz.openbmc_project.Hwmon"])