Skip to content

Commit b1bfd9a

Browse files
committed
add a brief description of building for Android
1 parent 0c8187f commit b1bfd9a

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

readme.android

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Instructions to build sqlcipher for Android
2+
3+
* Extract Android build toolChain from NDK
4+
1. Download android-ndk-r10e
5+
2. Create android build toolchain
6+
$NDK/build/tools/make-standalone-toolchain.sh --arch=arm --install-dir=<ANDROID_BUILD_TOOLCHAIN>
7+
3. Export some environment variables
8+
export ANDROID_BUILD_TOOLCHAIN=<ANDROID_BUILD_TOOLCHAIN>
9+
export PATH=$ANDROID_BUILD_TOOLCHAIN/bin;$PATH
10+
export CROSS_SYSROOT=$ANDROID_BUILD_TOOLCHAIN/sysroot # important for cross compile
11+
12+
* Build OpenSSL
13+
1. Download openssl-1.1.0g
14+
2. Build OpenSSL
15+
./Configure no-shared --cross-compile-prefix=arm-linux-androideabi- android-armeabi
16+
make
17+
make install DESTDIR=$CROSS_SYSROOT
18+
19+
* Build sqlcipher
20+
./configure --disable-shared --enable-static=yes --enable-tempstore=yes CFLAGS="-fPIE -DSQLITE_HAS_CODEC -I$CROSS_SYSROOT/usr/local/include" LDFLAGS="-fPIE -pie -L$CROSS_SYSROOT/usr/local/lib $CROSS_SYSROOT/usr/local/lib/libcrypto.a" --host=arm-linux-androideabi
21+
make

0 commit comments

Comments
 (0)