move HOST_IPMI_LIB_PATH to configure.ac

Per TODO in Makefile.am, move the definition of HOST_IPMI_LIB_PATH from
the Makefile to the configure script.

Change-Id: If39bf1193f4502c239a78e21487566b234b746f8
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/Makefile.am b/Makefile.am
index 966dbe4..7024a26 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,8 +27,7 @@
 BOOST_CXX = -DBOOST_ERROR_CODE_HEADER_ONLY \
 	    -DBOOST_SYSTEM_NO_DEPRECATED \
 	    -DBOOST_ALL_NO_LIB
-#TODO - Make this path a configure option (bitbake parameter)
-ipmid_CXXFLAGS = -DHOST_IPMI_LIB_PATH=\"/usr/lib/host-ipmid/\" \
+ipmid_CXXFLAGS = \
 		 $(BOOST_CXX) \
                  $(PHOSPHOR_LOGGING_CFLAGS) \
                  $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
diff --git a/configure.ac b/configure.ac
index 78af3df..a4f407f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,6 +161,10 @@
 AS_IF([test "x$POWER_READING_SENSOR" == "x"],[POWER_READING_SENSOR="/usr/share/ipmi-providers/power_reading.json"])
 AC_DEFINE_UNQUOTED([POWER_READING_SENSOR], ["$POWER_READING_SENSOR"], [Power reading sensor configuration file])
 
+AC_ARG_VAR(HOST_IPMI_LIB_PATH, [The file path to search for libraries.])
+AS_IF([test "x$HOST_IPMI_LIB_PATH" == "x"], [HOST_IPMI_LIB_PATH="/usr/lib/host-ipmid/"])
+AC_DEFINE_UNQUOTED([HOST_IPMI_LIB_PATH], ["$HOST_IPMI_LIB_PATH"], [The file path to search for libraries.])
+
 # Create configured output
 AC_CONFIG_FILES([Makefile test/Makefile softoff/Makefile])
 AC_OUTPUT
diff --git a/ipmid.cpp b/ipmid.cpp
index 238c0e5..cfaad9b 100644
--- a/ipmid.cpp
+++ b/ipmid.cpp
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include "ipmid.hpp"
 
 #include "host-cmd-manager.hpp"