[shill] Switch from home-grown EventQueue to Chrome's MessageLoop

Many other chrome os daemons have borrowed chrome's message loop abstraction,
which supports posting Task and DelayedTask objects to the loop for later
processing.  There are also Callback* objects in there that we can use for
other things, as I've done with the GlibIOInputHandler.  Unit tests contain
some trivial examples.

More documentation in:
base/message_loop.h
base/task.h
base/callback.h

BUG=chromium-os:15105
TEST=build, unit tests

Change-Id: Ia53dcbdf70da45e4ceda7eed1debbc4bb507446e
Reviewed-on: http://gerrit.chromium.org/gerrit/713
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
diff --git a/Makefile b/Makefile
index 72d72a5..580c6be 100644
--- a/Makefile
+++ b/Makefile
@@ -9,14 +9,17 @@
 PKG_CONFIG ?= pkg-config
 DBUSXX_XML2CPP = dbusxx-xml2cpp
 
-
-BASE_LIBS = -lbase -lchromeos -lpthread -lrt
+# libevent, gdk and gtk-2.0 are needed to leverage chrome's MessageLoop
+# TODO(cmasone): explore if newer versions of libbase let us avoid this.
+BASE_LIBS = -lbase -lchromeos -levent -lpthread -lrt
 BASE_INCLUDE_DIRS = -I..
 BASE_LIB_DIRS =
 
 LIBS = $(BASE_LIBS)
-INCLUDE_DIRS = $(BASE_INCLUDE_DIRS) $(shell $(PKG_CONFIG) --cflags glib-2.0)
-LIB_DIRS = $(BASE_LIB_DIRS) $(shell $(PKG_CONFIG) --libs glib-2.0)
+INCLUDE_DIRS = $(BASE_INCLUDE_DIRS) $(shell $(PKG_CONFIG) --cflags glib-2.0 \
+        gdk-2.0 gtk+-2.0)
+LIB_DIRS = $(BASE_LIB_DIRS) $(shell $(PKG_CONFIG) --libs glib-2.0 \
+        gdk-2.0 gtk+-2.0)
 
 TEST_LIBS = $(BASE_LIBS) -lgmock -lgtest
 TEST_INCLUDE_DIRS = $(INCLUDE_DIRS)