update_engine: Migrate build system to gyp.

This change migrates the SConstruct file to the platform2 gyp
infrastructure without changing the way UE is compiled. The
code is still compiled as a single static library shared
between delta_generator, update_engine and update_engine_client.

This patch adds two generic .gypi rules to generate bindings for
DBus glib and public keys using openssl.

update_engine_unittests requires to run the openssl version from the
board and not the one on the host. This changes does that by using
SYSROOT when possible.

delta_generator is built without -pie to avoid a bug on how it
is run from au-generator.zip.

BUG=chromium:393293,chromium:394241
TEST=emerge-link update_engine; sudo emerge update_engine
TEST=cros_workon_make --reconf --test update_engine
TEST=cbuildbot link-release amd64-generic-full x86-generic-full
CQ-DEPEND=CL:Id81c7dca798ac8003252259eed03a12a60054437

Change-Id: Icc5e24ac202e552275cd197ee0b9a4a3d9b4a47c
Reviewed-on: https://chromium-review.googlesource.com/208487
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
diff --git a/payload_signer.cc b/payload_signer.cc
index 15c2b32..3d09737 100644
--- a/payload_signer.cc
+++ b/payload_signer.cc
@@ -230,6 +230,10 @@
   cmd[cmd.size() - 3] = hash_path;
   cmd[cmd.size() - 1] = sig_path;
 
+  // When running unittests, we need to use the openssl version from the
+  // SYSROOT instead of the one on the $PATH (host).
+  cmd[0] = utils::GetPathOnBoard("openssl");
+
   int return_code = 0;
   TEST_AND_RETURN_FALSE(Subprocess::SynchronousExec(cmd, &return_code, NULL));
   TEST_AND_RETURN_FALSE(return_code == 0);