libgphoto移植

**注意:
如果检测不带相机,检查libusb-1.0.0,ubuntu安装

apt-get install libusb-1.0-0-dev 
apt-get install libusb-dev 

检查configure打印的内容usb部分**

checking for libusb to use... autodetect
checking for LIBUSB... yes
checking usb.h usability... yes
checking usb.h presence... yes
checking for usb.h... yes
checking for function usb_open in libusb... yes
checking libusb library flags... "-lusb"
checking libusb cpp flags... ""
when doing the ./configure --prefix=/usr/local

需要的库
libusb:https://libusb.info/
libtool:https://github.com/topics/libtool
libgphoto2:http://gphoto.org/
libxml2:移植方式https://blog.csdn.net/qq_32605451/article/details/122667971
编译链为MP157: arm-buildroot-linux-gnueabihf

移植xml2,libiconv ,zlib

https://blog.csdn.net/qq_32605451/article/details/122667971

移植libexif:

 autoreconf -i
./configure --prefix=/ --host=arm-buildroot-linux-gnueabihf  --with-pic
make
make install DESTDIR=/home/han/arm_mp157_libgphoto2

DESTDIR与设置–prefix结果一样,设置安装目录
以上文件打包地址:https://download.csdn.net/download/qq_32605451/76282643

一、编译 libusb

./configure --prefix=/ --host=arm-buildroot-linux-gnueabihf  --with-pic --disable-udev
make
make install DESTDIR=/home/han/arm_mp157_libgphoto2

因为libusb无法生成需要的usb.h文件,所以还需要额外编译0.1 compat兼容支持包,它会产生usb.h!!
下载地址:https://sourceforge.net/projects/libusb/files/libusb-compat-0.1/
本文使用的为libusb-compat-0.1.8
编译安装

./configure --prefix=/home/han/arm_mp157_libgphoto2 --host=arm-buildroot-linux-gnueabihf LIBUSB_1_0_CFLAGS=-I/home/han/arm_mp157_libgphoto2/include/libusb-1.0 PKG_CONFIG_PATH=/home/han/arm_mp157_libgphoto2/lib/pkgconfig
make
make install

如果编译报错没有libusb.h文件,将libusb生成的此文件拷贝到libusb-compat-0.1.8/libusb文件夹下,重新编译即可
PKG_CONFIG_PATH为libusb安装目录下的lib/pkgconfig
安装完成后即可生成需要的usb.h

二、编译libtool

./configure --prefix=/ --host=arm-buildroot-linux-gnueabihf  --with-pic
make
make install DESTDIR=/home/han/arm_mp157_libgphoto2

三、编译libgphoto

./configure \
--prefix=/home/han/arm_mp157_libgphoto2 \
--host=arm-buildroot-linux-gnueabihf \
LDFLAGS='-ldl' \
LIBLTDL=/home/han/arm_mp157_libgphoto2/lib/libltdl.a \
LTDLINCL=-I/home/han/arm_mp157_libgphoto2/include/ \
LIBUSB_LIBS=/home/han/arm_mp157_libgphoto2/lib/libusb1.0.a \
LIBUSB_CFLAGS=-I/home/han/arm_mp157_libgphoto2/include \
LIBEXIF_CFLAGS=-I/home/han/arm_mp157_libgphoto2/include \
LIBEXIF_LIBS=/home/han/arm_mp157_libgphoto2/lib/libexif.a \
LIBXML2_CFLAGS=-I/home/han/arm_mp157_libgphoto2/include/ \
LIBXML2_LIBS=/home/han/arm_mp157_libgphoto2/lib/libxml2.a
make
make install  
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值