主题 : 求助:curl里Makefile如何指定 交叉编译环境 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 27425
精华: 0
发帖: 4
金钱: 20 两
威望: 4 点
综合积分: 8 分
注册时间: 2010-08-25
最后登录: 2018-02-08
楼主  发表于: 2010-08-25 14:54

 求助:curl里Makefile如何指定 交叉编译环境

使用arm-none-linux-gnueabi-gcc 编译 .c文件时 报错: skipping incompatible ./libcurl.so when searching for -lcurl  ,回头看curl里的libcurl.so ,发现时gcc编译环境下生成的, 请教如何改成arm-none-linux-gnueabi-gcc 交叉编译 啊?
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-08-25 15:47
我用的是curl 7.19.7的源代码包和友善之臂提供的4.3.2版本的工具链。解压后执行
$export PATH=/usr/local/arm/4.3.2/bin:$PATH
$./configure --prefix=/path/to/your/target/filesystem --host=arm-linux
$make && make install (make install需要root权限)

成功后应该会在你的target文件系统的bin目录下生成curl和curl-config, 在lib目录下生成libcurl.so.4.1.1以及指向它的两个符号链接
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 27425
精华: 0
发帖: 4
金钱: 20 两
威望: 4 点
综合积分: 8 分
注册时间: 2010-08-25
最后登录: 2018-02-08
2楼  发表于: 2010-08-25 16:28

 回 1楼(kasim) 的帖子

谢谢版主的解答, 我用的是curl 7.21.1 ,请问4.3.2版本的工具链具体在哪下载的啊,没找到!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2010-08-25 16:40
如果你买的是mini2440或者miro2440的话,配套的光盘上就有。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
级别: 新手上路
UID: 27425
精华: 0
发帖: 4
金钱: 20 两
威望: 4 点
综合积分: 8 分
注册时间: 2010-08-25
最后登录: 2018-02-08
4楼  发表于: 2010-12-06 11:37

 回 3楼(kasim) 的帖子

我想问一下 ,我的是这样 ./configure --prefix=/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi CC=/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc --host=arm-linux   ,编号的libcurl.so 就在prefix  下lib里么?