1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
8 <sect1 id="ch-tools-libstdcpp" role="wrap">
9 <?dbhtml filename="gcc-libstdc++.html"?>
11 <sect1info condition="script">
12 <productname>libstdc++</productname>
13 <productnumber>&gcc-version;</productnumber>
14 <address>&gcc-url;</address>
17 <title>Libstdc++-&gcc-version;</title>
19 <indexterm zone="ch-tools-libstdcpp">
20 <primary sortas="a-GCC">GCC</primary>
21 <secondary>tools, libstdc++</secondary>
24 <sect2 role="package">
27 <para>Libstdc++ is the standard C++ library. It is needed for the correct
28 operation of the g++ compiler.</para>
31 <segtitle>&buildtime;</segtitle>
32 <segtitle>&diskspace;</segtitle>
35 <seg>&libstdcpp-ch5-sbu;</seg>
36 <seg>&libstdcpp-ch5-du;</seg>
42 <sect2 role="installation">
43 <title>Installation of Target Libstdc++</title>
46 <para><application>Libstdc++</application> is part of the GCC sources.
47 You should first unpack the GCC tarball and change to the
48 <filename>gcc-&gcc-version;</filename> directory.</para>
51 <para>Create a directory for Libstdc++ and enter it:</para>
53 <screen><userinput remap="pre">mkdir -v ../gcc-build
54 cd ../gcc-build</userinput></screen>
56 <para>Prepare Libstdc++ for compilation:</para>
58 <screen><userinput remap="configure">../gcc-&gcc-version;/libstdc++-v3/configure \
63 --disable-libstdcxx-threads \
64 --disable-libstdcxx-pch \
65 --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
68 <title>The meaning of the configure options:</title>
71 <term><parameter>--host=...</parameter></term>
73 <para>Indicates to use the cross compiler we have just built
74 instead of the one in <filename>/usr/bin</filename>.</para>
79 <term><parameter>--disable-libstdcxx-threads</parameter></term>
81 <para>Since we have not yet built the C threads library, the C++
82 one cannot be built either.</para>
87 <term><parameter>--disable-libstdcxx-pch</parameter></term>
89 <para>This switch prevents the installation of precompiled
90 include files, which are not needed at this stage.</para>
95 <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
97 <para>This is the location where the standard include files are
98 searched by the C++ compiler. In a normal build, this information
99 is automatically passed to the Libstdc++ <command>configure</command>
100 options from the toplevel directory. In our case, this information
101 must be explicitly given.</para>
107 <para>Compile libstdc++ by running:</para>
109 <screen><userinput remap="make">make</userinput></screen>
111 <para>Install the library:</para>
113 <screen><userinput remap="install">make install</userinput></screen>
117 <sect2 role="content">
120 <para>Details on this package are located in
121 <xref linkend="contents-gcc" role="."/></para>