Created
May 2, 2012 17:41
-
-
Save n8fr8/2578592 to your computer and use it in GitHub Desktop.
build script for Orbot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# begin by defining NDK_ROOT | |
if test -z $NDK_ROOT; then echo "NDK_ROOT is not exported, do so by something close to this: export NDK_ROOT=/path/to/android-ndk-r5"; exit; fi | |
#Build openssl using default ndk-build | |
echo "BUILD OPENSSL" | |
cd native | |
git clone [email protected]:guardianproject/openssl-android.git | |
cd openssl-android | |
ndk-build | |
cp libs/armeabi/* ../lib | |
cp -R include/openssl ../include | |
cd ../.. | |
echo "SETTING UP CROSS COMPILER" | |
# export needed variables | |
export NDK_TOOLCHAIN=$NDK_ROOT/my-android-toolchain | |
# remove the old toolchain | |
rm -rf $NDK_TOOLCHAIN/* | |
# create the toolchain | |
$NDK_ROOT/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$NDK_TOOLCHAIN | |
# export needed variables for crosscompile | |
export PATH="$NDK_TOOLCHAIN/bin/:$PATH" | |
export HOST=arm-linux-androideabi | |
export CC=$HOST-gcc | |
export CXX=$HOST-g++ | |
export AR=$HOST-ar | |
export LD=$HOST-ld | |
export AS=$HOST-as | |
export NM=$HOST-nm | |
export STRIP=$HOST-strip | |
export RANLIB=$HOST-ranlib | |
export OBJDUMP=$HOST-objdump | |
export CPPFLAGS="--sysroot=$NDK_TOOLCHAIN/sysroot -I$NDK_TOOLCHAIN/sysroot/usr/include -I$NDK_TOOLCHAIN/include" | |
export LDFLAGS="-L$NDK_TOOLCHAIN/sysroot/usr/lib -L$NDK_TOOLCHAIN/lib" | |
#export LIBS="-lc" | |
mkdir native | |
mkdir native/lib | |
mkdir native/include | |
#Build libevent | |
echo "BUILD LIBEVENT" | |
mkdir native/libevent | |
cd native/libevent | |
svn co https://levent.svn.sourceforge.net/svnroot/levent/tags/release-1.4.13-stable/libevent/ . | |
./autogen.sh | |
./configure --host=arm-linux-eabi --build=$BUILD --prefix=$NDK_TOOLCHAIN | |
make | |
cp .libs/libevent.a ../lib | |
cp *.h ../include | |
cd ../.. | |
#Build Tor | |
echo "BUILD TOR" | |
cd native | |
git clone git://git.torproject.org/git/tor.git | |
cd tor/ | |
./autogen.sh | |
./configure --host=arm-linux-eabi --build=$BUILD --prefix=$NDK_TOOLCHAIN --disable-asciidoc --with-libevent-dir=$PWD/../ --enable-static-libevent --with-openssl-dir=$PWD/../ | |
make | |
cd ../.. | |
#Build JTorControl | |
cd libs | |
git clone git://git.torproject.org/git/jtorctl | |
cd jtorctl | |
mkdir bin | |
javac net/freehaven/tor/control/TorControlConnection.java -d bin | |
cd bin | |
jar cvf jtorctrl.jar * | |
cp jtorctrl.jar ../.. | |
cd ../../.. | |
#BUILD privoxy | |
mkdir native/privoxy | |
cd native/privoxy | |
wget http://sourceforge.net/projects/ijbswa/files/Sources/3.0.12%20%28stable%29/privoxy-3.0.12-stable-src.tar.gz/download | |
tar xzvf download | |
cd privoxy-3.0.12-stable | |
autoheader | |
autoconf | |
#need to disable setpgrp check in configure | |
export ac_cv_func_setpgrp_void=yes | |
./configure --host=arm-linux-eabi --build=$BUILD --prefix=$NDK_TOOLCHAIN --disable-pthread | |
make | |
cd ../../.. | |
mkdir assets | |
cp native/privoxy/privoxy-3.0.12-stable/privoxy assets | |
cp native/tor/tor assets |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment