From 5b9d452cafbfe2b14b29b0d6ce6fafccdfaa81d3 Mon Sep 17 00:00:00 2001 From: Jacob Appelbaum Date: Sun, 25 Oct 2009 02:47:27 +0000 Subject: [PATCH] Build information for building libevent and Tor. svn:r20825 --- BUILD | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/BUILD b/BUILD index 0be1335e..4122dc90 100644 --- a/BUILD +++ b/BUILD @@ -1,7 +1,7 @@ This document explains how to properly build an Android package of Orbot from source. -Please install the following prerequisites: +Please install the following prerequisites (instructions for each follows): Android OS SDK droid-wrapper: http://github.com/tmurakam/droid-wrapper libevent source @@ -39,11 +39,40 @@ Install droid-wrapper: cd droid-wrapper sudo make install -XXX TODO: Explain build process for making a static Tor with our libevent, etc. -zlib and OpenSSL are included with the Android OS SDK. +zlib and OpenSSL are included with the Android OS SDK. You'll need to build +libevent and finally Tor. We'll create an externals directory for this code: -Build libevent: + mkdir -p ~/mydroid/external/{libevent,tor} -Build Tor: +We need to set to environment variables for droid-gcc: + export DROID_ROOT=~/mydroid/ + export DROID_TARGET=generic + +Fetch and build libevent: + + cd ~/mydroid/external/libevent + svn co https://levent.svn.sourceforge.net/svnroot/levent . + cd trunk/libevent/ + export LIBEVENTDIR=`pwd` + ./autogen.sh + CC=droid-gcc LD=droid-ld ./configure --host=arm-none-linux-gnueabi + make + +Fetch and build Tor: + + export OPENSSLDIR=`cd ~/mydroid/external/openssl/include/ && pwd` + export ZLIBDIR=`cd ~/mydroid/external/zlib && pwd` + + cd ~/mydroid/external/tor + git clone https://git.torproject.org/git/tor.git + cd tor/ + CC=droid-gcc LD=droid-ld ./configure --host=arm-none-linux-gnueabi \ + --with-libevent-dir=$LIBEVENTDIR --with-openssl-dir=$OPENSSLDIR \ + --with-zlib-dir=$ZLIBDIR + make + +At this point, you'll have a Tor binary that can be run on an Android handset. +This isn't enough though and we'll now sew up the binary into a small package +that will handle basic Tor controlling features. XXX TODO: Explain build process for making a .apk file for install.