Skip to content

Instantly share code, notes, and snippets.

@gardner
Created May 15, 2016 05:37
Show Gist options
  • Save gardner/a171c9d94a45ae6981635be5a3bf0d16 to your computer and use it in GitHub Desktop.
Save gardner/a171c9d94a45ae6981635be5a3bf0d16 to your computer and use it in GitHub Desktop.
cross compile lib sodium to manually place it before doing npm install
#!/bin/bash
# This assumes that you have android ndk installed at ~/android-ndk-r11c
apt-get install build-essential libssl-dev libtool -y
# check out libsodium
git clone https://github.com/ jedisct1/libsodium.git
export TOOLCHAIN=$PWD/android-toolchain
mkdir -p $TOOLCHAIN
~/android-ndk-r11c/build/tools/make-standalone-toolchain.sh \
--toolchain=arm-linux-androideabi-4.9 \
--arch=arm \
--install-dir=$TOOLCHAIN \
--platform=android-21
export PATH=$TOOLCHAIN/bin:$PATH
export AR=$TOOLCHAIN/bin/arm-linux-androideabi-ar
export CC=$TOOLCHAIN/bin/arm-linux-androideabi-gcc
export CXX=$TOOLCHAIN/bin/arm-linux-androideabi-g++
export LINK=$TOOLCHAIN/bin/arm-linux-androideabi-g++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment