Skip to content

Instantly share code, notes, and snippets.

@jpf91
Created February 4, 2012 17:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jpf91/1739061 to your computer and use it in GitHub Desktop.
Save jpf91/1739061 to your computer and use it in GitHub Desktop.
#!/bin/sh
BASE_DIR=/home/jpf/Dokumente/Code/android-ndk
cd $BASE_DIR
mkdir toolchain-src
cd toolchain-src
git clone https://android.googlesource.com/toolchain/build.git
mkdir gmp && cd gmp
wget ftp://ftp.gmplib.org/pub/gmp-5.0.3/gmp-5.0.3.tar.bz2
cd ../
mkdir gdb && cd gdb
wget ftp://ftp.gnu.org/gnu/gdb/gdb-7.4.tar.bz2
tar xjf gdb-7.4.tar.bz2
cd ../
mkdir mpc && cd mpc
wget http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
cd ../
mkdir mpfr && cd mpfr
wget http://www.mpfr.org/mpfr-3.0.1/mpfr-3.0.1.tar.bz2
cd ../
mkdir binutils
cd binutils/
wget http://sourceware.mirrors.tds.net/pub/sourceware.org/binutils/snapshots/binutils-2.22.51.tar.bz2
tar xjf binutils-2.22.51.tar.bz2
cd ../
wget http://gcc.gnu.org/bugzilla/attachment.cgi?id=24879 -O gcc-android.patch
mkdir gcc
cd gcc/
wget ftp://ftp.gnu.org//gnu/gcc/gcc-4.6.2/gcc-4.6.2.tar.bz2
tar xjf gcc-4.6.2.tar.bz2
cd gcc-4.6.2
patch -p1 -i ../../gcc-android.patch
cd ../../
hg clone https://bitbucket.org/goshawk/gdc
wget https://raw.github.com/gist/1739039/067d4351f692dfcf5119f1fec06afeebb1de2c2f/gistfile1.diff -O build-druntime.patch
cd gdc
patch -p1 -i ../build-druntime.patch
cd ../
cd gcc/gcc-4.6.2/
ln -s ../../../gdc/d gcc/d
./gcc/d/setup-gcc.sh
cd ../../
wget https://raw.github.com/gist/1737240/08b7eaf3db7de800107c50ca84f379d587171818/gistfile1.diff -O build-d.patch
cd build
patch -p1 -i ../build-d.patch
cd ../
cd $BASE_DIR
wget http://dl.google.com/android/ndk/android-ndk-r7-linux-x86.tar.bz2
tar xjf android-ndk-r7-linux-x86.tar.bz2
wget https://raw.github.com/gist/1737276/4af76432e838d7356d068568009f6adc3829cc01/gistfile1.diff -O build-mpc.patch
cd android-ndk-r7
patch -p1 -i ../build-mpc.patch
cd ../
cd android-ndk-r7/build/tools/
NUM_JOBS=1 DFLAGS="-fno-section-anchors" ./build-gcc.sh --gmp-version=5.0.3 --mpfr-version=3.0.1 --mpc-version=0.9 --binutils-version=2.22.51 --gdb-version=7.4 $BASE_DIR/toolchain-src $BASE_DIR/android-ndk-r7 arm-linux-androideabi-4.6.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment