海思Hi3536交叉编译eudev和libusb库

想编译llibusb-1.0.22:

./configure --host=arm-hisiv400-linux --prefix=`pwd`/install

但发现有如下错误:

...
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
configure: error: udev support requested but libudev header not installed

由此,我们知道海思Hi3536的交叉编译工具链没有找到udev库。由于udev很久没有更新了,现在已被eudev取代。

到 https://dev.gentoo.org/~blueness/eudev/  或github  https://github.com/gentoo/eudev  均可获取eudev源码。写博客时最新的release版本是eudev-3.2.8.tar.gz

安装eudev时(不单是本例子的eudev依赖,其他依赖库也如此),最好安装到arm-hisiv400-linux交叉编译工具链的默认库寻找路径,这样比较省事!

                                /opt/hisi-linux/x86-arm/arm-hisiv400-linux/target/usr/

所以,按如下配置编译eudev:

1, ./configure --host=arm-hisiv400-linux --prefix=/opt/hisi-linux/x86-arm/arm-hisiv400-linux/target/usr/
2, make
3, sudo make install

若出现:
checking for arm-hisiv400-linux-gperf... no
checking for gperf... no
configure: error: *** gperf not found
则需要安装:
sudo apt-get install gperf

        prefix:                  /home/default/work/other/eudev-3.2.8/_install
        exec_prefix:             ${prefix}
        sysconfdir:              ${prefix}/etc
        datadir:                 ${datarootdir}
        includedir:              ${prefix}/include
        bindir:                  ${exec_prefix}/bin
        libdir:                  ${exec_prefix}/lib

        rootprefix:              ${prefix}
        rootlibdir:              ${exec_prefix}/lib
        rootlibexecdir:          ${exec_prefix}/lib/udev
        datarootdir:             ${prefix}/share
        rootrundir:              /run

        udevconfdir:             ${prefix}/etc/udev
        udevconffile:            ${prefix}/etc/udev/udev.conf
        udevhwdbdir:             ${prefix}/etc/udev/hwdb.d
        udevhwdbbin:             ${prefix}/etc/udev/hwdb.bin
        udevlibexecdir:          ${exec_prefix}/lib/udev
        udevkeymapdir:           ${exec_prefix}/lib/udev/keymaps
        udevkeymapforceredir:    ${exec_prefix}/lib/udev/keymaps/force-release
        udevrulesdir:            ${exec_prefix}/lib/udev/rules.d

        pkgconfiglibdir:         ${exec_prefix}/lib/pkgconfig
        sharepkgconfigdir        ${datarootdir}/pkgconfig

        girdir                   ${datarootdir}/gir-1.0
        typelibsdir              ${exec_prefix}/lib/girepository-1.0

最后,回到编译libusb库,继续完成配置,得到Makefile,最后静态编译libusb:

make CFLAGS=-static
make install

 

你可能感兴趣的:(海思视频处理器,嵌入式Linux)