tinc/README.android

26 lines
1.1 KiB
Text
Raw Permalink Normal View History

2019-08-26 11:44:45 +00:00
Quick how-to cross compile tinc for android (done from $HOME/android/):
2019-08-26 11:44:43 +00:00
- Download android NDK and setup local ARM toolchain:
2019-08-26 11:44:45 +00:00
wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-x86.tar.bz2
tar xfj android-ndk-r9d-linux-x86.tar.bz2
./android-ndk-r9d/build/tools/make-standalone-toolchain.sh --platform=android-5 --install-dir=/tmp/my-android-toolchain
2019-08-26 11:44:43 +00:00
- Download and cross-compile openSSL for ARM:
2019-08-26 11:44:46 +00:00
wget http://www.openssl.org/source/openssl-1.0.1h.tar.gz
tar xfz openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
2019-08-26 11:44:43 +00:00
./Configure dist
make CC=/tmp/my-android-toolchain/bin/arm-linux-androideabi-gcc AR="/tmp/my-android-toolchain/bin/arm-linux-androideabi-ar r" RANLIB=/tmp/my-android-toolchain/bin/arm-linux-androideabi-ranlib
2019-08-26 11:44:46 +00:00
cd -
2019-08-26 11:44:43 +00:00
- Clone and cross-compile tinc:
git clone git://tinc-vpn.org/tinc
cd tinc
autoreconf -fsi
2019-08-26 11:44:45 +00:00
CC=/tmp/my-android-toolchain/bin/arm-linux-androideabi-gcc ./configure --host=arm-linux --disable-lzo --with-openssl-lib=$HOME/android/openssl-1.0.1g --with-openssl-include=$HOME/android/openssl-1.0.1g/include/ --disable-hardening
2019-08-26 11:44:43 +00:00
make -j5
2019-08-26 11:44:45 +00:00
- Strip tincd binary to make it smaller
/tmp/my-android-toolchain/bin/arm-linux-androideabi-strip src/tincd