xref: /netbsd-src/external/gpl3/gcc.old/dist/INSTALL/prerequisites.html (revision 929c70cba110089af68ff46da658d45500ef61a1)
1<html lang="en">
2<head>
3<title>Prerequisites for GCC</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="Prerequisites for GCC">
6<meta name="generator" content="makeinfo 4.13">
7<link title="Top" rel="top" href="#Top">
8<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9<!--
10Copyright (C) 1988-2017 Free Software Foundation, Inc.
11
12   Permission is granted to copy, distribute and/or modify this document
13under the terms of the GNU Free Documentation License, Version 1.3 or
14any later version published by the Free Software Foundation; with no
15Invariant Sections, the Front-Cover texts being (a) (see below), and
16with the Back-Cover Texts being (b) (see below).  A copy of the
17license is included in the section entitled "GNU Free Documentation License".
18
19(a) The FSF's Front-Cover Text is:
20
21     A GNU Manual
22
23(b) The FSF's Back-Cover Text is:
24
25     You have freedom to copy and modify this GNU Manual, like GNU
26     software.  Copies published by the Free Software Foundation raise
27     funds for GNU development.-->
28<meta http-equiv="Content-Style-Type" content="text/css">
29<style type="text/css"><!--
30  pre.display { font-family:inherit }
31  pre.format  { font-family:inherit }
32  pre.smalldisplay { font-family:inherit; font-size:smaller }
33  pre.smallformat  { font-family:inherit; font-size:smaller }
34  pre.smallexample { font-size:smaller }
35  pre.smalllisp    { font-size:smaller }
36  span.sc    { font-variant:small-caps }
37  span.roman { font-family:serif; font-weight:normal; }
38  span.sansserif { font-family:sans-serif; font-weight:normal; }
39--></style>
40</head>
41<body>
42<h1 class="settitle">Prerequisites for GCC</h1>
43<a name="index-Prerequisites-1"></a>
44GCC requires that various tools and packages be available for use in the
45build procedure.  Modifying GCC sources requires additional tools
46described below.
47
48<h3 class="heading"><a name="TOC0"></a>Tools/packages necessary for building GCC</h3>
49
50     <dl>
51<dt>ISO C++98 compiler<dd>Necessary to bootstrap GCC, although versions of GCC prior
52to 4.8 also allow bootstrapping with a ISO C89 compiler and versions
53of GCC prior to 3.4 also allow bootstrapping with a traditional
54(K&amp;R) C compiler.
55
56     <p>To build all languages in a cross-compiler or other configuration where
573-stage bootstrap is not performed, you need to start with an existing
58GCC binary (version 3.4 or later) because source code for language
59frontends other than C might use GCC extensions.
60
61     <p>Note that to bootstrap GCC with versions of GCC earlier than 3.4, you
62may need to use <samp><span class="option">--disable-stage1-checking</span></samp>, though
63bootstrapping the compiler with such earlier compilers is strongly
64discouraged.
65
66     <br><dt>C standard library and headers<dd>
67In order to build GCC, the C standard library and headers must be present
68for all target variants for which target libraries will be built (and not
69only the variant of the host C++ compiler).
70
71     <p>This affects the popular &lsquo;<samp><span class="samp">x86_64-unknown-linux-gnu</span></samp>&rsquo; platform (among
72other multilib targets), for which 64-bit (&lsquo;<samp><span class="samp">x86_64</span></samp>&rsquo;) and 32-bit
73(&lsquo;<samp><span class="samp">i386</span></samp>&rsquo;) libc headers are usually packaged separately. If you do a
74build of a native compiler on &lsquo;<samp><span class="samp">x86_64-unknown-linux-gnu</span></samp>&rsquo;, make sure you
75either have the 32-bit libc developer package properly installed (the exact
76name of the package depends on your distro) or you must build GCC as a
7764-bit only compiler by configuring with the option
78<samp><span class="option">--disable-multilib</span></samp>.  Otherwise, you may encounter an error such as
79&lsquo;<samp><span class="samp">fatal error: gnu/stubs-32.h: No such file</span></samp>&rsquo;
80
81     <br><dt>GNAT<dd>
82In order to build the Ada compiler (GNAT) you must already have GNAT
83installed because portions of the Ada frontend are written in Ada (with
84GNAT extensions.)  Refer to the Ada installation instructions for more
85specific information.
86
87     <br><dt>A &ldquo;working&rdquo; POSIX compatible shell, or GNU bash<dd>
88Necessary when running <samp><span class="command">configure</span></samp> because some
89<samp><span class="command">/bin/sh</span></samp> shells have bugs and may crash when configuring the
90target libraries.  In other cases, <samp><span class="command">/bin/sh</span></samp> or <samp><span class="command">ksh</span></samp>
91have disastrous corner-case performance problems.  This
92can cause target <samp><span class="command">configure</span></samp> runs to literally take days to
93complete in some cases.
94
95     <p>So on some platforms <samp><span class="command">/bin/ksh</span></samp> is sufficient, on others it
96isn't.  See the host/target specific instructions for your platform, or
97use <samp><span class="command">bash</span></samp> to be sure.  Then set <samp><span class="env">CONFIG_SHELL</span></samp> in your
98environment to your &ldquo;good&rdquo; shell prior to running
99<samp><span class="command">configure</span></samp>/<samp><span class="command">make</span></samp>.
100
101     <p><samp><span class="command">zsh</span></samp> is not a fully compliant POSIX shell and will not
102work when configuring GCC.
103
104     <br><dt>A POSIX or SVR4 awk<dd>
105Necessary for creating some of the generated source files for GCC.
106If in doubt, use a recent GNU awk version, as some of the older ones
107are broken.  GNU awk version 3.1.5 is known to work.
108
109     <br><dt>GNU binutils<dd>
110Necessary in some circumstances, optional in others.  See the
111host/target specific instructions for your platform for the exact
112requirements.
113
114     <br><dt>gzip version 1.2.4 (or later) or<dt>bzip2 version 1.0.2 (or later)<dd>
115Necessary to uncompress GCC <samp><span class="command">tar</span></samp> files when source code is
116obtained via FTP mirror sites.
117
118     <br><dt>GNU make version 3.80 (or later)<dd>
119You must have GNU make installed to build GCC.
120
121     <br><dt>GNU tar version 1.14 (or later)<dd>
122Necessary (only on some platforms) to untar the source code.  Many
123systems' <samp><span class="command">tar</span></samp> programs will also work, only try GNU
124<samp><span class="command">tar</span></samp> if you have problems.
125
126     <br><dt>Perl version 5.6.1 (or later)<dd>
127Necessary when targeting Darwin, building &lsquo;<samp><span class="samp">libstdc++</span></samp>&rsquo;,
128and not using <samp><span class="option">--disable-symvers</span></samp>.
129Necessary when targeting Solaris 2 with Sun <samp><span class="command">ld</span></samp> and not using
130<samp><span class="option">--disable-symvers</span></samp>.  The bundled <samp><span class="command">perl</span></samp> in Solaris&nbsp;8
131and up works.
132
133     <p>Necessary when regenerating <samp><span class="file">Makefile</span></samp> dependencies in libiberty.
134Necessary when regenerating <samp><span class="file">libiberty/functions.texi</span></samp>.
135Necessary when generating manpages from Texinfo manuals.
136Used by various scripts to generate some files included in SVN (mainly
137Unicode-related and rarely changing) from source tables.
138
139</dl>
140
141   <p>Several support libraries are necessary to build GCC, some are required,
142others optional.  While any sufficiently new version of required tools
143usually work, library requirements are generally stricter.  Newer
144versions may work in some cases, but it's safer to use the exact
145versions documented.  We appreciate bug reports about problems with
146newer versions, though.  If your OS vendor provides packages for the
147support libraries then using those packages may be the simplest way to
148install the libraries.
149
150     <dl>
151<dt>GNU Multiple Precision Library (GMP) version 4.3.2 (or later)<dd>
152Necessary to build GCC.  If a GMP source distribution is found in a
153subdirectory of your GCC sources named <samp><span class="file">gmp</span></samp>, it will be built
154together with GCC.  Alternatively, if GMP is already installed but it
155is not in your library search path, you will have to configure with the
156<samp><span class="option">--with-gmp</span></samp> configure option.  See also <samp><span class="option">--with-gmp-lib</span></samp>
157and <samp><span class="option">--with-gmp-include</span></samp>.
158The in-tree build is only supported with the GMP version that
159download_prerequisites installs.
160
161     <br><dt>MPFR Library version 2.4.2 (or later)<dd>
162Necessary to build GCC.  It can be downloaded from
163<a href="http://www.mpfr.org/">http://www.mpfr.org/</a>.  If an MPFR source distribution is found
164in a subdirectory of your GCC sources named <samp><span class="file">mpfr</span></samp>, it will be
165built together with GCC.  Alternatively, if MPFR is already installed
166but it is not in your default library search path, the
167<samp><span class="option">--with-mpfr</span></samp> configure option should be used.  See also
168<samp><span class="option">--with-mpfr-lib</span></samp> and <samp><span class="option">--with-mpfr-include</span></samp>.
169The in-tree build is only supported with the MPFR version that
170download_prerequisites installs.
171
172     <br><dt>MPC Library version 0.8.1 (or later)<dd>
173Necessary to build GCC.  It can be downloaded from
174<a href="http://www.multiprecision.org/">http://www.multiprecision.org/</a>.  If an MPC source distribution
175is found in a subdirectory of your GCC sources named <samp><span class="file">mpc</span></samp>, it
176will be built together with GCC.  Alternatively, if MPC is already
177installed but it is not in your default library search path, the
178<samp><span class="option">--with-mpc</span></samp> configure option should be used.  See also
179<samp><span class="option">--with-mpc-lib</span></samp> and <samp><span class="option">--with-mpc-include</span></samp>.
180The in-tree build is only supported with the MPC version that
181download_prerequisites installs.
182
183     <br><dt>isl Library version 0.15 or later.<dd>
184Necessary to build GCC with the Graphite loop optimizations.
185It can be downloaded from <a href="ftp://gcc.gnu.org/pub/gcc/infrastructure/">ftp://gcc.gnu.org/pub/gcc/infrastructure/</a>.
186If an isl source distribution is found
187in a subdirectory of your GCC sources named <samp><span class="file">isl</span></samp>, it will be
188built together with GCC.  Alternatively, the <samp><span class="option">--with-isl</span></samp> configure
189option should be used if isl is not installed in your default library
190search path.
191
192   </dl>
193
194<h3 class="heading"><a name="TOC1"></a>Tools/packages necessary for modifying GCC</h3>
195
196     <dl>
197<dt>autoconf version 2.64<dt>GNU m4 version 1.4.6 (or later)<dd>
198Necessary when modifying <samp><span class="file">configure.ac</span></samp>, <samp><span class="file">aclocal.m4</span></samp>, etc.
199to regenerate <samp><span class="file">configure</span></samp> and <samp><span class="file">config.in</span></samp> files.
200
201     <br><dt>automake version 1.11.6<dd>
202Necessary when modifying a <samp><span class="file">Makefile.am</span></samp> file to regenerate its
203associated <samp><span class="file">Makefile.in</span></samp>.
204
205     <p>Much of GCC does not use automake, so directly edit the <samp><span class="file">Makefile.in</span></samp>
206file.  Specifically this applies to the <samp><span class="file">gcc</span></samp>, <samp><span class="file">intl</span></samp>,
207<samp><span class="file">libcpp</span></samp>, <samp><span class="file">libiberty</span></samp>, <samp><span class="file">libobjc</span></samp> directories as well
208as any of their subdirectories.
209
210     <p>For directories that use automake, GCC requires the latest release in
211the 1.11 series, which is currently 1.11.6.  When regenerating a directory
212to a newer version, please update all the directories using an older 1.11
213to the latest released version.
214
215     <br><dt>gettext version 0.14.5 (or later)<dd>
216Needed to regenerate <samp><span class="file">gcc.pot</span></samp>.
217
218     <br><dt>gperf version 2.7.2 (or later)<dd>
219Necessary when modifying <samp><span class="command">gperf</span></samp> input files, e.g.
220<samp><span class="file">gcc/cp/cfns.gperf</span></samp> to regenerate its associated header file, e.g.
221<samp><span class="file">gcc/cp/cfns.h</span></samp>.
222
223     <br><dt>DejaGnu 1.4.4<dt>Expect<dt>Tcl<dd>
224Necessary to run the GCC testsuite; see the section on testing for
225details.  Tcl 8.6 has a known regression in RE pattern handling that
226make parts of the testsuite fail.  See
227<a href="http://core.tcl.tk/tcl/tktview/267b7e2334ee2e9de34c4b00d6e72e2f1997085f">http://core.tcl.tk/tcl/tktview/267b7e2334ee2e9de34c4b00d6e72e2f1997085f</a>
228for more information.  This bug has been fixed in 8.6.1.
229
230     <br><dt>autogen version 5.5.4 (or later) and<dt>guile version 1.4.1 (or later)<dd>
231Necessary to regenerate <samp><span class="file">fixinc/fixincl.x</span></samp> from
232<samp><span class="file">fixinc/inclhack.def</span></samp> and <samp><span class="file">fixinc/*.tpl</span></samp>.
233
234     <p>Necessary to run &lsquo;<samp><span class="samp">make check</span></samp>&rsquo; for <samp><span class="file">fixinc</span></samp>.
235
236     <p>Necessary to regenerate the top level <samp><span class="file">Makefile.in</span></samp> file from
237<samp><span class="file">Makefile.tpl</span></samp> and <samp><span class="file">Makefile.def</span></samp>.
238
239     <br><dt>Flex version 2.5.4 (or later)<dd>
240Necessary when modifying <samp><span class="file">*.l</span></samp> files.
241
242     <p>Necessary to build GCC during development because the generated output
243files are not included in the SVN repository.  They are included in
244releases.
245
246     <br><dt>Texinfo version 4.7 (or later)<dd>
247Necessary for running <samp><span class="command">makeinfo</span></samp> when modifying <samp><span class="file">*.texi</span></samp>
248files to test your changes.
249
250     <p>Necessary for running <samp><span class="command">make dvi</span></samp> or <samp><span class="command">make pdf</span></samp> to
251create printable documentation in DVI or PDF format.  Texinfo version
2524.8 or later is required for <samp><span class="command">make pdf</span></samp>.
253
254     <p>Necessary to build GCC documentation during development because the
255generated output files are not included in the SVN repository.  They are
256included in releases.
257
258     <br><dt>TeX (any working version)<dd>
259Necessary for running <samp><span class="command">texi2dvi</span></samp> and <samp><span class="command">texi2pdf</span></samp>, which
260are used when running <samp><span class="command">make dvi</span></samp> or <samp><span class="command">make pdf</span></samp> to create
261DVI or PDF files, respectively.
262
263     <br><dt>Sphinx version 1.0 (or later)<dd>
264Necessary to regenerate <samp><span class="file">jit/docs/_build/texinfo</span></samp> from the <samp><span class="file">.rst</span></samp>
265files in the directories below <samp><span class="file">jit/docs</span></samp>.
266
267     <br><dt>SVN (any version)<dt>SSH (any version)<dd>
268Necessary to access the SVN repository.  Public releases and weekly
269snapshots of the development sources are also available via FTP.
270
271     <br><dt>GNU diffutils version 2.7 (or later)<dd>
272Useful when submitting patches for the GCC source code.
273
274     <br><dt>patch version 2.5.4 (or later)<dd>
275Necessary when applying patches, created with <samp><span class="command">diff</span></samp>, to one's
276own sources.
277
278</dl>
279
280   <p><hr />
281<p><a href="./index.html">Return to the GCC Installation page</a>
282
283<!-- ***Downloading the source************************************************** -->
284<!-- ***Configuration*********************************************************** -->
285<!-- ***Building**************************************************************** -->
286<!-- ***Testing***************************************************************** -->
287<!-- ***Final install*********************************************************** -->
288<!-- ***Binaries**************************************************************** -->
289<!-- ***Specific**************************************************************** -->
290<!-- ***Old documentation****************************************************** -->
291<!-- ***GFDL******************************************************************** -->
292<!-- *************************************************************************** -->
293<!-- Part 6 The End of the Document -->
294</body></html>
295
296