交叉编译bluez-5.50

环境:ubuntu 14.04

目标:arm板

交叉编译器:arm-poky-linux-gnueabi-gcc   5.3.0

 

configure参数

./configure --prefix=/home/用户/arm/bluez/usr --mandir=/home/用户/arm/bluez/usr/share/man --sysconfdir=/home/用户/arm/bluez/etc --localstatedir=/home/用户/arm/bluez/var --host=arm-none-linux --target=arm-none-linux --with-systemdsystemunitdir=/lib/systemd/system --with-systemduserunitdir=/usr/lib/systemd --with-udevdir=/lib/udev/ --enable-library --enable-static=yes --enable-shared=yes 

configure参数(分行,方便复制)

./configure --prefix=/home/用户/arm/bluez/usr \
--mandir=/home/用户/arm/bluez/usr/share/man \
--sysconfdir=/home/用户/arm/bluez/etc \
--localstatedir=/home/用户/arm/bluez/var \
--host=arm-none-linux \
--target=arm-none-linux \
--with-systemdsystemunitdir=/lib/systemd/system \
--with-systemduserunitdir=/usr/lib/systemd \
--with-udevdir=/lib/udev/ \
--enable-library \
--enable-static=yes \
--enable-shared=yes 

我编译时的错误:

错误1:checking for GLIB... no
configure: error: GLib >= 2.28 is required

安装命令:sudo apt-get install libglib2.0

///

 

错误2:checking for DBUS... no
configure: error: D-Bus >= 1.6 is required

安装命令:sudo apt-get install libdbus-1-dev

///

错误3:checking for UDEV... no
configure: error: libudev >= 172 is required

安装命令:sudo apt-get install  libudev-dev

///

错误4:checking for ICAL... no
configure: error: libical is required

安装命令:sudo apt-get install libical-dev

///

错误5:checking for readline/readline.h... no
configure: error: readline header files are required

安装命令:sudo apt-get install libreadline-dev

///

在常规configure成功后,设置交叉编译环境,我时直接加载交叉编译环境的

source /opt/fsl-imx-fb/qt5/environment-setup-cortexa9hf-neon-poky-linux-gnueabi

 

重新用上面的命令configure,生成Makefile文件,之后

make

sudo make install

make install会报错,修改系统文件失败,而且是修改当前ubuntu14的配置文件,交叉编译的生成文件都应该要复制到arm板的,不知道是不是有些配置不对的问题,不过由于arm板上已经有bluez5.3版本,所以我复制了5.5版本的文件覆盖过去,并没什么问题出现

bluez5.5支持以参数的方式直接调用bluetoothctl,比如:

bluetoothctl connect E3:28:E9:24:21:07

 

而bluez5.3则需要先执行bluetoothctl,然后再输入命令,不过我后来发现可以用如下方式使用

输入 echo -e "<command1>\n<command2>\n" | bluetoothctl 来自动化bluetoothctl命令

 

编译出来的文件如图:

 

 

 

参考:

https://blog.csdn.net/tonyfield2015/article/details/79668445

https://blog.csdn.net/wang_shuai_ww/article/details/41720605

https://blog.csdn.net/u010659887/article/details/85115625

 

  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值