1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
6 <meta http-equiv=
"content-type" content=
"text/html; charset=ISO-8859-1">
9 <title>Build Instructions
</title>
15 <h2>Build Instructions
</h2>
17 <h3>Required source packages
</h3>
21 <li>The
"core" package of a recent GCC
3.4.x,
4.0.x, or
4.1.x
26 <li>The GDC source package
<span style=
"font-weight: bold;">.
</span></li>
30 <h3>Required software
</h3>
34 <li>The usual
<a href=
"http://gcc.gnu.org/install/prerequisites.html">GCC
39 <li>An existing C++ compiler (even if you use
<span style=
"font-family: monospace;">make bootstrap
</span>).
G++
3.x,
40 4.0.1, and later versions
41 are known to work.
G++
2.x and
4.0.0 are
42 known to
<span style=
"font-style: italic;">not
</span>work.
</li>
45 For runtime software requirements, see the
<a href=
"manual.html">user manual
</a>.
50 <li><span style=
"font-style: italic; font-family: monospace;"><srcdir
></span>
51 -- Location of the GCC sources
</li>
53 <li><span style=
"font-style: italic; font-family: monospace;"><builddir
></span>
54 -- Build directory for GCC
</li>
56 <li><span style=
"font-style: italic; font-family: monospace;"><prefix
></span>
57 -- Install directory for GCC
</li>
61 <h3>Building the Compiler and Runtime Library
<br>
67 <li>Unpack the GCC archive.
This creates
<span style=
"font-family: monospace;"><</span><span style=
"font-style: italic; font-family: monospace;">srcdir
</span><span style=
"font-family: monospace;">></span>.
<br>
71 <li>Change to the
<span style=
"font-style: italic; font-family: monospace;"><srcdir
></span><span style=
"font-family: monospace;">/gcc
</span> directory.
</li>
73 <li>Unpack the gdc archive.
This will create a
74 subdirectory named
"<span style="font-family: monospace;
">d</span>".
</li>
76 <li>Change back to
<span style=
"font-style: italic; font-family: monospace;"><srcdir
></span><span style=
"font-family: monospace;"></span> and run the setup script:
<br>
80 <span style=
"font-family: monospace;">./gcc/d/setup-gcc.sh
</span><br>
83 If the source was obtained from Subversion, use
84 <span style=
"font-family: monospace;">--d-language-version
</span>
85 to specify which version of the D language to use:
<br>
87 <span style=
"font-family: monospace;">./gcc/d/setup-gcc.sh --d-language-version=
2</span><br>
90 Note that this creates a file in the
<span style=
"font-family: monospace;">d/
</span> source directory.
<br>
97 <li>Build GCC using the normal
<a href=
"http://gcc.gnu.org/install/">install
98 instructions
</a>.
The
99 only difference is that
"<span style="font-family: monospace;
">d</span>"
100 is added to the
<span style=
"font-family: monospace;">--enable-languages
</span>
105 If you need to specify a compiler
106 to build GCC
<span style=
"font-style: italic;"> </span>other than the
107 system's default, change the
<span style=
"font-family: monospace;">PATH
</span>,
108 or use the
"<span style="font-family: monospace;
">CC</span>"
109 and
"<span style="font-family: monospace;
">CXX</span>" environment
110 variables. Example:
<br>
114 <span style=
"font-family: monospace;">CC=gcc3 CXX=g++
3 <<span style=
"font-style: italic;">srcdir
</span>>/configure
115 --prefix=/usr/local/gcc-
3.4 --enable-languages=c,d,c++
</span><br>
119 Remember to always use
"<span style="font-family: monospace;
">gmake</span>"
120 if GNU Make is not the system's default.
<span style=
"font-style: italic;"></span> <br>
126 <li>Install with
"<span style="font-family: monospace;
">make
127 install</span>".
<br>
133 <h3>Building a Cross Compiler
</h3>
135 (This section is not complete)
<br>
139 Building a cross compiler takes some extra effort now (except for
140 MinGW.)
It will become more automated as people contribute
141 information for various targets.
<br>
145 You will need to create two files (three for a unix target) that are
146 normally generated during a native build.
The files are frag-gen,
147 frag-math, and (for unix) frag-unix.
Here are some ways to create
152 <li>Do a native build on the target.
The files will
153 be in
<span style=
"font-style: italic; font-family: monospace;"><builddir
>/
<target
>/libphobos
</span>.
<br>
157 <li>Look at the existing files in
<span style=
"font-style: italic; font-family: monospace;"><srcdir
></span><span style=
"font-family: monospace;">/gcc/d/phobos/config/mingw
</span> as
158 an example of what is need.
<br>
162 <li>Let the build fail for Phobos.
You will have a working C
163 cross-compiler at that point. Compile gen_config1.c,
164 gen_math.c, gen_unix.c, run them on the target, and copy the resultant
166 to your build system.
</li>
170 Once you have the files, put them in a directory and configure with the
171 option --enable-phobos-config-dir=
<dir
>.
<br>
175 <h3>Runtime Library Notes
<br>
181 <li>To run the unit tests, run
"<span style="font-family: monospace;
">make
182 check-target-libphobos</span>".
<br>
189 <li>On some targets, std.math tests will fail because
191 is no
80-bit real (or library support for it.)
</li>
193 <li>On some targets, std.conv tests will fail because the floating
194 point conversion functions do not work as expected.
<br>
204 <li>On FreeBSD and Linux, the test of the
"%A" format will fail due
205 to a library bug.
<br>