OpenSSL的建设为Android(ARMv7的)在Win32 [英] Building OpenSSL for Android (ARMv7) on Win32

查看:207
本文介绍了OpenSSL的建设为Android(ARMv7的)在Win32的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何建立OpenSSL的为Android ARM V7(使用Android NDK)在Win32?

How can I build OpenSSL for Android ARM v7 (using Android NDK) on Win32?

推荐答案

直到OpenSSL的维基和setenv-android.sh进行相应的更新,我会在这里发布的配方。所需的修复的过程是:

Until the OpenSSL's wiki and setenv-android.sh are updated accordingly, I'll publish the recipe here. The required fixes to the process are:


  1. 更新setenv-android.sh支持Windows。

  2. 更新路径使用Android NDK的(MinGW的)GNU使(而不是Cygwin的)。

  3. 调用制作使用Windows风格的路径Cygwin的perl的。

  1. Update setenv-android.sh to support Windows.
  2. Update PATH to use Android NDK's (mingw) GNU make (rather than Cygwin's).
  3. Invoke make with a Windows-style path to Cygwin's perl.

这食谱将是Cygwin的一个奇怪的混合动力和MinGW(因为为Win32的Andr​​oid NDK GCC工具链是MinGW的)。我假设一个Windows x86_64的构建了Android NDK解压缩到 C:\\ Android的NDK-r9d ,以及您希望使用GCC 4.8工具链

This recipe will be a strange hybrid of Cygwin and mingw (since Android NDK gcc toolchains for win32 are mingw). I'm assuming a Windows x86_64 build of the Android NDK unpacked into c:\android-ndk-r9d, and that you wish to use a gcc 4.8 toolchain.


  1. 安装Android NDK(废话!)。

  2. 安装Cygwin - 确保包括 perl的

  3. 启动Cygwin的外壳作为管理员,以确保本地符号链接会工作。

在控制台上,运行以下脚本来设置变量:

Within the console, run the following script to set the variables:

export \
  CYGWIN=winsymlinks:native \
  ANDROID_API=android-14 \
  ANDROID_DEV=c:/android-ndk-r9d/platforms/android-14/arch-arm/usr \
  PATH=/cygdrive/c/android-ndk-r9d/prebuilt/windows-x86_64/bin:/cygdrive/c/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin:$PATH \
  MACHINE=armv7 \
  SYSTEM=android \
  ARCH=arm \
  CROSS_COMPILE=arm-linux-androideabi-

现在,解压OpenSSL的:

Now, unpack openssl:


  1. 焦油xzfv的OpenSSL 1.0.1i.tar.gz (或任何你的源码包是)

  2. CD的OpenSSL 1.0.1i (或任何你的版本)

  1. tar xzfv openssl-1.0.1i.tar.gz (or whatever your tarball is)
  2. cd openssl-1.0.1i (or whatever your version is)

请确保您有实际的本地Win32符号连接在include / OpenSSL的(!):

Make sure you have actual native Win32 (!) symlinks in include/openssl:

cmd /c "dir include\openssl"

您应该看到类似这样的:

You should see something like:

13-Aug-14  05:59 PM    <SYMLINK>      aes.h [..\..\crypto\aes\aes.h]
13-Aug-14  05:59 PM    <SYMLINK>      asn1.h [..\..\crypto\asn1\asn1.h]

(等)

现在是时候来配置:

./config shared -no-ssl2 -no-ssl3 -no-comp -no-hw -no-engine --openssldir=/foo/bar

忽略未能建立(由于未能找到perl的)。我们将纠正这个时候了。做到这一点:

Ignore the failure to build (due to failure to find perl). We'll rectify this right away. Do this:

make PERL=$(cygpath -w $(which perl))

现在等待几分钟,直到它建立和preSTO,你有你的libcrypto.so等。

Now wait for a few minutes until it builds, and presto, you have your libcrypto.so etc.

这篇关于OpenSSL的建设为Android(ARMv7的)在Win32的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆