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 14.04 with Clang 3.5.0 and 16.10 with Clang
16 git clone https://android.googlesource.com/platform/system/bt
19 Install dependencies (require sudo access):
26 Then fetch third party dependencies:
32 git clone https://github.com/google/googletest.git
33 git clone https://android.googlesource.com/platform/external/aac
34 git clone https://android.googlesource.com/platform/external/libchrome
35 git clone https://android.googlesource.com/platform/external/libldac
36 git clone https://android.googlesource.com/platform/external/modp_b64
37 git clone https://android.googlesource.com/platform/external/tinyxml2
38 git clone https://android.googlesource.com/platform/hardware/libhardware
41 And third party dependencies of third party dependencies:
44 cd fluoride/bt/third_party/libchrome/base/third_party
47 curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/valgrind.h?format=TEXT | base64 -d > valgrind.h
48 curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/memcheck.h?format=TEXT | base64 -d > memcheck.h
51 NOTE: If system/bt is checked out under AOSP, then create symbolic links instead
52 of downloading sources
58 ln -s ../../../external/aac aac
59 ln -s ../../../external/libchrome libchrome
60 ln -s ../../../external/libldac libldac
61 ln -s ../../../external/modp_b64 modp_b64
62 ln -s ../../../external/tinyxml2 tinyxml2
63 ln -s ../../../hardware/libhardware libhardware
64 ln -s ../../../external/googletest googletest
67 ### Generate your build files
78 ninja -C out/Default all
81 This will build all targets (the shared library, executables, tests, etc) and
82 put them in out/Default. To build an individual target, replace "all" with the
83 target of your choice, e.g. ```ninja -C out/Default net_test_osi```.
88 cd ~/fluoride/bt/out/Default
89 LD_LIBRARY_PATH=./ ./bluetoothtbd -create-ipc-socket=fluoride
92 ### Eclipse IDE Support
94 1. Follows the Chromium project
95 [Eclipse Setup Instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_eclipse_dev.md)
96 until "Optional: Building inside Eclipse" section (don't do that section, we
97 will set it up differently)
99 2. Generate Eclipse settings:
103 gn gen --ide=eclipse out/Default
106 3. In Eclipse, do File->Import->C/C++->C/C++ Project Settings, choose the XML
107 location under system/bt/out/Default
109 4. Right click on the project. Go to Preferences->C/C++ Build->Builder Settings.
110 Uncheck "Use default build command", but instead using "ninja -C out/Default"
112 5. Goto Behaviour tab, change clean command to "-t clean"