Use the boost endian library for storing/retrieving size

When serializing/deserializing the size, use the boost endian
library and its built-in conversion instead of defining custom
functions.

Signed-off-by: Kun Yi <kunyi@google.com>
Change-Id: I903a492d8d5fa5deb87a3a78e31a57317db39047
diff --git a/Makefile.am b/Makefile.am
index 2ad19a0..33d8ac5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,6 +6,11 @@
 AM_DEFAULT_SOURCE_EXT = .cpp
 SUFFIXES = .proto .pb.cc
 
+BOOST_CXX = \
+	-DBOOST_ERROR_CODE_HEADER_ONLY \
+	-DBOOST_SYSTEM_NO_DEPRECATED \
+	-DBOOST_ALL_NO_LIB
+
 libbinarystoredir = ${libdir}/ipmid-providers
 libbinarystore_LTLIBRARIES = libbinarystore.la
 libbinarystore_la_SOURCES = main.cpp \
@@ -20,6 +25,7 @@
 			    -lprotobuf
 
 libbinarystore_la_CXXFLAGS = -I$(srcdir) $(PHOSPHOR_LOGGING_CFLAGS) \
+			     $(BOOST_CXX) \
 			     -flto
 
 binaryblob.pb.h binaryblob.pb.cc: $(srcdir)/$(PROTOS_PATH)/binaryblob.proto