Current method is from openssl wiki.
You just run the make like:
$ NDK_PATH=/path/to/android-ndk-r10d make build- download latest version of openssl.tar.gz
- extract it twice for x86 and arm.
- build for x86
- build for arm
The code in this directory is based on $OPENSSL_VERSION in the file openssl.config, and some backported OpenSSL code in crypto/0.9.9-dev. See patches/README for more information on how the code differs from $OPENSSL_VERSION.
The following steps are recommended for porting new OpenSSL versions.
-
Retrieve the appropriate version of the OpenSSL source from www.openssl.org/source (in openssl-*.tar.gz file). Check the PGP signature (found in matching openssl-*.tar.gz.asc file) with:
gpg openssl-*.tar.gz
If the public key is not found, import the the one with the matching RSA key ID from http://www.openssl.org/about/, using:
gpg --import # paste PGP public key block on stdin
-
Update the variables in openssl.config and openssl.version as appropriate. At the very least you will need to update the openssl.version.
-
Run:
./import_openssl.sh import openssl-*.tar.gz
-
If there are any errors, then modify openssl.config, openssl.version and patches in patches/ as appropriate. You might want to use:
./import_openssl.sh regenerate patches/*.patch
Repeat step 3.
-
Cleanup before building with:
m -j16 clean-openssl clean-libcrypto clean-libssl
-
Build openssl from the external/openssl directory with:
mm -j16
If there are build errors, then patches/*.mk, openssl.config, or android-config.mk may need updating.
-
Run tests to make sure things are working:
(cd android.testssl/ && ./testssl.sh) adb shell run-core-tests tests.xnet.AllTests
-
Do a full build before checking in:
m clobber && m -j16
Optionally, check whether build flags (located in android-config.mk need to be updated. Doing this step will help ensure that the compiled library is appropriately optimized for speed and size. To update build flags:
a. source openssl.config b. tar -zxf openssl-*.tar.gz c. cd openssl-*/ d. ./Configure $CONFIGURE_ARGS e. examine Makefile and compare with ../android-config.mk f. modify ../openssl.config as appropriate and go to step 3) above.
Alternatively, ."/import_openssl.sh import" now prints the post-Configure Makefile for review before deleting in on import.