环境: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

 

Logo

更多推荐