
AOSP をビルドするだけです。Fluoride はデフォルトで含まれています。
Ubuntu 向けの手順です。Clang 3.5.0 を使用した 14.04 と、Clang 3.8.0 を使用した 16.10 でテスト済みです。
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" に変更します。