标签:.com ibus ble flag wan 运行 abi port 1.0
折腾了两天,终于交叉编译出来lsusb命令可以在单板上跑起来,记录一下
1:编译eudev
下载地址:https://dev.gentoo.org/~blueness/eudev/,版本eudev-3.2.2
#export EUDEV_ROOT=`pwd`
#./configure CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ --host=arm-linux --prefix=$PWD/_install --disable-blkid --disable-kmod
#make -j2
#make install
CFLAGS=-I$EUDEV_ROOT/_install/include LDFLAGS=-L$EUDEV_ROOT/_install/lib
#export PKG_CONFIG_PATH=$PWD/_install/lib/pkgconfig/
查看_install目录
2:编译libusb
下载地址:https://github.com/libusb/libusb/releases?after=v1.0.21-rc4,用的版本为libusb-1.0.18
#export LIBUSB_ROOT=`pwd`
./configure CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ --host=arm-linux CFLAGS=-I$EUDEV_ROOT/_install/include LDFLAGS=-L$EUDEV_ROOT/_install/lib
# make -j2
# make install
查看_install目录
-lpthread
3:编译usbutils,版本usbutils-012
#export PKG_CONFIG_PATH=$EUDEV_ROOT/_install/lib/pkgconfig/:$LIBUSB_ROOT/_install/lib/pkgconfig/
./configure CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ --host=arm-linux --prefix=$PWD/_install
# make -j2
# make install
将新编译出来的lsusb命令拷贝至运行环境(同时需要将对应的libusb库也拷贝至运行环境,同时配置LD_LIBRARY_PATH)
为方便执行,编译为静态库
./configure CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ --host=arm-linux --prefix=$PWD/_install CFLAGS=‘-g -O2 -static‘
修改Makefile文件,在UDEV_LIBS中,添加对pthread库的调用
例如:
UDEV_LIBS = -LCROSS_TOOLCHAINS_ROOT/arm-linux-gnueabihf/libc/usr/lib -lpthread -L/usr1/wangjunhui/usbutils/eudev-3.2.2/_install/lib -ludev
标签:.com ibus ble flag wan 运行 abi port 1.0
原文地址:https://www.cnblogs.com/erhu-67786482/p/10894727.html