prerequisites.html revision 1.1.1.4
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.12"> 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-2015 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&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>GNAT<dd> 67In order to build the Ada compiler (GNAT) you must already have GNAT 68installed because portions of the Ada frontend are written in Ada (with 69GNAT extensions.) Refer to the Ada installation instructions for more 70specific information. 71 72 <br><dt>A “working” POSIX compatible shell, or GNU bash<dd> 73Necessary when running <samp><span class="command">configure</span></samp> because some 74<samp><span class="command">/bin/sh</span></samp> shells have bugs and may crash when configuring the 75target libraries. In other cases, <samp><span class="command">/bin/sh</span></samp> or <samp><span class="command">ksh</span></samp> 76have disastrous corner-case performance problems. This 77can cause target <samp><span class="command">configure</span></samp> runs to literally take days to 78complete in some cases. 79 80 <p>So on some platforms <samp><span class="command">/bin/ksh</span></samp> is sufficient, on others it 81isn't. See the host/target specific instructions for your platform, or 82use <samp><span class="command">bash</span></samp> to be sure. Then set <samp><span class="env">CONFIG_SHELL</span></samp> in your 83environment to your “good” shell prior to running 84<samp><span class="command">configure</span></samp>/<samp><span class="command">make</span></samp>. 85 86 <p><samp><span class="command">zsh</span></samp> is not a fully compliant POSIX shell and will not 87work when configuring GCC. 88 89 <br><dt>A POSIX or SVR4 awk<dd> 90Necessary for creating some of the generated source files for GCC. 91If in doubt, use a recent GNU awk version, as some of the older ones 92are broken. GNU awk version 3.1.5 is known to work. 93 94 <br><dt>GNU binutils<dd> 95Necessary in some circumstances, optional in others. See the 96host/target specific instructions for your platform for the exact 97requirements. 98 99 <br><dt>gzip version 1.2.4 (or later) or<dt>bzip2 version 1.0.2 (or later)<dd> 100Necessary to uncompress GCC <samp><span class="command">tar</span></samp> files when source code is 101obtained via FTP mirror sites. 102 103 <br><dt>GNU make version 3.80 (or later)<dd> 104You must have GNU make installed to build GCC. 105 106 <br><dt>GNU tar version 1.14 (or later)<dd> 107Necessary (only on some platforms) to untar the source code. Many 108systems' <samp><span class="command">tar</span></samp> programs will also work, only try GNU 109<samp><span class="command">tar</span></samp> if you have problems. 110 111 <br><dt>Perl version 5.6.1 (or later)<dd> 112Necessary when targeting Darwin, building ‘<samp><span class="samp">libstdc++</span></samp>’, 113and not using <samp><span class="option">--disable-symvers</span></samp>. 114Necessary when targeting Solaris 2 with Sun <samp><span class="command">ld</span></samp> and not using 115<samp><span class="option">--disable-symvers</span></samp>. The bundled <samp><span class="command">perl</span></samp> in Solaris 8 116and up works. 117 118 <p>Necessary when regenerating <samp><span class="file">Makefile</span></samp> dependencies in libiberty. 119Necessary when regenerating <samp><span class="file">libiberty/functions.texi</span></samp>. 120Necessary when generating manpages from Texinfo manuals. 121Used by various scripts to generate some files included in SVN (mainly 122Unicode-related and rarely changing) from source tables. 123 124 <br><dt><samp><span class="command">jar</span></samp>, or InfoZIP (<samp><span class="command">zip</span></samp> and <samp><span class="command">unzip</span></samp>)<dd> 125Necessary to build libgcj, the GCJ runtime. 126 127</dl> 128 129 <p>Several support libraries are necessary to build GCC, some are required, 130others optional. While any sufficiently new version of required tools 131usually work, library requirements are generally stricter. Newer 132versions may work in some cases, but it's safer to use the exact 133versions documented. We appreciate bug reports about problems with 134newer versions, though. If your OS vendor provides packages for the 135support libraries then using those packages may be the simplest way to 136install the libraries. 137 138 <dl> 139<dt>GNU Multiple Precision Library (GMP) version 4.3.2 (or later)<dd> 140Necessary to build GCC. If a GMP source distribution is found in a 141subdirectory of your GCC sources named <samp><span class="file">gmp</span></samp>, it will be built 142together with GCC. Alternatively, if GMP is already installed but it 143is not in your library search path, you will have to configure with the 144<samp><span class="option">--with-gmp</span></samp> configure option. See also <samp><span class="option">--with-gmp-lib</span></samp> 145and <samp><span class="option">--with-gmp-include</span></samp>. 146 147 <br><dt>MPFR Library version 2.4.2 (or later)<dd> 148Necessary to build GCC. It can be downloaded from 149<a href="http://www.mpfr.org/">http://www.mpfr.org/</a>. If an MPFR source distribution is found 150in a subdirectory of your GCC sources named <samp><span class="file">mpfr</span></samp>, it will be 151built together with GCC. Alternatively, if MPFR is already installed 152but it is not in your default library search path, the 153<samp><span class="option">--with-mpfr</span></samp> configure option should be used. See also 154<samp><span class="option">--with-mpfr-lib</span></samp> and <samp><span class="option">--with-mpfr-include</span></samp>. 155 156 <br><dt>MPC Library version 0.8.1 (or later)<dd> 157Necessary to build GCC. It can be downloaded from 158<a href="http://www.multiprecision.org/">http://www.multiprecision.org/</a>. If an MPC source distribution 159is found in a subdirectory of your GCC sources named <samp><span class="file">mpc</span></samp>, it 160will be built together with GCC. Alternatively, if MPC is already 161installed but it is not in your default library search path, the 162<samp><span class="option">--with-mpc</span></samp> configure option should be used. See also 163<samp><span class="option">--with-mpc-lib</span></samp> and <samp><span class="option">--with-mpc-include</span></samp>. 164 165 <br><dt>ISL Library version 0.11.1<dd> 166Necessary to build GCC with the Graphite loop optimizations. 167It can be downloaded from <a href="ftp://gcc.gnu.org/pub/gcc/infrastructure/">ftp://gcc.gnu.org/pub/gcc/infrastructure/</a> 168as <samp><span class="file">isl-0.11.1.tar.bz2</span></samp>. 169 170 <p>The <samp><span class="option">--with-isl</span></samp> configure option should be used if ISL is not 171installed in your default library search path. 172 173 <br><dt>CLooG 0.18.0<dd> 174Necessary to build GCC with the Graphite loop optimizations. It can be 175downloaded from <a href="ftp://gcc.gnu.org/pub/gcc/infrastructure/">ftp://gcc.gnu.org/pub/gcc/infrastructure/</a> as 176<samp><span class="file">cloog-0.18.0.tar.gz</span></samp>. The <samp><span class="option">--with-cloog</span></samp> configure option should 177be used if CLooG is not installed in your default library search path. 178CLooG needs to be built against ISL 0.11.1. Use <samp><span class="option">--with-isl=system</span></samp> 179to direct CLooG to pick up an already installed ISL, otherwise it will use 180ISL 0.11.1 as bundled with CLooG. CLooG needs to be configured to use GMP 181internally, use <samp><span class="option">--with-bits=gmp</span></samp> to direct it to do that. 182 183 </dl> 184 185<h3 class="heading"><a name="TOC1"></a>Tools/packages necessary for modifying GCC</h3> 186 187 <dl> 188<dt>autoconf version 2.64<dt>GNU m4 version 1.4.6 (or later)<dd> 189Necessary when modifying <samp><span class="file">configure.ac</span></samp>, <samp><span class="file">aclocal.m4</span></samp>, etc. 190to regenerate <samp><span class="file">configure</span></samp> and <samp><span class="file">config.in</span></samp> files. 191 192 <br><dt>automake version 1.11.1<dd> 193Necessary when modifying a <samp><span class="file">Makefile.am</span></samp> file to regenerate its 194associated <samp><span class="file">Makefile.in</span></samp>. 195 196 <p>Much of GCC does not use automake, so directly edit the <samp><span class="file">Makefile.in</span></samp> 197file. Specifically this applies to the <samp><span class="file">gcc</span></samp>, <samp><span class="file">intl</span></samp>, 198<samp><span class="file">libcpp</span></samp>, <samp><span class="file">libiberty</span></samp>, <samp><span class="file">libobjc</span></samp> directories as well 199as any of their subdirectories. 200 201 <p>For directories that use automake, GCC requires the latest release in 202the 1.11 series, which is currently 1.11.1. When regenerating a directory 203to a newer version, please update all the directories using an older 1.11 204to the latest released version. 205 206 <br><dt>gettext version 0.14.5 (or later)<dd> 207Needed to regenerate <samp><span class="file">gcc.pot</span></samp>. 208 209 <br><dt>gperf version 2.7.2 (or later)<dd> 210Necessary when modifying <samp><span class="command">gperf</span></samp> input files, e.g. 211<samp><span class="file">gcc/cp/cfns.gperf</span></samp> to regenerate its associated header file, e.g. 212<samp><span class="file">gcc/cp/cfns.h</span></samp>. 213 214 <br><dt>DejaGnu 1.4.4<dt>Expect<dt>Tcl<dd> 215Necessary to run the GCC testsuite; see the section on testing for details. 216 217 <br><dt>autogen version 5.5.4 (or later) and<dt>guile version 1.4.1 (or later)<dd> 218Necessary to regenerate <samp><span class="file">fixinc/fixincl.x</span></samp> from 219<samp><span class="file">fixinc/inclhack.def</span></samp> and <samp><span class="file">fixinc/*.tpl</span></samp>. 220 221 <p>Necessary to run ‘<samp><span class="samp">make check</span></samp>’ for <samp><span class="file">fixinc</span></samp>. 222 223 <p>Necessary to regenerate the top level <samp><span class="file">Makefile.in</span></samp> file from 224<samp><span class="file">Makefile.tpl</span></samp> and <samp><span class="file">Makefile.def</span></samp>. 225 226 <br><dt>Flex version 2.5.4 (or later)<dd> 227Necessary when modifying <samp><span class="file">*.l</span></samp> files. 228 229 <p>Necessary to build GCC during development because the generated output 230files are not included in the SVN repository. They are included in 231releases. 232 233 <br><dt>Texinfo version 4.7 (or later)<dd> 234Necessary for running <samp><span class="command">makeinfo</span></samp> when modifying <samp><span class="file">*.texi</span></samp> 235files to test your changes. 236 237 <p>Necessary for running <samp><span class="command">make dvi</span></samp> or <samp><span class="command">make pdf</span></samp> to 238create printable documentation in DVI or PDF format. Texinfo version 2394.8 or later is required for <samp><span class="command">make pdf</span></samp>. 240 241 <p>Necessary to build GCC documentation during development because the 242generated output files are not included in the SVN repository. They are 243included in releases. 244 245 <br><dt>TeX (any working version)<dd> 246Necessary for running <samp><span class="command">texi2dvi</span></samp> and <samp><span class="command">texi2pdf</span></samp>, which 247are used when running <samp><span class="command">make dvi</span></samp> or <samp><span class="command">make pdf</span></samp> to create 248DVI or PDF files, respectively. 249 250 <br><dt>SVN (any version)<dt>SSH (any version)<dd> 251Necessary to access the SVN repository. Public releases and weekly 252snapshots of the development sources are also available via FTP. 253 254 <br><dt>GNU diffutils version 2.7 (or later)<dd> 255Useful when submitting patches for the GCC source code. 256 257 <br><dt>patch version 2.5.4 (or later)<dd> 258Necessary when applying patches, created with <samp><span class="command">diff</span></samp>, to one's 259own sources. 260 261 <br><dt>ecj1<dt>gjavah<dd> 262If you wish to modify <samp><span class="file">.java</span></samp> files in libjava, you will need to 263configure with <samp><span class="option">--enable-java-maintainer-mode</span></samp>, and you will need 264to have executables named <samp><span class="command">ecj1</span></samp> and <samp><span class="command">gjavah</span></samp> in your path. 265The <samp><span class="command">ecj1</span></samp> executable should run the Eclipse Java compiler via 266the GCC-specific entry point. You can download a suitable jar from 267<a href="ftp://sourceware.org/pub/java/">ftp://sourceware.org/pub/java/</a>, or by running the script 268<samp><span class="command">contrib/download_ecj</span></samp>. 269 270 <br><dt>antlr.jar version 2.7.1 (or later)<dt>antlr binary<dd> 271If you wish to build the <samp><span class="command">gjdoc</span></samp> binary in libjava, you will 272need to have an <samp><span class="file">antlr.jar</span></samp> library available. The library is 273searched for in system locations but can be specified with 274<samp><span class="option">--with-antlr-jar=</span></samp> instead. When configuring with 275<samp><span class="option">--enable-java-maintainer-mode</span></samp>, you will need to have one of 276the executables named <samp><span class="command">cantlr</span></samp>, <samp><span class="command">runantlr</span></samp> or 277<samp><span class="command">antlr</span></samp> in your path. 278 279</dl> 280 281 <p><hr /> 282<p><a href="./index.html">Return to the GCC Installation page</a> 283 284<!-- ***Downloading the source************************************************** --> 285<!-- ***Configuration*********************************************************** --> 286<!-- ***Building**************************************************************** --> 287<!-- ***Testing***************************************************************** --> 288<!-- ***Final install*********************************************************** --> 289<!-- ***Binaries**************************************************************** --> 290<!-- ***Specific**************************************************************** --> 291<!-- ***Old documentation****************************************************** --> 292<!-- ***GFDL******************************************************************** --> 293<!-- *************************************************************************** --> 294<!-- Part 6 The End of the Document --> 295</body></html> 296 297