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>gcc</productname>
13 <productnumber>&gcc-version;</productnumber>
14 <address>&gcc-url;</address>
17 <title>Libstdc++ from GCC-&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
29 (part of GCC is written in C++), but we had to defer its installation
30 when we built <xref linkend="ch-tools-gcc-pass1"/>
31 because it depends on glibc, which was not yet available in /tools.
35 <segtitle>&buildtime;</segtitle>
36 <segtitle>&diskspace;</segtitle>
39 <seg>&libstdcpp-ch5-sbu;</seg>
40 <seg>&libstdcpp-ch5-du;</seg>
46 <sect2 role="installation">
47 <title>Installation of Target Libstdc++</title>
50 <para><application>Libstdc++</application> is part of the GCC sources.
51 You should first unpack the GCC tarball and change to the
52 <filename>gcc-&gcc-version;</filename> directory.</para>
55 <para>Create a separate build directory for Libstdc++ and enter it:</para>
57 <screen><userinput remap="pre">mkdir -v build
58 cd build</userinput></screen>
60 <para>Prepare Libstdc++ for compilation:</para>
62 <screen><userinput remap="configure">../libstdc++-v3/configure \
67 --disable-libstdcxx-threads \
68 --disable-libstdcxx-pch \
69 --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
72 <title>The meaning of the configure options:</title>
75 <term><parameter>--host=...</parameter></term>
77 <para>Indicates to use the cross compiler we have just built
78 instead of the one in <filename>/usr/bin</filename>.</para>
83 <term><parameter>--disable-libstdcxx-threads</parameter></term>
85 <para>Since we have not yet built the C threads library, the C++
86 one cannot be built either.</para>
91 <term><parameter>--disable-libstdcxx-pch</parameter></term>
93 <para>This switch prevents the installation of precompiled
94 include files, which are not needed at this stage.</para>
99 <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
101 <para>This is the location where the standard include files are
102 searched by the C++ compiler. In a normal build, this information
103 is automatically passed to the Libstdc++ <command>configure</command>
104 options from the top level directory. In our case, this information
105 must be explicitly given.</para>
111 <para>Compile libstdc++ by running:</para>
113 <screen><userinput remap="make">make</userinput></screen>
115 <para>Install the library:</para>
117 <screen><userinput remap="install">make install</userinput></screen>
121 <sect2 role="content">
124 <para>Details on this package are located in
125 <xref linkend="contents-gcc" role="."/></para>