Build Instructions

Required source packages

Required software

For runtime software requirements, see the user manual.


Building the Compiler and Runtime Library

  1. Unpack the GCC archive.  This creates <srcdir>.
  2. Change to the <srcdir>/gcc directory.
  3. Unpack the gdc archive.  This will create a subdirectory named "d".
  4. Change back to <srcdir> and run the setup script:


  5. Build GCC using the normal install instructions.  The only difference is that "d" is added to the --enable-languages option.

    If you need to specify a compiler to build GCC other than the system's default, change the PATH, or use the "CC" and "CXX" environment variables. Example:

    CC=gcc3 CXX=g++3 <srcdir>/configure --prefix=/usr/local/gcc-3.4 --enable-languages=c,d,c++

    Remember to always use "gmake" if GNU Make is not the system's default. 

  6. Install with "make install".

Building a Cross Compiler

(This section is not complete)

Building a cross compiler takes some extra effort now (except for MinGW.)  It will become more automated as people contribute information for various targets.

You will need to create two files (three for a unix target) that are normally generated during a native build.  The files are frag-gen, frag-math, and (for unix) frag-unix.  Here are some ways to create the files:
Once you have the files, put them in a directory and configure with the option --enable-phobos-config-dir=<dir>.

Runtime Library Notes