Add OemRouter facility.

OemRouter adds a facility to register OEM Group Message handlers,
then dispatch matching messages to the registered handler.
Added as a core source so that any dynamic provider can register its
messages without requiring any specific load order.

Includes code fixes for x86 portability.

Change-Id: I47b8fe7873e3c7fdf35a00d3c8a7e17d30c398c4
Signed-off-by: Peter Hanson <peterh@google.com>
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/Makefile.am b/test/Makefile.am
index cb5640e..cd42b26 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,8 +1,10 @@
-AM_CPPFLAGS = -I$(top_srcdir) $(CODE_COVERAGE_CPPFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir) $(CODE_COVERAGE_CPPFLAGS) $(GTEST_CFLAGS)
 AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
-check_PROGRAMS =
+AM_CXXFLAGS = $(GTEST_MAIN_CFLAGS) $(GTEST_CFLAGS)
+AM_LDFLAGS = $(GTEST_MAIN_LIBS) $(OESDK_TESTCASE_FLAGS)
 
 # Run all 'check' test programs
+check_PROGRAMS =
 TESTS = $(check_PROGRAMS)
 
 # Build/add sample_unittest to test suite
@@ -14,3 +16,8 @@
 sample_unittest_SOURCES = %reldir%/sample_unittest.cpp
 sample_unittest_LDADD = $(top_builddir)/sample.o
 check_PROGRAMS += %reldir%/sample_unittest
+
+# Build/add oemrouter_unittest to test suite
+check_PROGRAMS += oemrouter_unittest
+oemrouter_unittest_SOURCES = oemrouter_unittest.cpp
+oemrouter_unittest_LDADD = $(top_builddir)/oemrouter.o