LFS-systemd-7.8
[linux_from_scratch.git] / chapter05 / libstdc++.xml
blob29d7f273960f902b0d60631ea7145874130c1690
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">
5   %general-entities;
6 ]>
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>
15   </sect1info>
17   <title>Libstdc++-&gcc-version;</title>
19   <indexterm zone="ch-tools-libstdcpp">
20     <primary sortas="a-GCC">GCC</primary>
21     <secondary>tools, libstdc++</secondary>
22   </indexterm>
24   <sect2 role="package">
25     <title/>
27     <para>Libstdc++ is the standard C++ library. It is needed for the correct
28     operation of the g++ compiler.</para>
30     <segmentedlist>
31       <segtitle>&buildtime;</segtitle>
32       <segtitle>&diskspace;</segtitle>
34       <seglistitem>
35         <seg>&libstdcpp-ch5-sbu;</seg>
36         <seg>&libstdcpp-ch5-du;</seg>
37       </seglistitem>
38     </segmentedlist>
40   </sect2>
42   <sect2 role="installation">
43     <title>Installation of Target Libstdc++</title>
45     <note>
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>
49     </note>
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 \
59     --host=$LFS_TGT                 \
60     --prefix=/tools                 \
61     --disable-multilib              \
62     --disable-nls                   \
63     --disable-libstdcxx-threads     \
64     --disable-libstdcxx-pch         \
65     --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
67     <variablelist>
68       <title>The meaning of the configure options:</title>
70       <varlistentry>
71         <term><parameter>--host=...</parameter></term>
72         <listitem>
73           <para>Indicates to use the cross compiler we have just built
74           instead of the one in <filename>/usr/bin</filename>.</para>
75         </listitem>
76       </varlistentry>
78       <varlistentry>
79         <term><parameter>--disable-libstdcxx-threads</parameter></term>
80         <listitem>
81           <para>Since we have not yet built the C threads library, the C++
82           one cannot be built either.</para>
83         </listitem>
84       </varlistentry>
86       <varlistentry>
87         <term><parameter>--disable-libstdcxx-pch</parameter></term>
88         <listitem>
89           <para>This switch prevents the installation of precompiled
90           include files, which are not needed at this stage.</para>
91         </listitem>
92       </varlistentry>
94       <varlistentry>
95         <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
96         <listitem>
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>
102         </listitem>
103       </varlistentry>
105     </variablelist>
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>
115   </sect2>
117   <sect2 role="content">
118     <title/>
120     <para>Details on this package are located in
121     <xref linkend="contents-gcc" role="."/></para>
123   </sect2>
125 </sect1>