1 # Fluoride Bluetooth stack
3 ## Building and running on AOSP
4 Just build AOSP - Fluoride is there by default.
6 ## Building and running on Linux
8 Instructions for Ubuntu, tested on 15.10 with GCC 5.2.1.
10 ### Install required libraries
13 sudo apt-get install libevent-dev
16 ### Install build tools
18 - Install [ninja](https://ninja-build.org/) build system
21 sudo apt-get install ninja-build
24 or download binary from https://github.com/ninja-build/ninja/releases
26 - Install [gn](https://chromium.googlesource.com/chromium/src/tools/gn/) - meta-build system that generates NinjaBuild files.
28 Get sha1 of current version from [here](
29 https://chromium.googlesource.com/chromium/buildtools/+/master/linux64/gn.sha1) and then download corresponding executable:
32 wget -O gn http://storage.googleapis.com/chromium-gn/<gn.sha1>
35 i.e. if sha1 is "3491f6687bd9f19946035700eb84ce3eed18c5fa" (value from 24 Feb 2016) do
38 wget -O gn http://storage.googleapis.com/chromium-gn/3491f6687bd9f19946035700eb84ce3eed18c5fa
41 Then make binary executable and put it on your PATH, i.e.:
53 git clone https://android.googlesource.com/platform/system/bt
56 Then fetch third party dependencies:
62 git clone https://github.com/google/googletest.git
63 git clone https://android.googlesource.com/platform/external/libchrome
64 git clone https://android.googlesource.com/platform/external/modp_b64
65 git clone https://android.googlesource.com/platform/external/tinyxml2
66 git clone https://android.googlesource.com/platform/hardware/libhardware
69 And third party dependencies of third party dependencies:
72 cd fluoride/bt/third_party/libchrome/base/third_party
75 curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/valgrind.h?format=TEXT | base64 -d > valgrind.h
76 curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/memcheck.h?format=TEXT | base64 -d > memcheck.h
79 ### Generate your build files
90 ninja -C out/Default all
93 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```.
98 cd ~/fluoride/bt/out/Default
99 LD_LIBRARY_PATH=./ ./bluetoothtbd -create-ipc-socket=fluoride