Convert host-ipmid -> libipmid

phosphor-host-ipmid now exposes a library along with headers for
interfacing with the ipmi daemon. Compile and link against the new
library.

Change-Id: Ifb914004df2b73cff913bf653db14ff2e710434f
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/Makefile.am b/Makefile.am
index d27ee11..392b820 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,6 +70,7 @@
 	$(libmapper_LIBS) \
 	$(PHOSPHOR_LOGGING_LIBS) \
 	$(PHOSPHOR_DBUS_INTERFACES_LIBS) \
+	$(LIBIPMID_LIBS) \
 	$(LIBADD_DLOPEN) \
 	-lchannellayer \
 	-luserlayer \
@@ -81,7 +82,8 @@
 	$(BOOST_CXX) \
 	$(libmapper_CFLAGS) \
 	$(PHOSPHOR_LOGGING_CFLAGS) \
-	$(PHOSPHOR_DBUS_INTERFACES_CFLAGS)
+	$(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
+	$(LIBIPMID_CFLAGS)
 
 SUBDIRS = test
 
diff --git a/command/channel_auth.cpp b/command/channel_auth.cpp
index 1ae006b..69b6d98 100644
--- a/command/channel_auth.cpp
+++ b/command/channel_auth.cpp
@@ -1,6 +1,6 @@
 #include "channel_auth.hpp"
 
-#include <host-ipmid/ipmid-api.h>
+#include <ipmid/api.h>
 
 namespace command
 {
diff --git a/command/guid.cpp b/command/guid.cpp
index 3751d64..c69f825 100644
--- a/command/guid.cpp
+++ b/command/guid.cpp
@@ -1,6 +1,6 @@
 #include "guid.hpp"
 
-#include <host-ipmid/ipmid-api.h>
+#include <ipmid/api.h>
 #include <mapper.h>
 
 #include <phosphor-logging/log.hpp>
diff --git a/command/payload_cmds.cpp b/command/payload_cmds.cpp
index 33b6914..3b5b4f8 100644
--- a/command/payload_cmds.cpp
+++ b/command/payload_cmds.cpp
@@ -4,7 +4,7 @@
 #include "sol/sol_manager.hpp"
 #include "sol_cmds.hpp"
 
-#include <host-ipmid/ipmid-api.h>
+#include <ipmid/api.h>
 
 #include <phosphor-logging/log.hpp>
 
diff --git a/command/session_cmds.cpp b/command/session_cmds.cpp
index a6b4adb..3b9fa0e 100644
--- a/command/session_cmds.cpp
+++ b/command/session_cmds.cpp
@@ -3,7 +3,7 @@
 #include "endian.hpp"
 #include "main.hpp"
 
-#include <host-ipmid/ipmid-api.h>
+#include <ipmid/api.h>
 
 #include <user_channel/channel_layer.hpp>
 #include <user_channel/user_layer.hpp>
diff --git a/command_table.hpp b/command_table.hpp
index ba7eaa5..1ce8f10 100644
--- a/command_table.hpp
+++ b/command_table.hpp
@@ -2,7 +2,7 @@
 
 #include "message_handler.hpp"
 
-#include <host-ipmid/ipmid-api.h>
+#include <ipmid/api.h>
 
 #include <functional>
 #include <map>
diff --git a/configure.ac b/configure.ac
index f030599..05234a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,11 +46,11 @@
 PKG_CHECK_MODULES([PHOSPHOR_LOGGING], [phosphor-logging])
 PKG_CHECK_MODULES([SDBUSPLUS], [sdbusplus])
 PKG_CHECK_MODULES([PHOSPHOR_DBUS_INTERFACES], [phosphor-dbus-interfaces])
+PKG_CHECK_MODULES([LIBIPMID], [libipmid])
 AC_CHECK_LIB([mapper], [mapper_get_service], ,[AC_MSG_ERROR([Could not find libmapper...openbmc/phosphor-objmgr package required])])
 
 # Checks for header files.
 AC_CHECK_HEADER(systemd/sd-bus.h, ,[AC_MSG_ERROR([Could not find systemd/sd-bus.h...systemd development package required])])
-AC_CHECK_HEADER(host-ipmid/ipmid-api.h, ,[AC_MSG_ERROR([Could not find host-ipmid/ipmid-api.h...openbmc/phosphor-host-ipmid package required])])
 
 # Checks for library functions.
 LT_INIT([dlopen disable-static shared])
diff --git a/main.cpp b/main.cpp
index 1e35b9a..43ad596 100644
--- a/main.cpp
+++ b/main.cpp
@@ -12,7 +12,7 @@
 #include <assert.h>
 #include <dirent.h>
 #include <dlfcn.h>
-#include <host-ipmid/ipmid-api.h>
+#include <ipmid/api.h>
 #include <systemd/sd-daemon.h>
 #include <systemd/sd-event.h>
 #include <unistd.h>
diff --git a/provider_registration.cpp b/provider_registration.cpp
index 50f06c5..616dc90 100644
--- a/provider_registration.cpp
+++ b/provider_registration.cpp
@@ -5,7 +5,7 @@
 
 #include <dirent.h>
 #include <dlfcn.h>
-#include <host-ipmid/ipmid-api.h>
+#include <ipmid/api.h>
 #include <stdlib.h>
 #include <string.h>