Skip to content
CromFr edited this page Dec 10, 2014 · 5 revisions

Dub

Via debian package manager:

#!bash
sudo apt-get install dub

GDC for native builds

Via debian package manager:

#!bash
sudo apt-get install gdc

GDC for cross builds ARM

Precompiled binaries

Please contact [email protected] to get the gdc precompiled binaries for ARM

Source compilation

Directories

mkdir /tmp/crossgdc
cd /tmp/crossgdc

Crosstool-ng

#!bash
CTNG_VERSION=1.19.0

cd /tmp/crossgdc
wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-${CTNG_VERSION}.tar.bz2
tar xf crosstool-ng-${CTNG_VERSION}.tar.bz2
cd crosstool-ng-${CTNG_VERSION}
./configure --prefix=$PWD/installed
make -j8 && make install
export PATH=$PATH:$PWD/installed/bin

GCC

#!bash
GCC_VERSION=4.8.2

cd /tmp/crossgdc
wget http://gcc-uk.internet.bs/releases/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.bz2
tar xf gcc-${GCC_VERSION}.tar.bz2

GDC patch

#!bash
cd /tmp/crossgdc
git clone https://github.com/D-Programming-GDC/GDC.git
cd GDC
git checkout gdc-4.8

./setup-gcc.sh /tmp/crossgdc/gcc-${GCC_VERSION}

ct-ng configuration

Open .config and save it in /tmp/crossgdc/.config

You may need to update the line CT_CC_CUSTOM_LOCATION to match the current GCC version.

Change CT_PREFIX_DIR to match the installation path where your non-root user have write access to the dir and the upper dir (/tmp/crossgdc/${CT_TARGET})

Time to build !

#!bash
cd /tmp/crossgdc
ct-ng build arm-unknown-linux-gnueabi

Notes:

  • This may take much time to download needed source and build everything
  • Firewall may block some downloads and stop the process
  • Keep your fingers crossed

Documentation generation

You need ddox to generate a nice documentation:

#!bash
cd /tmp
git clone https://github.com/rejectedsoftware/ddox.git
cd ddox
dub build
sudo cp ddox /usr/local/bin