Merge -r 127928:132243 from trunk
[official-gcc.git] / libstdc++-v3 / doc / html / install.html
blob3166ebc0a86ff4287b3be166940ca1217989ec34
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE html
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8 <meta name="AUTHOR" content="pme@gcc.gnu.org (Phil Edwards)" />
9 <meta name="KEYWORDS" content="libstdc++, libstdc++, GCC, g++" />
10 <meta name="DESCRIPTION" content="README for the GNU libstdc++ effort." />
11 <meta name="GENERATOR" content="vi and eight fingers" />
12 <title>libstdc++ Installation Instructions</title>
13 <link rel="StyleSheet" href="lib3styles.css" type="text/css" />
14 <link rel="Copyright" href="17_intro/license.html" type="text/html" />
15 </head>
16 <body>
18 <h1 class="centered"><a name="top">Getting started: configure, build, install</a></h1>
20 <p class="fineprint"><em>
21 The latest version of this document is always available at
22 <a href="http://gcc.gnu.org/onlinedocs/libstdc++/install.html">
23 http://gcc.gnu.org/onlinedocs/libstdc++/install.html</a>.
24 </em></p>
26 <p><em>
27 To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++ homepage</a>.
28 </em></p>
31 <!-- ####################################################### -->
32 <hr />
33 <h2>Contents</h2>
35 <p>Because libstdc++ is part of GCC, the primary source for
36 installation instructions is
37 <a href="http://gcc.gnu.org/install/">the GCC install page</a>.
38 Additional data is given here only where it applies to libstdc++.
39 </p>
41 <ul>
42 <li><a href="#prereqs">Tools you will need beforehand</a></li>
43 <li><a href="#config">Configuring</a></li>
44 <li><a href="#usage">Using the library</a></li>
45 </ul>
47 <hr />
49 <!-- ####################################################### -->
51 <h2><a name="prereqs">Tools you will need beforehand</a></h2>
52 <p>The list of software needed to build the library is kept with the
53 rest of the compiler, at
54 <a href="http://gcc.gnu.org/install/prerequisites.html">
55 http://gcc.gnu.org/install/prerequisites.html</a>. The same page
56 also lists the tools you will need if you wish to modify the source.
57 </p>
59 <p>As of GCC 4.0.1 the minimum version of binutils required to build
60 libstdc++ is <code>2.15.90.0.1.1</code>. You can get snapshots
61 (as well as releases) of binutils from
62 <a href="ftp://sources.redhat.com/pub/binutils">
63 ftp://sources.redhat.com/pub/binutils</a>.
64 Older releases of libstdc++ do not require such a recent version,
65 but to take full advantage of useful space-saving features and
66 bug-fixes you should use a recent binutils if possible.
67 The configure process will automatically detect and use these
68 features if the underlying support is present.
69 </p>
71 <p>Finally, a few system-specific requirements: </p>
72 <dl>
73 <dt> linux </dt>
75 <dd>If gcc 3.1.0 or later on is being used on linux, an attempt
76 will be made to use "C" library functionality necessary for C++
77 named locale support. For gcc 3.2.1 and later, this means that
78 glibc 2.2.5 or later is required and the "C" library de_DE locale
79 information must be installed.
81 <p>
82 Note however that the sanity checks involving the de_DE locale are
83 skipped when an explicit --enable-clocale=gnu configure option is
84 used: only the basic checks are carried out, defending against
85 misconfigurations.
86 </p>
88 <p>
89 If the 'gnu' locale model is being used, the following locales
90 are used and tested in the libstdc++ testsuites. The first column
91 is the name of the locale, the second is the character set it is
92 expected to use.
93 </p>
94 <pre>
95 de_DE ISO-8859-1
96 de_DE@euro ISO-8859-15
97 en_HK ISO-8859-1
98 en_PH ISO-8859-1
99 en_US ISO-8859-1
100 en_US.ISO-8859-1 ISO-8859-1
101 en_US.ISO-8859-15 ISO-8859-15
102 en_US.UTF-8 UTF-8
103 es_ES ISO-8859-1
104 es_MX ISO-8859-1
105 fr_FR ISO-8859-1
106 fr_FR@euro ISO-8859-15
107 is_IS UTF-8
108 it_IT ISO-8859-1
109 ja_JP.eucjp EUC-JP
110 se_NO.UTF-8 UTF-8
111 ta_IN UTF-8
112 zh_TW BIG5
113 </pre>
114 <p>Failure to have the underlying "C" library locale
115 information installed will mean that C++ named locales for the
116 above regions will not work: because of this, the libstdc++
117 testsuite will skip the named locale tests. If this isn't an
118 issue, don't worry about it. If named locales are needed, the
119 underlying locale information must be installed. Note that
120 rebuilding libstdc++ after the "C" locales are installed is not
121 necessary.
122 </p>
124 <p>To install support for locales, do only one of the following:
125 </p>
127 <ul>
128 <li> install all locales
129 <ul>
130 <li>with RedHat Linux:
131 <p> <code> export LC_ALL=C </code> </p>
132 <p> <code> rpm -e glibc-common --nodeps </code> </p>
133 <p> <code> rpm -i --define "_install_langs all"
134 glibc-common-2.2.5-34.i386.rpm </code> </p>
135 </li>
136 <li> (instructions for other operating systems solicited) </li>
137 </ul>
138 </li>
139 <li> install just the necessary locales
140 <ul>
141 <li>with Debian Linux:
142 <p> Add the above list, as shown, to the file
143 <code>/etc/locale.gen</code> </p>
144 <p> run <code>/usr/sbin/locale-gen</code> </p>
145 </li>
146 <li> on most Unix-like operating systems:
147 <p> <code> localedef -i de_DE -f ISO-8859-1 de_DE </code> </p>
148 <p> (repeat for each entry in the above list) </p>
149 </li>
150 <li> (instructions for other operating systems solicited) </li>
151 </ul>
152 </li>
153 </ul>
154 </dd>
155 </dl>
157 <hr />
159 <h2><a name="config">Configuring</a></h2>
160 <p>If you have never done this before, you should read the basic
161 <a href="http://gcc.gnu.org/install/">GCC Installation
162 Instructions</a> first. Read <em>all of them</em>.
163 <strong>Twice.</strong>
164 </p>
165 <p>When building libstdc++ you'll have to configure
166 the entire <em>gccsrcdir</em> directory. The full list of libstdc++
167 specific configuration options, not dependent on the specific compiler
168 release being used, can be found <a href="configopts.html">here</a>.
169 </p>
170 <p>Consider possibly using --enable-languages=c++ to save time by only
171 building the C++ language parts.
172 </p>
174 <pre>
175 cd <em>gccbuilddir</em>
176 <em>gccsrcdir</em>/configure --prefix=<em>destdir</em> --other-opts...</pre>
179 <hr />
180 <h2><a name="usage">Using the library</a></h2>
181 <h3>Find the new library at runtime (shared linking only)</h3>
182 <p>If you only built a static library (libstdc++.a), or if you
183 specified static linking, you don't have to worry about this.
184 But if you built a shared library (libstdc++.so) and linked
185 against it, then you will need to find that library when you
186 run the executable.
187 </p>
188 <p>Methods vary for different platforms and different styles, but
189 the usual ones are printed to the screen during installation.
190 They include:
191 </p>
192 <ul>
193 <li>At runtime set LD_LIBRARY_PATH in your environment correctly,
194 so that the shared library for libstdc++ can be found and
195 loaded. Be certain that you understand all of the other
196 implications and behavior of LD_LIBRARY_PATH first (few
197 people do, and they get into trouble).
198 </li>
199 <li>Compile the path to find the library at runtime into the
200 program. This can be done by passing certain options to g++,
201 which will in turn pass them on to the linker. The exact
202 format of the options is dependent on which linker you use:
203 <ul>
204 <li>GNU ld (default on Linux):<code> -Wl,--rpath,<em>destdir</em>/lib</code></li>
205 <li>IRIX ld:<code> -Wl,-rpath,<em>destdir</em>/lib</code></li>
206 <li>Solaris ld:<code> -Wl,-R<em>destdir</em>/lib</code></li>
207 <li>More...? Let us know!</li>
208 </ul>
209 </li>
210 </ul>
211 <p>Use the <code>ldd(1)</code> utility to show which library the system
212 thinks it will get at runtime.
213 </p>
214 <p>A libstdc++.la file is also installed, for use with Libtool. If
215 you use Libtool to create your executables, these details are
216 taken care of for you.
217 </p>
220 <!--
221 <hr />
222 <h2><a name=""></a></h2>
224 </p>
228 <!-- ####################################################### -->
230 <hr />
231 <p class="fineprint"><em>
232 See <a href="17_intro/license.html">license.html</a> for copying conditions.
233 Comments and suggestions are welcome, and may be sent to
234 <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
235 </em></p>
238 </body>
239 </html>