Create libphosphor-logging library

The commit function would be too big to hold on the
header file. Move it to a library and update the
phosphos-logging.pc file for users to link against it.
Add dependency to libsdbusplus as the commit interface
would make use of the transaction id support.

Change-Id: I237b15e35a633f1da9bf3401b5bf754154f132db
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/Makefile.am b/Makefile.am
index fa066a1..1e9d331 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,18 @@
 # Generate this header, don't export in a distro
 nodist_include_HEADERS = elog-gen.hpp
 
+libphosphor_logging_FILES = \
+	elog.cpp
+libphosphor_loggingdir = ${libdir}
+libphosphor_logging_LTLIBRARIES = libphosphor_logging.la
+libphosphor_logging_la_SOURCES = $(libphosphor_logging_FILES)
+libphosphor_logging_la_LDFLAGS = \
+	$(SYSTEMD_LIBS) \
+	$(SDBUSPLUS_LIBS) \
+	-version-info 1:0:0 -shared
+libphosphor_logging_la_CXXFLAGS = \
+	$(SDBUSPLUS_CFLAGS)
+
 # Application test which runs in obmc env (qemu, real hardware)
 bin_PROGRAMS = logging-test
 logging_test_SOURCES = logging_test.cpp
diff --git a/elog.cpp b/elog.cpp
new file mode 100644
index 0000000..2b452d4
--- /dev/null
+++ b/elog.cpp
@@ -0,0 +1,14 @@
+#include "elog.hpp"
+
+namespace phosphor
+{
+namespace logging
+{
+
+void commit()
+{
+}
+
+} // namespace logging
+} // namespace phosphor
+
diff --git a/elog.hpp b/elog.hpp
index b445a0e..b340f2d 100644
--- a/elog.hpp
+++ b/elog.hpp
@@ -2,7 +2,7 @@
 
 #include <tuple>
 #include <utility>
-#include "elog-gen.hpp"
+#include "log.hpp"
 
 namespace phosphor
 {
@@ -87,16 +87,8 @@
 /** @fn commit()
  *  @brief Create an error log entry based on journal
  *          entry with a specified MSG_ID
- *  @tparam E - Error log struct
  */
-template <typename E>
-void commit()
-{
-    // TODO placeholder function call
-    // to call the new error log server to create
-    // an error log on the BMC flash
-    // dbus_commit(E.msgid); // call server
-}
+void commit();
 
 /** @fn elog()
  *  @brief Create a journal log entry based on predefined
diff --git a/phosphor-logging.pc.in b/phosphor-logging.pc.in
index 228246a..6ab5119 100644
--- a/phosphor-logging.pc.in
+++ b/phosphor-logging.pc.in
@@ -9,5 +9,5 @@
 Version: @VERSION@
 Requires: @AX_PACKAGE_REQUIRES@
 Requires.private: @AX_PACKAGE_REQUIRES_PRIVATE@
-Libs:
+Libs: -L@libdir@ -lphosphor_logging
 Cflags: -I@includedir@