xref: /netbsd-src/external/gpl3/gcc.old/dist/libstdc++-v3/doc/html/manual/setup.html (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 2. Setup</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="intro.html" title="Part I.  Introduction" /><link rel="prev" href="bugs.html" title="Bugs" /><link rel="next" href="configure.html" title="Configure" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Setup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><th width="60%" align="center">Part I. 
3  Introduction
4
5</th><td width="20%" align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup"></a>Chapter 2. Setup</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="setup.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="section"><a href="configure.html">Configure</a></span></dt><dt><span class="section"><a href="make.html">Make</a></span></dt></dl></div><p>To transform libstdc++ sources into installed include files
6   and properly built binaries useful for linking to other software is
7   a multi-step process. Steps include getting the sources,
8   configuring and building the sources, testing, and installation.
9   </p><p>The general outline of commands is something like:
10   </p><pre class="programlisting">
11   <em class="replaceable"><code>get gcc sources</code></em>
12   <em class="replaceable"><code>extract into gccsrcdir</code></em>
13   mkdir <em class="replaceable"><code>gccbuilddir</code></em>
14   cd <em class="replaceable"><code>gccbuilddir</code></em>
15   <em class="replaceable"><code>gccsrcdir</code></em>/configure --prefix=<em class="replaceable"><code>destdir</code></em> --other-opts...
16   make
17   make check
18   make install
19   </pre><p>
20     Each step is described in more detail in the following sections.
21   </p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.prereq"></a>Prerequisites</h2></div></div></div><p>
22  Because libstdc++ is part of GCC, the primary source for
23   installation instructions is
24   <a class="link" href="http://gcc.gnu.org/install/" target="_top">the GCC install page</a>.
25   In particular, list of prerequisite software needed to build the library
26   <a class="link" href="http://gcc.gnu.org/install/prerequisites.html" target="_top">
27   starts with those requirements.</a> The same pages also list
28   the tools you will need if you wish to modify the source.
29</p><p>
30   Additional data is given here only where it applies to libstdc++.
31  </p><p>As of GCC 4.0.1 the minimum version of binutils required to build
32      libstdc++ is <code class="code">2.15.90.0.1.1</code>.
33      Older releases of libstdc++ do not require such a recent version,
34      but to take full advantage of useful space-saving features and
35      bug-fixes you should use a recent binutils whenever possible.
36      The configure process will automatically detect and use these
37      features if the underlying support is present.
38   </p><p>
39     To generate the API documentation from the sources you will need
40     Doxygen, see <a class="link" href="documentation_hacking.html" title="Writing and Generating Documentation">Documentation
41     Hacking</a> in the appendix for full details.
42   </p><p>
43   Finally, a few system-specific requirements:
44   </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">linux</span></dt><dd><p>
45	  The 'gnu' locale model makes use of <code class="function">iconv</code>
46	  for character set conversions. The relevant functions are provided
47	  by Glibc and so are always available, however they can also be
48	  provided by the separate GNU libiconv library. If GNU libiconv is
49	  found when GCC is built (e.g., because its headers are installed
50	  in <code class="filename">/usr/local/include</code>)
51	  then the <code class="filename">libstdc++.so.6</code> library will have a
52	  run-time dependency on <code class="filename">libiconv.so.2</code>.
53	  If you do not want that run-time dependency then you should do
54	  one of the following:
55	</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
56	      Uninstall the libiconv headers before building GCC.
57	      Glibc already provides <code class="function">iconv</code> so you should
58	      not need libiconv anyway.
59	    </p></li><li class="listitem"><p>
60	    <a class="link" href="https://www.gnu.org/software/libiconv/#downloading" target="_top">
61	    Download</a> the libiconv sources and extract them into the
62	    top level of the GCC source tree, e.g.,
63	    </p><pre class="programlisting">
64wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
65tar xf libiconv-1.16.tar.gz
66ln -s libiconv-1.16 libiconv
67</pre><p>
68	      This will build libiconv as part of building GCC and link to
69	      it statically, so there is no <code class="filename">libiconv.so.2</code>
70	      dependency.
71	    </p></li><li class="listitem"><p>
72	      Configure GCC with <code class="option">--with-libiconv-type=static</code>.
73	      This requires the static <code class="filename">libiconv.a</code> library,
74	      which is not installed by default. You might need to reinstall
75	      libiconv using the <code class="option">--enable-static</code> configure
76	      option to get the static library.
77	    </p></li></ul></div><p>
78	  If GCC 3.1.0 or later on is being used on GNU/Linux, an attempt
79	  will be made to use "C" library functionality necessary for
80	  C++ named locale support.  For GCC 4.6.0 and later, this
81	  means that glibc 2.3 or later is required.
82	</p><p>
83	  If the 'gnu' locale model is being used, the following
84	  locales are used and tested in the libstdc++ testsuites.
85	  The first column is the name of the locale, the second is
86	  the character set it is expected to use.
87	</p><pre class="programlisting">
88de_DE               ISO-8859-1
89de_DE@euro          ISO-8859-15
90en_GB               ISO-8859-1
91en_HK               ISO-8859-1
92en_PH               ISO-8859-1
93en_US               ISO-8859-1
94en_US.ISO-8859-1    ISO-8859-1
95en_US.ISO-8859-15   ISO-8859-15
96en_US.UTF-8         UTF-8
97es_ES               ISO-8859-1
98es_MX               ISO-8859-1
99fr_FR               ISO-8859-1
100fr_FR@euro          ISO-8859-15
101is_IS               UTF-8
102it_IT               ISO-8859-1
103ja_JP.eucjp         EUC-JP
104ru_RU.ISO-8859-5    ISO-8859-5
105ru_RU.UTF-8         UTF-8
106se_NO.UTF-8         UTF-8
107ta_IN               UTF-8
108zh_TW               BIG5
109</pre><p>Failure to have installed the underlying "C" library
110      locale information for any of the above regions means that
111      the corresponding C++ named locale will not work:  because of
112      this, the libstdc++ testsuite will skip named locale tests
113      which need missing information.  If this isn't an issue, don't
114      worry about it.  If a named locale is needed, the underlying
115      locale information must be installed.  Note that rebuilding
116      libstdc++ after "C" locales are installed is not necessary.
117      </p><p>
118	To install support for locales, do only one of the following:
119      </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>install all locales</p></li><li class="listitem"><p>install just the necessary locales</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"><p>with Debian GNU/Linux:</p><p> Add the above list, as shown, to the file
120	      <code class="code">/etc/locale.gen</code> </p><p> run <code class="code">/usr/sbin/locale-gen</code> </p></li><li class="listitem"><p>on most Unix-like operating systems:</p><p><code class="code"> localedef -i de_DE -f ISO-8859-1 de_DE </code></p><p>(repeat for each entry in the above list) </p></li><li class="listitem"><p>
121	       Instructions for other operating systems solicited.
122	    </p></li></ul></div></li></ul></div></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bugs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Bugs </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> Configure</td></tr></table></div></body></html>