summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
author Jack He <siyuanh@google.com> 2016-11-22 12:39:52 -0800
committer Jack He <siyuanh@google.com> 2016-11-23 17:39:05 -0800
commitd4e20db0cf9b2761e828537ed17f62547a930519 (patch)
treee413231b1b3c67c73976477a5d57ccf31ff8a443 /README.md
parent85defca09c07416784a051acf0ca7db80b84338b (diff)
Fix x86_64 compilation on Ubuntu 14.04
* Add necessary includes in bt_trace.h * Add toolchain specific configs * Add libc++ import for clang * Add libc++abi include for clang * Add ipc_handler_linux.cc in service/BUILD.gn * Use shared_mutex when _LIBCPP_VERSION < 3500 * Updated the build instructions Test: ninja -C out/Default Change-Id: I362ebf33f62910be817339cc6bdc62830f57db30
Diffstat (limited to 'README.md')
-rw-r--r--README.md55
1 files changed, 49 insertions, 6 deletions
diff --git a/README.md b/README.md
index 8fb0909a67..a4681ea2e2 100644
--- a/README.md
+++ b/README.md
@@ -5,12 +5,13 @@ Just build AOSP - Fluoride is there by default.
## Building and running on Linux
-Instructions for Ubuntu, tested on 15.10 with GCC 5.2.1.
+Instructions for Ubuntu, tested on 14.04 with Clang 3.5.0 and 16.10 with Clang
+ 3.8.0
### Install required libraries
```sh
-sudo apt-get install libevent-dev
+sudo apt-get install libevent-dev libc++-dev libc++abi-dev
```
### Install build tools
@@ -23,16 +24,19 @@ sudo apt-get install ninja-build
or download binary from https://github.com/ninja-build/ninja/releases
- - Install [gn](https://chromium.googlesource.com/chromium/src/tools/gn/) - meta-build system that generates NinjaBuild files.
+ - Install [gn](https://chromium.googlesource.com/chromium/src/tools/gn/) -
+ meta-build system that generates NinjaBuild files.
Get sha1 of current version from [here](
-https://chromium.googlesource.com/chromium/buildtools/+/master/linux64/gn.sha1) and then download corresponding executable:
+https://chromium.googlesource.com/chromium/buildtools/+/master/linux64/gn.sha1)
+ and then download corresponding executable:
```sh
wget -O gn http://storage.googleapis.com/chromium-gn/<gn.sha1>
```
-i.e. if sha1 is "3491f6687bd9f19946035700eb84ce3eed18c5fa" (value from 24 Feb 2016) do
+i.e. if sha1 is "3491f6687bd9f19946035700eb84ce3eed18c5fa" (value from 24 Feb
+ 2016) do
```sh
wget -O gn http://storage.googleapis.com/chromium-gn/3491f6687bd9f19946035700eb84ce3eed18c5fa
@@ -76,6 +80,20 @@ curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/va
curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/memcheck.h?format=TEXT | base64 -d > memcheck.h
```
+NOTE: If packages/modules/Bluetooth/system is checked out under AOSP, then create symbolic links instead
+of downloading sources
+
+```
+cd packages/modules/Bluetooth/system
+mkdir third_party
+cd third_party
+ln -s ../../../external/libchrome libchrome
+ln -s ../../../external/modp_b64 modp_b64
+ln -s ../../../external/tinyxml2 tinyxml2
+ln -s ../../../hardware/libhardware libhardware
+ln -s ../../../external/googletest googletest
+```
+
### Generate your build files
```sh
@@ -90,7 +108,9 @@ cd ~/fluoride/bt
ninja -C out/Default all
```
-This will build all targets (the shared library, executables, tests, etc) and put them in out/Default. To build an individual target, replace "all" with the target of your choice, e.g. ```ninja -C out/Default net_test_osi```.
+This will build all targets (the shared library, executables, tests, etc) and
+ put them in out/Default. To build an individual target, replace "all" with the
+ target of your choice, e.g. ```ninja -C out/Default net_test_osi```.
### Run
@@ -98,3 +118,26 @@ This will build all targets (the shared library, executables, tests, etc) and pu
cd ~/fluoride/bt/out/Default
LD_LIBRARY_PATH=./ ./bluetoothtbd -create-ipc-socket=fluoride
```
+
+### Eclipse IDE Support
+
+1. Follows the Chromium project
+ [Eclipse Setup Instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_eclipse_dev.md)
+ until "Optional: Building inside Eclipse" section (don't do that section, we
+ will set it up differently)
+
+2. Generate Eclipse settings:
+
+ ```sh
+ cd packages/modules/Bluetooth/system
+ gn gen --ide=eclipse out/Default
+ ```
+
+3. In Eclipse, do File->Import->C/C++->C/C++ Project Settings, choose the XML
+ location under packages/modules/Bluetooth/system/out/Default
+
+4. Right click on the project. Go to Preferences->C/C++ Build->Builder Settings.
+ Uncheck "Use default build command", but instead using "ninja -C out/Default"
+
+5. Goto Behaviour tab, change clean command to "-t clean"
+