openssl for uclinux(嵌入式系统中使用openssl)

Openssl for uclinux

Software Enviroment

OpenSuse 10.0 Linux
 arm-elf toolchains  
OpenSSL 0.9.7c Compiling
1.donwload OpenSSL  0.9.7c from openssl.org2.  download the patch for uclinux:
http://ftp.snapgear.org/pub/patches/openssl-0.9.7c.diff
http://ftp.snapgear.org/pub/patches/openssl-0.9.7c_linux_include.diff
http://ftp.snapgear.org/pub/patches/openssl-0.9.7c_makefile.diff

install openssl(we assume the current working directory: uClinux-dist):

cd lib
tar zxvf ~/tmp/openssl-0.9.7c.tar.gz
mv openssl-0.9.7c libssl
cd libssl
patch -p1 < ~/tmp/openssl.diff

patch the linux kernel:

cd linux-2.4.x/include/openssl
patch -p0 < ~/tmp/openssl_linux_include.diff

patch the openssl makefile.

cd user/openssl
patch -p0 < ~/tmp/openssl_makefile.diff

3. run the configure under the openssl source directory
./configure linux-elf-arm no-shared

4.modify Makefile
replace CC = gcc with CC = arm-elf-gcc
add “-D__PIC__ -fpic -msingle-pic-base -Wl,-elf2flt” to CFLAGS

5. make
6. now we have  libssl.a and libcrypto.a in the source directory
7.copy the include and lib files to the arm-elf toolchains directory

Add the Openssl lib in your applications
add “-D__PIC__ -fpic -msingle-pic-base -Wl,-elf2flt” to the CFLAGS,

add –lssl  –lcrypto to LDFLAGS

that is all :)

这篇文章不是我原创的,是参考了很多国外的资料而成的,最后一部分如何正确的在uclinux使用openssl是我加的。本文发在我的blog上: http://www.info-life.cn  或是参考 http://www.info-life.cn/?p=22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值