update_engine: Remove dependency on libupdate_engine from the client.

The update_engine_client is a very small DBus client that only
depends on a single utils:: function from the update_engine daemon
codebase. Because of this, it was forced to be linked against many
libraries that it didn't use.

This patch factors out this glib helper function to a new
glib_utils.{cc,h} file and includes only that in the
update_engine_client binary.

BUG=chromium:396440
TEST=FEATURES=test emerge-link update_engine

Change-Id: Icf8d8b3c6ebd22cdb39e6674fb3d9071071ec941
Reviewed-on: https://chromium-review.googlesource.com/209472
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/update_engine.gyp b/update_engine.gyp
index 3750673..e8e3723 100644
--- a/update_engine.gyp
+++ b/update_engine.gyp
@@ -92,8 +92,6 @@
       'type': 'static_library',
       'dependencies': [
         'update_metadata-protos',
-        'update_engine-dbus-client',
-        'update_engine-dbus-server',
       ],
       'variables': {
         'exported_deps': [
@@ -152,6 +150,7 @@
         'file_descriptor.cc',
         'file_writer.cc',
         'filesystem_copier_action.cc',
+        'glib_utils.cc',
         'hardware.cc',
         'http_common.cc',
         'http_fetcher.cc',
@@ -199,7 +198,10 @@
     {
       'target_name': 'update_engine',
       'type': 'executable',
-      'dependencies': ['libupdate_engine'],
+      'dependencies': [
+        'libupdate_engine',
+        'update_engine-dbus-server',
+      ],
       'sources': [
         'main.cc',
       ]
@@ -208,8 +210,32 @@
     {
       'target_name': 'update_engine_client',
       'type': 'executable',
-      'dependencies': ['libupdate_engine'],
+      'dependencies': [
+        'update_engine-dbus-client',
+      ],
+      'variables': {
+        'exported_deps': [
+          'dbus-1',
+          'dbus-glib-1',
+          'glib-2.0',
+          'gthread-2.0',
+          'libchrome-<(libbase_ver)',
+          'libchromeos-<(libbase_ver)',
+        ],
+        'deps': ['<@(exported_deps)'],
+      },
+      'link_settings': {
+        'variables': {
+          'deps': [
+            '<@(exported_deps)',
+          ],
+        },
+        'libraries': [
+          '-lgflags',
+        ],
+      },
       'sources': [
+        'glib_utils.cc',
         'update_engine_client.cc',
       ]
     },