Openssl for ios

本文档详细介绍了如何在iOS环境下编译OpenSSL库,包括针对i386和armv6架构的编译步骤,涉及配置、修改makefile以及使用gcc进行编译和安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

去官方下载最新的OpenSSL源代码,修改crypto/ui/ui_openssl.c 文件中

static volatile sig_atomic_t intr_signal;=》static volatile int intr_signal;

 

1》编译i386库

 

在终端:

mkdir ssllibs
cd openssl-1.0.0d
mkdir openssl_armv6 openssl_armv7 openssl_i386
./configure BSD-generic32 --openssldir=/Users/<username>/openssl-1.0.0a/openssl_i386

修改makefile文件

找到 CC = gcc 修改为

CC= /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch i386

 

在下一行的CFLAG =,增加-isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk

 

make

make install

 

2》编译armv6库

mv openssl_i386 ../ssllibs
make clean
./configure BSD-generic32 --openssldir=/Users/<username>/openssl-1.0.0a/openssl_armv6

修改makefile文件

找到 CC = gcc 修改为

CC= /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -arch armv6

 

 

在下一行的CFLAG =,增加-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk

make
make install


 

 


 

 

 

// 例子

http://www.x2on.de/2010/07/13/tutorial-iphone-app-with-compiled-openssl-1-0-0a-library/

https://github.com/x2on/OpenSSL-for-iPhone

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值