[89afa22] | 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 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-tools-libstdcpp" role="wrap">
|
---|
| 9 | <?dbhtml filename="gcc-libstdc++.html"?>
|
---|
| 10 |
|
---|
| 11 | <sect1info condition="script">
|
---|
| 12 | <productname>libstdc++</productname>
|
---|
| 13 | <productnumber>&gcc-version;</productnumber>
|
---|
| 14 | <address>&gcc-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
| 17 | <title>Libstdc++-&gcc-version;</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-tools-libstdcpp">
|
---|
| 20 | <primary sortas="a-GCC">GCC</primary>
|
---|
| 21 | <secondary>tools, libstdc++</secondary>
|
---|
| 22 | </indexterm>
|
---|
| 23 |
|
---|
| 24 | <sect2 role="package">
|
---|
| 25 | <title/>
|
---|
| 26 |
|
---|
| 27 | <para>Libstdc++ is the standard C++ library. It is needed for the correct
|
---|
| 28 | operation of the g++ compiler.</para>
|
---|
| 29 |
|
---|
| 30 | <segmentedlist>
|
---|
| 31 | <segtitle>&buildtime;</segtitle>
|
---|
| 32 | <segtitle>&diskspace;</segtitle>
|
---|
| 33 |
|
---|
| 34 | <seglistitem>
|
---|
| 35 | <seg>&libstdcpp-ch5-sbu;</seg>
|
---|
| 36 | <seg>&libstdcpp-ch5-du;</seg>
|
---|
| 37 | </seglistitem>
|
---|
| 38 | </segmentedlist>
|
---|
| 39 |
|
---|
| 40 | </sect2>
|
---|
| 41 |
|
---|
| 42 | <sect2 role="installation">
|
---|
| 43 | <title>Installation of Target Libstdc++</title>
|
---|
| 44 |
|
---|
| 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>
|
---|
| 50 |
|
---|
[f1dd547] | 51 | <para>Create a separate build directory for Libstdc++ and enter it:</para>
|
---|
[89afa22] | 52 |
|
---|
[f1dd547] | 53 | <screen><userinput remap="pre">mkdir -v build
|
---|
| 54 | cd build</userinput></screen>
|
---|
[89afa22] | 55 |
|
---|
| 56 | <para>Prepare Libstdc++ for compilation:</para>
|
---|
| 57 |
|
---|
[f1dd547] | 58 | <screen><userinput remap="configure">../libstdc++-v3/configure \
|
---|
[3dc9543] | 59 | --host=$LFS_TGT \
|
---|
| 60 | --prefix=/tools \
|
---|
| 61 | --disable-multilib \
|
---|
| 62 | --disable-nls \
|
---|
| 63 | --disable-libstdcxx-threads \
|
---|
| 64 | --disable-libstdcxx-pch \
|
---|
[89afa22] | 65 | --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
|
---|
| 66 |
|
---|
| 67 | <variablelist>
|
---|
| 68 | <title>The meaning of the configure options:</title>
|
---|
| 69 |
|
---|
| 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>
|
---|
| 77 |
|
---|
| 78 | <varlistentry>
|
---|
| 79 | <term><parameter>--disable-libstdcxx-threads</parameter></term>
|
---|
| 80 | <listitem>
|
---|
[3375f61] | 81 | <para>Since we have not yet built the C threads library, the C++
|
---|
| 82 | one cannot be built either.</para>
|
---|
[89afa22] | 83 | </listitem>
|
---|
| 84 | </varlistentry>
|
---|
| 85 |
|
---|
| 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>
|
---|
| 93 |
|
---|
| 94 | <varlistentry>
|
---|
[c5be634] | 95 | <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
|
---|
[89afa22] | 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>
|
---|
[edbeeb5] | 100 | options from the top level directory. In our case, this information
|
---|
[4783efe] | 101 | must be explicitly given.</para>
|
---|
[89afa22] | 102 | </listitem>
|
---|
| 103 | </varlistentry>
|
---|
| 104 |
|
---|
| 105 | </variablelist>
|
---|
| 106 |
|
---|
| 107 | <para>Compile libstdc++ by running:</para>
|
---|
| 108 |
|
---|
| 109 | <screen><userinput remap="make">make</userinput></screen>
|
---|
| 110 |
|
---|
| 111 | <para>Install the library:</para>
|
---|
| 112 |
|
---|
| 113 | <screen><userinput remap="install">make install</userinput></screen>
|
---|
| 114 |
|
---|
| 115 | </sect2>
|
---|
| 116 |
|
---|
| 117 | <sect2 role="content">
|
---|
| 118 | <title/>
|
---|
| 119 |
|
---|
| 120 | <para>Details on this package are located in
|
---|
| 121 | <xref linkend="contents-gcc" role="."/></para>
|
---|
| 122 |
|
---|
| 123 | </sect2>
|
---|
| 124 |
|
---|
| 125 | </sect1>
|
---|