-Add README for building go sample application
-Add README for building go system bindings test
-Build rule changes
R=jamesr@chromium.org
Review URL: https://codereview.chromium.org/647573004
diff --git a/build/go/rules.gni b/build/go/rules.gni
index ab703d6..79453d1 100644
--- a/build/go/rules.gni
+++ b/build/go/rules.gni
@@ -53,9 +53,8 @@
rebase_path("//", root_build_dir),
"-I" + rebase_path("//"),
" -L" + rebase_path(target_out_dir) +
- " -L" + rebase_path(root_build_dir + "/obj/third_party/libevent") +
" -l" + static_library_name +
- " -lstdc++ -lpthread -lm -lglib-2.0 -levent",
+ " -lstdc++ -lpthread -lm -lglib-2.0",
"test", "-c",
] + rebase_path(invoker.sources, build_dir)
}
diff --git a/mojo/go/sample_app/README.txt b/mojo/go/sample_app/README.txt
index fbe0c9c..86c4fb2 100644
--- a/mojo/go/sample_app/README.txt
+++ b/mojo/go/sample_app/README.txt
@@ -2,19 +2,32 @@
The application exports a MojoMain entry point for the shell and then makes
a GetTimeTicksNow system call.
-Build instructions
-gn args <output_directory>
+Setup instructions
+
+1) Generate the NDK toolchain for the android platform you plan to use.
+
+$ cd mojo/src/third_party/android_tools/ndk
+$ NDK_ROOT=$HOME/android/ndk-toolchain
+$ ./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$NDK_ROOT
+$ NDK_CC=$NDK_ROOT/bin/arm-linux-androideabi-gcc
+
+2) Download/Install the Go compiler.
+
+$ unset GOBIN GOPATH GOROOT
+$ hg clone https://code.google.com/p/go
+$ cd go/src
+$ CC_FOR_TARGET=$NDK_CC GOOS=android GOARCH=arm GOARM=7 ./make.bash
+$ ls ../bin/go
+
+3) Now, we switch to the Mojo workspace and build the sample application.
+
+$ cd mojo/src
+$ gn args <output_directory>
Set the following arguments
mojo_use_go=true
-go_build_tool=<go_binary_location>
+go_build_tool="<path_to_go_binary>"
os="android"
-gn gen <output_directory>
-ninja -C <output_directory> go_sample_app
-
-You can now following instructions from the below link to run the app.
-http://dev.chromium.org/developers/how-tos/run-mojo-shell
-
-Start the Go application.
-./build/android/adb_run_mojo_shell http://127.0.0.1:4444/go_sample_app
+$ gn gen <output_directory>
+$ ninja -C <output_directory> go_sample_app
diff --git a/mojo/go/tests/README.txt b/mojo/go/tests/README.txt
new file mode 100644
index 0000000..c7b5f22
--- /dev/null
+++ b/mojo/go/tests/README.txt
@@ -0,0 +1,21 @@
+Setup instructions to run system_test
+
+1) Download/Install the Go compiler
+
+$ unset GOBIN GOPATH GOROOT
+$ hg clone https://code.google.com/p/go
+$ cd go/src
+$ ./all.bash
+$ ls ../bin
+
+3) Now, we switch to the Mojo workspace and build system_test
+
+$ cd mojo/src
+$ gn args <output_directory>
+
+mojo_use_go=true
+go_build_tool="<path_to_go_binary>"
+
+$ gn gen <output_directory>
+$ ninja -C <output_directory> system_test
+$ <output_directory>/obj/mojo/go/system_test -test.v
diff --git a/third_party/libevent/BUILD.gn b/third_party/libevent/BUILD.gn
index 648dae3..a1bd0c5 100644
--- a/third_party/libevent/BUILD.gn
+++ b/third_party/libevent/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-static_library("libevent") {
+source_set("libevent") {
sources = [
"buffer.c",
"evbuffer.c",
diff --git a/third_party/modp_b64/BUILD.gn b/third_party/modp_b64/BUILD.gn
index 539abe1..2ec992b 100644
--- a/third_party/modp_b64/BUILD.gn
+++ b/third_party/modp_b64/BUILD.gn
@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-static_library("modp_b64") {
+source_set("modp_b64") {
sources = [
"modp_b64.cc",
"modp_b64.h",