
AOSP をビルドするだけです。Fluoride はデフォルトで含まれています。
Ubuntu 向けの手順です。14.04(Clang 3.5.0)および 16.10(Clang 3.8.0)でテスト済みです。
mkdir ~/fluoride
cd ~/fluoride
git clone https://android.googlesource.com/platform/system/bt
依存関係のインストール(sudo 権限が必要です):
cd ~/fluoride/bt
build/install_deps.sh
次に、サードパーティの依存関係を取得します:
cd ~/fluoride/bt
mkdir third_party
cd third_party
git clone https://github.com/google/googletest.git
git clone https://android.googlesource.com/platform/external/aac
git clone https://android.googlesource.com/platform/external/libchrome
git clone https://android.googlesource.com/platform/external/libldac
git clone https://android.googlesource.com/platform/external/modp_b64
git clone https://android.googlesource.com/platform/external/tinyxml2
そして、サードパーティ依存関係のサードパーティ依存関係も取得します:
cd fluoride/bt/third_party/libchrome/base/third_party
mkdir valgrind
cd valgrind
curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/valgrind.h?format=TEXT | base64 -d > valgrind.h
curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/memcheck.h?format=TEXT | base64 -d > memcheck.h
注: system/bt を AOSP 配下でチェックアウトする場合は、ソースをダウンロードせずに シンボリックリンクを作成してください。
cd system/bt
mkdir third_party
cd third_party
ln -s ../../../external/aac aac
ln -s ../../../external/libchrome libchrome
ln -s ../../../external/libldac libldac
ln -s ../../../external/modp_b64 modp_b64
ln -s ../../../external/tinyxml2 tinyxml2
ln -s ../../../external/googletest googletest
cd ~/fluoride/bt
gn gen out/Default
cd ~/fluoride/bt
ninja -C out/Default all
これにより、すべてのターゲット(共有ライブラリ、実行ファイル、テストなど)がビルドされ、
out/Default に配置されます。個別のターゲットをビルドするには、"all" を任意の
ターゲット名に置き換えてください。例: ninja -C out/Default net_test_osi。
cd ~/fluoride/bt/out/Default
LD_LIBRARY_PATH=./ ./bluetoothtbd -create-ipc-socket=fluoride
Chromium プロジェクトの Eclipse セットアップ手順 に従って、"Optional: Building inside Eclipse" セクションまで進みます(そのセクションは行わないでください。後で別の方法で設定します)。
Eclipse 設定を生成します:
cd system/bt
gn gen --ide=eclipse out/Default
Eclipse で File->Import->C/C++->C/C++ Project Settings を選択し、system/bt/out/Default の下にある XML の 場所を選択します。
プロジェクトを右クリックします。Preferences->C/C++ Build->Builder Settings に移動します。 "Use default build command" のチェックを外し、代わりに "ninja -C out/Default" を使用します。
Behaviour タブに移動し、clean コマンドを "-t clean" に変更します。