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