PR middle-end/25568
[official-gcc.git] / libstdc++-v3 / docs / html / install.html
blob3d3ab9b77c147548ecaed60761ea26d3f981b00b
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++-v3, 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++-v3 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++-v3 homepage</a>.
28 </em></p>
31 <!-- ####################################################### -->
32 <hr />
33 <h2>Contents</h2>
35 <p>Because libstdc++-v3 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++-v3.
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 June 19, 2000, libstdc++ attempts to use tricky and
60 space-saving features of the GNU toolchain, enabled with
61 <code>-ffunction-sections -fdata-sections -Wl,--gc-sections</code>.
62 To obtain maximum benefit from this, binutils after this date should
63 also be used (bugs were fixed with C++ exception handling related
64 to this change in libstdc++-v3). The version of these tools should
65 be <code>2.10.90</code>, or later, and you can get snapshots (as
66 well as releases) of binutils
67 <a href="ftp://sources.redhat.com/pub/binutils">here</a>. The
68 configure process will automatically detect and use these features
69 if the underlying support is present.
70 </p>
72 <p>Finally, a few system-specific requirements: </p>
73 <dl>
74 <dt> linux </dt>
76 <dd>If gcc 3.1.0 or later on is being used on linux, an attempt
77 will be made to use "C" library functionality necessary for C++
78 named locale support. For gcc 3.2.1 and later, this means that
79 glibc 2.2.5 or later is required.
81 <p>
82 The configure option --enable-clocale can be used force a
83 particular behavior.
84 </p>
86 <p>
87 If the 'gnu' locale model is being used, the following locales
88 are used and tested in the libstdc++ testsuites. The first column
89 is the name of the locale, the second is the character set it is
90 expected to use.
91 </p>
92 <pre>
93 de_DE ISO-8859-1
94 de_DE@euro ISO-8859-15
95 en_HK ISO-8859-1
96 en_PH ISO-8859-1
97 en_US ISO-8859-1
98 en_US.ISO-8859-1 ISO-8859-1
99 en_US.ISO-8859-15 ISO-8859-15
100 en_US.UTF-8 UTF-8
101 es_ES ISO-8859-1
102 es_MX ISO-8859-1
103 fr_FR ISO-8859-1
104 fr_FR@euro ISO-8859-15
105 is_IS UTF-8
106 it_IT ISO-8859-1
107 ja_JP.eucjp EUC-JP
108 se_NO.UTF-8 UTF-8
109 ta_IN UTF-8
110 zh_TW BIG5
111 </pre>
112 <p>Failure to have the underlying "C" library locale
113 information installed will mean that C++ named locales for the
114 above regions will not work: because of this, the libstdc++
115 testsuite will not pass the named locale tests. If this isn't an
116 issue, don't worry about it. If named locales are needed, the
117 underlying locale information must be installed. Note that
118 rebuilding libstdc++ after the "C" locales are installed is not
119 necessary.
120 </p>
122 <p>To install support for locales, do only one of the following:
123 </p>
125 <ul>
126 <li> install all locales
127 <ul>
128 <li>with RedHat Linux:
129 <p> <code> export LC_ALL=C </code> </p>
130 <p> <code> rpm -e glibc-common --nodeps </code> </p>
131 <p> <code> rpm -i --define "_install_langs all"
132 glibc-common-2.2.5-34.i386.rpm </code> </p>
133 </li>
134 <li> (instructions for other operating systems solicited) </li>
135 </ul>
136 </li>
137 <li> install just the necessary locales
138 <ul>
139 <li>with Debian Linux:
140 <p> Add the above list, as shown, to the file
141 <code>/etc/locale.gen</code> </p>
142 <p> run <code>/usr/sbin/locale-gen</code> </p>
143 </li>
144 <li> on most Unix-like operating systems:
145 <p> <code> localedef -i de_DE -f ISO-8859-1 de_DE </code> </p>
146 <p> (repeat for each entry in the above list) </p>
147 </li>
148 <li> (instructions for other operating systems solicited) </li>
149 </ul>
150 </li>
151 </ul>
152 </dd>
153 </dl>
155 <hr />
157 <h2><a name="config">Configuring</a></h2>
158 <p>If you have never done this before, you should read the basic
159 <a href="http://gcc.gnu.org/install/">GCC Installation
160 Instructions</a> first. Read <em>all of them</em>.
161 <strong>Twice.</strong>
162 </p>
163 <p>When building libstdc++-v3 you'll have to configure
164 the entire <em>gccsrcdir</em> directory. The full list of libstdc++-v3
165 specific configuration options, not dependent on the specific compiler
166 release being used, can be found <a href="configopts.html">here</a>.
167 </p>
168 <p>Consider possibly using --enable-languages=c++ to save time by only
169 building the C++ language parts.
170 </p>
172 <pre>
173 cd <em>gccbuilddir</em>
174 <em>gccsrcdir</em>/configure --prefix=<em>destdir</em> --other-opts...</pre>
177 <hr />
178 <h2><a name="usage">Using the library</a></h2>
179 <h3>Find the new library at runtime (shared linking only)</h3>
180 <p>If you only built a static library (libstdc++.a), or if you
181 specified static linking, you don't have to worry about this.
182 But if you built a shared library (libstdc++.so) and linked
183 against it, then you will need to find that library when you
184 run the executable.
185 </p>
186 <p>Methods vary for different platforms and different styles, but
187 the usual ones are printed to the screen during installation.
188 They include:
189 </p>
190 <ul>
191 <li>At runtime set LD_LIBRARY_PATH in your environment correctly,
192 so that the shared library for libstdc++ can be found and
193 loaded. Be certain that you understand all of the other
194 implications and behavior of LD_LIBRARY_PATH first (few
195 people do, and they get into trouble).
196 </li>
197 <li>Compile the path to find the library at runtime into the
198 program. This can be done by passing certain options to g++,
199 which will in turn pass them on to the linker. The exact
200 format of the options is dependent on which linker you use:
201 <ul>
202 <li>GNU ld (default on Linux):<code> -Wl,--rpath,<em>destdir</em>/lib</code></li>
203 <li>IRIX ld:<code> -Wl,-rpath,<em>destdir</em>/lib</code></li>
204 <li>Solaris ld:<code> -Wl,-R<em>destdir</em>/lib</code></li>
205 <li>More...? Let us know!</li>
206 </ul>
207 </li>
208 </ul>
209 <p>Use the <code>ldd(1)</code> utility to show which library the system
210 thinks it will get at runtime.
211 </p>
212 <p>A libstdc++.la file is also installed, for use with Libtool. If
213 you use Libtool to create your executables, these details are
214 taken care of for you.
215 </p>
218 <!--
219 <hr />
220 <h2><a name=""></a></h2>
222 </p>
226 <!-- ####################################################### -->
228 <hr />
229 <p class="fineprint"><em>
230 See <a href="17_intro/license.html">license.html</a> for copying conditions.
231 Comments and suggestions are welcome, and may be sent to
232 <a href="mailto:libstdc++@gcc.gnu.org">the libstdc++ mailing list</a>.
233 </em></p>
236 </body>
237 </html>