Bluez交叉編譯移植到arm linux

來源:互聯網
上載者:User

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,它方便調試的

   

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.