main: now seeks out shared library handlers are load-time

phosphor-ipmi-blobs now detects blob handlers compiled into shared
libraries on the BMC and loads them at start-up when it's loaded by
phosphor-host-ipmid.

Change-Id: Ib1b6b8f75aa544a263d37f71e133a9a188704de3
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/Makefile.am b/Makefile.am
index 9027e47..2c31b57 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,11 +1,5 @@
 AM_DEFAULT_SOURCE_EXT = .cpp
 
-HANDLERS =
-
-if ENABLE_EXAMPLE
-HANDLERS += example/example.cpp
-endif
-
 libblobcmdsdir = ${libdir}/ipmid-providers
 libblobcmds_LTLIBRARIES = libblobcmds.la
 libblobcmds_la_SOURCES = main.cpp \
@@ -13,8 +7,7 @@
 			 manager.cpp \
 			 process.cpp \
 			 crc.cpp \
-			 utils.cpp \
-			 $(HANDLERS)
+			 utils.cpp
 
 libblobcmds_la_LDFLAGS = $(SYSTEMD_LIBS) \
 			 $(LIBADD_DLOPEN) \
@@ -29,4 +22,14 @@
 	blobs-ipmid/blobs.hpp \
 	blobs-ipmid/manager.hpp
 
+# Always build but only installed if you add the item:
+# BLOBIPMI_PROVIDER_LIBRARY += "libexample.so"
+libexampledir = ${libdir}/blob-providers
+libexample_LTLIBRARIES = libexample.la
+libexample_la_SOURCES = example/example.cpp
+libexample_la_LDFLAGS = $(PHOSPHOR_LOGGING_LIBS) \
+			-version-info 0:0:0 -shared
+libexample_la_CXXFLAGS = $(PHOSPHOR_LOGGING_CFLAGS) \
+			 -flto
+
 SUBDIRS = . test