openssl在arm下的交叉编译

http://www.cnblogs.com/weifuqin530/archive/2008/11/29/1343826.html

openssl在arm下的交叉编译

一:openssl在arm下的交叉编译 (一)
1.
./Configure linux-elf-arm -DB_ENDIAN linux:' arm-linux-gcc' shared --prefix=/usr/local/openssl
2.
make
3.
make install
值得注意的是,在arm交叉编译环境中,引用库的顺序为:-lssl -lcrypto,如果为 -lcrypto -lssl就会编译错误
二:openssl在arm下的交叉编译 (二)
1.
./config no-asm shared --prefix=/usr/local/openssl
2.
修改Makefile文件中的CC值: CC=arm-none-linux-gnueabi-gcc
make
3.
make install
使用第一种方式编译出来的是静态链接库,第二种是动态链接库;我使用的是第二种方式;

第二种中也可以直接使用传入参数的方法生成Makefile文件:
CC=arm-none-linux-gnueabi-gcc ./config no-asm shared --prefix=/usr/local/openssl,就可直接使用make命令进行编译,使用make install命令安装。


………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………



http://hi.baidu.com/jinguich/item/8f4dadf170e5891ad7ff8cef

openssl在arm下的交叉编译; 如何在configure时,将编译参数传入,改变默认的编译器gcc成arm-linux-gcc

一:openssl在arm下的交叉编译 (一)
1.
./Configure linux-elf-arm -DB_ENDIAN linux:' arm-linux-gcc' shared --prefix=/usr/local/openssl
2.make3.make install
值得注意的是,在arm交叉编译环境中,引用库的顺序为:-lssl -lcrypto,如果为 -lcrypto -lssl就会编译错误
二:openssl在arm下的交叉编译 (二)
1../config no-asm shared --prefix=/usr/local/openssl
2.修改Makefile CC=arm-none-linux-gnueabi-gccmake
3.make install

使用第一种方式编译出来的是静态链接库,第二种是动态链接库

 

如何在configure时,将编译参数传入,改变默认的编译器gcc成arm-linux-gcc

[jin@localhost ]$ CC=arm-linux-gcc ./configure --prefix=/usr/sbin
....................
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes



checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
....................

[jin@localhost ]$ CFLAGS=-O2 CC=arm-linux-gcc ./configure --cache-file=cache_file_0
loading cache cache_file_0
....................
checking for gcc... arm-linux-gcc
checking whether the C compiler (arm-linux-gcc -O2 ) works... yes
checking whether the C compiler (arm-linux-gcc -O2 ) is a cross-compiler... yes
checking whether we are using GNU C... yes


最好此处在加上--prefix=/usr/sbin,表示具体安装到哪里
[jin@localhost ]$ CFLAGS=-O2 CC=arm-linux-gcc ./configure --cache-file=cache_file_0 --prefix=/usr/sbin
loading cache cache_file_0
....................
checking for gcc... arm-linux-gcc
checking whether the C compiler (arm-linux-gcc -O2 ) works... yes
checking whether the C compiler (arm-linux-gcc -O2 ) is a cross-compiler... yes
checking whether we are using GNU C... yes
....................

其中,/usr/sbin是已经建立好的,已经存在的文件夹,上面这样表示编译后,
将生成的可执行文件安装拷贝到那个目录.

【办法总结】
在./configure的时候,将CC参数放入configure之前,并且要制定cache file,才能完全即时识别编译器:
CC=arm-linux-gcc ./configure --cache-file=cache_file_0




交叉编译OpenSSH

http://blog.rythdev.com/2011/12/cross_compile_openssh/



  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值