Commit errorlog and exit the application on error scenarios

This application interacts with OCC driver and hence its good to
terminate when there is an error during IO since it would mostly
mean a faulty hardware.

Fixes openbmc/openbmc#1428

Change-Id: I48bc7b2cf19922a7a53dbab78cdd4f2338a7431b
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/configure.ac b/configure.ac
index a565b4c..211e723 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,13 @@
 PKG_CHECK_MODULES([OPENPOWER_DBUS_INTERFACES], [openpower-dbus-interfaces],,\
     AC_MSG_ERROR(["Requires openpower-dbus-interfaces package."]))
 
+# Check for sdbusplus
+PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus],, [AC_MSG_ERROR(["sdbusplus packaged required and not found"])])
+
+# Check for sdbus++ tool
+AC_PATH_PROG([SDBUSPLUSPLUS], [sdbus++])
+AS_IF([test "x$SDBUSPLUSPLUS" == "x"], AC_MSG_ERROR([Cannot find sdbus++]))
+
 # Checks for typedefs, structures, and compiler characteristics.
 AX_CXX_COMPILE_STDCXX_14([noext])
 AX_APPEND_COMPILE_FLAGS([-Wall -Werror], [CXXFLAGS])