Compiling OpenSSL on Linux

OpenSSL
OpenSSL is a replacement for SSLeay secure socket layer.
This document reflects my real-world experience in building OpenSSL 0.9.4 (~1.6M) on a Slackware 4.0 Linux 2.2.10 box. A new version appears to come out every two or three months.
Obtaining OpenSSL
OpenSSL Tarball page at http://www.openssl.org/source/ will show you a list of mirror sites you can obtain the latest from. Again, these instructions pertain to just the openssl-0.9.4.tar.gz version.
Untaring
To untar the file, execute tar zxvf openssl-0.9.4.tar.gz. This will produce a subdirectory called openssl-0.9.4 with everything you need inside.
Installation instructions are convienently in a file called INSTALL, this file can be viewed with less INSTALL.
Configuring
Change into the openssl-0.9.4 directory with:
$ cd openssl-0.9.4
Start the configuration process to identify your platform and its capabilities:
$ ./config
To build the software, simply make it:
$ make
...the compile process will take a while to complete...
Test the build to make sure it worked:
$ make test
Now the big step, installing. You'll need to be root in order to do this next phase:
# make install
You'll find your new software is now located in /usr/local/ssl, be sure to check out the bin and include subdirectories. See the INSTALL and README files that explain how you need to specify #include in your source since the include files moved to a subdirectory.
This page last updated       


2 Get openssl directory installed and version info

# which openssl
/usr/bin/openssl

# /usr/bin/openssl version
OpenSSL 0.9.4 14 Mar 2012


Cross platform compile x86 Android version Openssl on Ubuntu

1>下载NDK Linux版本并解压缩

2> 设置工具链

./android-ndk-r10/build/tools/make-standalone-toolchain.sh--platform=android-19 --install-dir=/tmp/my-android-toolchain --arch=x86

export PATH=/tmp/my-android-toolchain/bin:$PATH

export CC=i686-linux-android-gcc

export CXX=i686-linux-android-g++

3> 切换到openssl根目录,配置

    ./config

    ./Configure os/compiler:android-x86      

    这里是target是x86 Android,所以选了flag android-x86。但是似乎选择任意flag都可以,选择这个flag主要是为了将Makefile中的与当前  host机器相关的编译选项去掉,然后能顺利编译。

4> make


http://mobilepearls.com/labs/native-android-api/ndk/docs/STANDALONE-TOOLCHAIN.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值