Perfetto: first commit. Introduce build files

This CL sets up the directory structure, build files and
README for Perfetto. The build files are complete enough
to build a hello-world unittest, gtest, gmock and protobuf
from Linux and Mac OSX without depending on any external
tool. This will allow to build the project without a full
Android checkouot and hence being able to get test coverage
on other waterfalls (Chrome, Travis CI) and with a larger
set of compiler toolchains.
The plan is to generate Android.bp build files in the
next CLs to build the same targets also from the Android tree.

Change-Id: I7a15dcfdb24d5f857fc8c3a70757745741b92545
diff --git a/build/BUILDCONFIG.gn b/build/BUILDCONFIG.gn
new file mode 100644
index 0000000..9333196
--- /dev/null
+++ b/build/BUILDCONFIG.gn
@@ -0,0 +1,74 @@
+# Copyright (C) 2017 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+declare_args() {
+  is_debug = true
+  is_clang = true
+
+  ar = "ar"
+  cc = "gcc"
+  cxx = "g++"
+}
+
+# Platform detection
+if (target_os == "") {
+  target_os = host_os
+}
+if (current_os == "") {
+  current_os = target_os
+}
+
+is_android = current_os == "android"
+is_linux = current_os == "linux"
+is_mac = current_os == "mac"
+
+if (target_cpu == "") {
+  target_cpu = host_cpu
+  if (is_android) {
+    target_cpu = "arm"
+  }
+}
+if (current_cpu == "") {
+  current_cpu = target_cpu
+}
+
+default_configs = [
+  "//build:default",
+  "//build:debug_symbols",
+  "//build:extra_warnings",
+]
+
+if (!is_debug) {
+  default_configs += [ "//build:release" ]
+}
+
+set_defaults("source_set") {
+  configs = default_configs
+}
+
+set_defaults("static_library") {
+  configs = default_configs
+}
+
+set_defaults("shared_library") {
+  configs = default_configs
+}
+
+set_defaults("executable") {
+  configs = default_configs
+  configs += [ "//build:executable" ]
+}
+
+set_default_toolchain("//build/toolchain:gcc_like")
+host_toolchain = "//build/toolchain:gcc_like_host"