configure交叉编译
来源:互联网 发布:上海太平洋保险java 编辑:程序博客网 时间:2024/04/29 08:53
交叉编译某个应用程序时,通常需要 ./configure 来生成对应的 Makefile
./configure 最关键的三个选项是:
--host=HOST
指定软件运行的系统平台.如果没有指定,将会运行`config.guess'来检测.
--build=BUILD
指定软件包安装的系统平台.如果没有指定,默认值将是'--host'选项的值.
--target=GARGET
指定软件面向(target to)的系统平台.这主要在程序语言工具如编译器和汇编器上下文中起作用.如果没有指定,默认将使用'--host'选项的值.
一般而言,我们只要指定 --host 就可以了
记住:--host 指定的是交叉编译工具链的前缀
##################################################################################################################################
在 i686 开发机上交叉编译出 ethtool,让其在powerpc开发板上运行
1.下载源代码并解压
#cd /home/wanghui/
#tar xvfz ethtool-6.tar.gz
#cd ethtool-6
2.交叉编译
确保交叉编译工具链的bin文件在PATH环境变量里
#echo $PATH
/usr/local/bin:/bin:/usr/bin:/opt/montavista41/montavista/cge/devkit/ppc/85xx/bin/:/home/wanghui/bin
#./configure --host=ppc-linux
#make
3.查看生成文件
#file ethtool
ethtool: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
shit! 交叉编译失败,肿么还是X86的bin文件,肯定是configure出了问题,导致Makefile用的不是交叉编译工具链的gcc
4.查看config.log
有这么一句:
configure:1790: checking for ppc-linux-gcc
configure:1819: result: no
configure:1828: checking for gcc
configure:1844: found /usr/bin/gcc
我擦,没找到ppc-linux-gcc
cd /opt/montavista41/montavista/cge/devkit/ppc/85xx/bin
到里面一看,崩溃了,原来是 ppc_85xx-gcc,所有bin文件前缀是 ppc_85xx
5.重新交叉编译
#./configure --host=ppc_85xx
#make
6.查看生成文件
#file ethtool
ethtool: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.4.17, dynamically linked (uses shared libs), not stripped
查看cofig.log
configure:1662: checking for ppc_85xx-strip
configure:1678: found /opt/montavista41/montavista/cge/devkit/ppc/85xx/bin//ppc_85xx-strip
configure:1688: result: ppc_85xx-strip
configure:1757: checking whether to enable maintainer-specific portions of Makefiles
configure:1766: result: no
configure:1790: checking for ppc_85xx-gcc
configure:1806: found /opt/montavista41/montavista/cge/devkit/ppc/85xx/bin//ppc_85xx-gcc
configure:1816: result: ppc_85xx-gcc
7.把ethtool文件放到开发板下运行,OK
./configure 最关键的三个选项是:
--host=HOST
指定软件运行的系统平台.如果没有指定,将会运行`config.guess'来检测.
--build=BUILD
指定软件包安装的系统平台.如果没有指定,默认值将是'--host'选项的值.
--target=GARGET
指定软件面向(target to)的系统平台.这主要在程序语言工具如编译器和汇编器上下文中起作用.如果没有指定,默认将使用'--host'选项的值.
一般而言,我们只要指定 --host 就可以了
记住:--host 指定的是交叉编译工具链的前缀
##################################################################################################################################
在 i686 开发机上交叉编译出 ethtool,让其在powerpc开发板上运行
1.下载源代码并解压
#cd /home/wanghui/
#tar xvfz ethtool-6.tar.gz
#cd ethtool-6
2.交叉编译
确保交叉编译工具链的bin文件在PATH环境变量里
#echo $PATH
/usr/local/bin:/bin:/usr/bin:/opt/montavista41/montavista/cge/devkit/ppc/85xx/bin/:/home/wanghui/bin
#./configure --host=ppc-linux
#make
3.查看生成文件
#file ethtool
ethtool: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
shit! 交叉编译失败,肿么还是X86的bin文件,肯定是configure出了问题,导致Makefile用的不是交叉编译工具链的gcc
4.查看config.log
有这么一句:
configure:1790: checking for ppc-linux-gcc
configure:1819: result: no
configure:1828: checking for gcc
configure:1844: found /usr/bin/gcc
我擦,没找到ppc-linux-gcc
cd /opt/montavista41/montavista/cge/devkit/ppc/85xx/bin
到里面一看,崩溃了,原来是 ppc_85xx-gcc,所有bin文件前缀是 ppc_85xx
5.重新交叉编译
#./configure --host=ppc_85xx
#make
6.查看生成文件
#file ethtool
ethtool: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), for GNU/Linux 2.4.17, dynamically linked (uses shared libs), not stripped
查看cofig.log
configure:1662: checking for ppc_85xx-strip
configure:1678: found /opt/montavista41/montavista/cge/devkit/ppc/85xx/bin//ppc_85xx-strip
configure:1688: result: ppc_85xx-strip
configure:1757: checking whether to enable maintainer-specific portions of Makefiles
configure:1766: result: no
configure:1790: checking for ppc_85xx-gcc
configure:1806: found /opt/montavista41/montavista/cge/devkit/ppc/85xx/bin//ppc_85xx-gcc
configure:1816: result: ppc_85xx-gcc
7.把ethtool文件放到开发板下运行,OK
- configure和交叉编译
- configure交叉编译
- configure交叉编译
- configure交叉编译
- configure交叉编译
- IOS交叉编译configure
- 交叉编译的configure
- configure交叉编译 说明
- configure的交叉编译问题
- Linux交叉编译之configure
- 嵌入式 交叉编译DirectFB以及交叉编译configure详解
- 交叉编译中的configure使用技巧
- mplayer交叉编译configure选项设置
- Linux configure关于交叉编译的参数设置
- linux configure 交叉编译 配置参数
- 交叉编译configure命令参数小解
- configure时静态交叉编译配置
- Linux configure关于交叉编译的参数设置
- android paint paintText 粗体 中文
- ORACLE中ROLLUP 用法
- php正则学习
- 设计模式六大原则(1):单一职责原则
- RabbitMQ安装与监控
- configure交叉编译
- BeanPostProcessor使用心得
- ubuntu安装lamp环境+phpmyadmin
- VC++2012编程演练数据结构《20》索引文件
- 由RGB到HSV颜色空间的理解
- myeclipse中修改tomcat的内存
- UITextView自动滚动的解决方案
- linux上的apache2服务器开启激活和配置端口方法
- Facebook使用应用登陆成功后回调返回认证失败解决方法