D Programming/GNU D Compiler

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

GDC is a open-source D compiler using GCC as back end and parts of DMD in the front end. The current version is 0.24 which is based on DMD 1.020.

The website can be found at http://dgcc.sourceforge.net/

[edit] Install GDC on Debian or Ubuntu

GDC is available in Ubuntu Repositories since 7.10 (Gutsy Gibbon).

Also, a debian package does exist for version 0.22 of the GNU D Compiler front end. See http://gdcgnu.sourceforge.net/

Joakim Karlsson has previously made shell script for automatic install. It needs to be updated for the latest version of the GNU D Compiler and the GCC Version.

#!/bin/sh
PREFIX=/opt/gdc
GCC_PACKAGE=gcc-4.0
GDC_SOURCE=gdc-0.17.tar.bz2
GDC_URL=http://home.earthlink.net/~dvdfrdmn/d/${GDC_SOURCE}
mkdir gdc
cd gdc
apt-get source ${GCC_PACKAGE}
tar xzf gcc*.orig.tar.gz
cd *.orig
tar xjf *.tar.bz2
cd gcc*
cd gcc
wget ${GDC_URL}
tar xjf gdc*.tar.bz2
cd ..
gcc/d/setup-gcc.sh
cd ..
gcc*/configure --prefix=${PREFIX} --enable-languages=d
make
sudo make install
Personal tools