• <ul id="mayc0"></ul>
    <ul id="mayc0"><center id="mayc0"></center></ul>
    <strike id="mayc0"><input id="mayc0"></input></strike>
    <ul id="mayc0"></ul>
  • 始創于2000年 股票代碼:831685
    咨詢熱線:0371-60135900 注冊有禮 登錄
    • 掛牌上市企業
    • 60秒人工響應
    • 99.99%連通率
    • 7*24h人工
    • 故障100倍補償
    您的位置: 網站首頁 > 幫助中心>文章內容

    ARM上交叉編譯藍牙Bluez

    發布時間:  2012/8/27 17:16:26

    dbus-1.2.16.tar.gz  download

    Bluez交叉編譯移植到arm linux .
    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,它方便調試的

    以下是Leeu我的編譯遇到 的問題.

    libusb 要用到g++
    ./configure --prefix=/opt/libs --host=arm-linux CC="arm-none-linux-gnueabi-gcc" CXX=arm-none-linux-gnueabi-g++  

    dbus的編譯,把下面整個一起執行

    USE_ARCH=32 NM=nm CC="arm-none-linux-gnueabi-gcc ${BUILD32}" ./configure --prefix=/opt/libs --host=arm-linux --target=arm-linux     CC="arm-none-linux-gnueabi-gcc -I/opt/libs/include -L/opt/libs/lib" --cache-file=arm-linux.cache --with-x=no
    否則會報libtool中 eval的錯誤

    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=/opt/libs --host=arm-linux CC="arm-none-linux-gnueabi-gcc -I/opt/libs/include -L/opt/libs/lib" --cache-file=arm-linux.cache PKG_CONFIG_PATH=/opt/libs/lib/pkgconfig

    #make
    #make install

    buluz-utils
    ./configure --prefix=/opt/libs --host=arm-linux CC="arm-none-linux-gnueabi-gcc -I/opt/libs/include -L/opt/libs/lib -shared" PKG_CONFIG_PATH=/opt/libs/lib/pkgconfig --disable-audio
    去掉--enable-test
    過程會報找不到yacc, flex等命令,安裝命令即可

    這樣就編譯好了。


     


    本文出自:億恩科技【www.vbseamall.com】

    服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]

  • 您可能在找
  • 億恩北京公司:
  • 經營性ICP/ISP證:京B2-20150015
  • 億恩鄭州公司:
  • 經營性ICP/ISP/IDC證:豫B1.B2-20060070
  • 億恩南昌公司:
  • 經營性ICP/ISP證:贛B2-20080012
  • 服務器/云主機 24小時售后服務電話:0371-60135900
  • 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
  • 專注服務器托管17年
    掃掃關注-微信公眾號
    0371-60135900
    Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權所有  地址:鄭州市高新區翠竹街1號總部企業基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網安備41019702002023號
      1
     
     
     
     

    0371-60135900
    7*24小時客服服務熱線