ubuntu交叉编译试用于openwrt的i2c-tools

本文介绍了如何在Ubuntu系统中,为OpenWrt进行i2c-tools的交叉编译步骤,包括下载源码、解压、配置交叉编译器、打包并传输到目标板,最后在目标板上进行测试验证安装成功。

1、下载

到Github下载i2c-tools源码 https://github.com/groeck/i2c-tools

2、解压

unzip i2c-tools-master.zip

3、交叉编译

cd   i2c-tools-master

 make CC=~/mt7688/CC_TOOLS/bin/mipsel-openwrt-linux-gcc

我这里Openwrt的交叉编译器的地址是在我的主目录~/mt7688/CC_TOOLS/bin下,编译结果在i2c-tools-master/tools下,所需的库在i2c-tools-master/lib下

4、打包,建立一个openwrt-i2ctool文件夹,纺织i2c-tools可执行程序和库

cd   tools

cp i2cdetect i2cset i2cget i2cdump  ../openwrt-i2ctool/

cd 

zsc@ubuntu:/code/openwrt-15.05.1$ awk --version # 应≤4.1.0 GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0) Copyright (C) 1989, 1991-2015 Free Software Foundation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. zsc@ubuntu:/code/openwrt-15.05.1$ bash --version # 应≤4.3.0 GNU bash, version 4.3.48(1)-release (i686-pc-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. zsc@ubuntu:/code/openwrt-15.05.1$ perl -v # 应≤5.20.0 This is perl 5, version 22, subversion 1 (v5.22.1) built for i686-linux-gnu-thread-multi-64int (with 77 registered patches, see perl -V for more detail) Copyright 1987-2015, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.
最新发布
08-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值