Version:
Bluez:3.36
Gcc :arm-linux-gcc-3.4.1
所需軟體包:
libxml2-2.7.4
dbus1.0.2
glib-2.16.5
bluez-utils-3.36依賴於dbus和glib,而dbus依賴於libxml2,所以編譯順序是libxml,dbus,glib,bluez-utils-3.36.
流程寫的簡單,其實在我自己的編譯過程中出現了無數的問題,只是都簡化到配置裡面去了,所以configuare一定要配置好.
1.編譯bluez-libs-3.36
./configure --host=arm-linux --prefix="$PWD/../release/bluez_libs"
make&make install
沒有什麼依賴庫的問題,直接編譯通過.
2.編譯libxml2-2.7.4
./configure --prefix="$PWD/../release/bluez_libs" --host=arm-linux
make
make install
沒有依賴庫,順利通過
3.編譯dbus1.0.2
echo ac_cv_have_abstract_sockets=yes>arm-linux.cache
./configure --prefix="$PWD/../release/bluez_libs" --host=arm-linux CC="arm-linux-gcc -I/home/jay/tools/bluez3/release/bluez_libs/include -L/home/jay/tools/bluez3/release/bluez_libs/lib" --cache-file=arm-linux.cache --with-x=no
--with-xml=libxml PKG_CONFIG_PATH="$PWD/../release/bluez_libs/lib/pkgconfig"
make&make install
順利通過了
4.編譯glib-2.16.5
echo ac_cv_type_long_long=yes>arm-linux.cache
echo glib_cv_stack_grows=no>>arm-linux.cache
echo glib_cv_uscore=no>>arm-linux.cache
echo ac_cv_func_posix_getgrgid_r=yes>>arm-linux.cache
echo ac_cv_func_posix_getpwuid_r=yes>>arm-linux.cache
./configure --prefix="$PWD/../release/bluez_libs" --host=arm-linux CC="arm-linux-gcc -I/home/jay/tools/bluez3/release/bluez_libs/include
-L/home/jay/tools/bluez3/release/bluez_libs/lib" --cache-file=arm-linux.cache PKG_CONFIG_PATH="$PWD/../release/bluez_libs/lib/pkgconfig"
#make
#make install
5.編譯bluez-utils-3.36.
./configure --prefix="$PWD/../release/bluez_libs" --host=arm-linux CC="arm-linux-gcc -I/home/jay/tools/bluez3/release/bluez_libs/include -L/home/jay/tools/bluez3/release/bluez_libs/lib -shared" PKG_CONFIG_PATH="$PWD/../release/bluez_libs/lib/pkgconfig"
--disable-audio --enable-test
make&make install
如果不追加-shared,會出現很討厭的__fini_array_start錯誤.
遇到storage.c:286: error: error: `ENOKEY' undeclared
修改storage.c 增加#define ENOKEY 161
至此bluez編譯完畢.
檔案系統的製作:
將sbin和bin下的檔案複製進檔案系統的sbin下面,lib檔案需要的有
libbluetooth.so
libbluetooth.so.2 libbluetooth.so.2.11.2
libxml2.so
libxml2.so.2 libxml2.so.2.7.4
libglib-2.0.so
libglib-2.0.so.0 libglib-2.0.so.0.1600.5
libgmodule-2.0.so.0 libgmodule-2.0.so.0.1600.5
前面是軟連結,後面是本尊
將etc檔案夾複製過去.
最後記得把hcidump(需要另外編譯,沒有任何難度)複製到sbin,它方便調試的