libstdc++.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. <sect1 id="ch-tools-libstdcpp" role="wrap">
  8. <?dbhtml filename="gcc-libstdc++.html"?>
  9. <sect1info condition="script">
  10. <productname>libstdc++</productname>
  11. <productnumber>&gcc-version;</productnumber>
  12. <address>&gcc-url;</address>
  13. </sect1info>
  14. <title>Libstdc++-&gcc-version;</title>
  15. <indexterm zone="ch-tools-libstdcpp">
  16. <primary sortas="a-GCC">GCC</primary>
  17. <secondary>tools, libstdc++</secondary>
  18. </indexterm>
  19. <sect2 role="package">
  20. <title/>
  21. <para>Libstdc++ is the standard C++ library. It is needed for the correct
  22. operation of the g++ compiler.</para>
  23. <segmentedlist>
  24. <segtitle>&buildtime;</segtitle>
  25. <segtitle>&diskspace;</segtitle>
  26. <seglistitem>
  27. <seg>&libstdcpp-ch5-sbu;</seg>
  28. <seg>&libstdcpp-ch5-du;</seg>
  29. </seglistitem>
  30. </segmentedlist>
  31. </sect2>
  32. <sect2 role="installation">
  33. <title>Installation of Target Libstdc++</title>
  34. <note>
  35. <para><application>Libstdc++</application> is part of the GCC sources.
  36. You should first unpack the GCC tarball and change to the
  37. <filename>gcc-&gcc-version;</filename> directory.</para>
  38. </note>
  39. <para>Create a separate build directory for Libstdc++ and enter it:</para>
  40. <screen><userinput remap="pre">mkdir -v build
  41. cd build</userinput></screen>
  42. <para>Prepare Libstdc++ for compilation:</para>
  43. <screen><userinput remap="configure">../libstdc++-v3/configure \
  44. --host=$LFS_TGT \
  45. --prefix=/tools \
  46. --disable-multilib \
  47. --disable-nls \
  48. --disable-libstdcxx-threads \
  49. --disable-libstdcxx-pch \
  50. --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
  51. <variablelist>
  52. <title>The meaning of the configure options:</title>
  53. <varlistentry>
  54. <term><parameter>--host=...</parameter></term>
  55. <listitem>
  56. <para>Indicates to use the cross compiler we have just built
  57. instead of the one in <filename>/usr/bin</filename>.</para>
  58. </listitem>
  59. </varlistentry>
  60. <varlistentry>
  61. <term><parameter>--disable-libstdcxx-threads</parameter></term>
  62. <listitem>
  63. <para>Since we have not yet built the C threads library, the C++
  64. one cannot be built either.</para>
  65. </listitem>
  66. </varlistentry>
  67. <varlistentry>
  68. <term><parameter>--disable-libstdcxx-pch</parameter></term>
  69. <listitem>
  70. <para>This switch prevents the installation of precompiled
  71. include files, which are not needed at this stage.</para>
  72. </listitem>
  73. </varlistentry>
  74. <varlistentry>
  75. <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
  76. <listitem>
  77. <para>This is the location where the standard include files are
  78. searched by the C++ compiler. In a normal build, this information
  79. is automatically passed to the Libstdc++ <command>configure</command>
  80. options from the top level directory. In our case, this information
  81. must be explicitly given.</para>
  82. </listitem>
  83. </varlistentry>
  84. </variablelist>
  85. <para>Compile libstdc++ by running:</para>
  86. <screen><userinput remap="make">make</userinput></screen>
  87. <para>Install the library:</para>
  88. <screen><userinput remap="install">make install</userinput></screen>
  89. </sect2>
  90. <sect2 role="content">
  91. <title/>
  92. <para>Details on this package are located in
  93. <xref linkend="contents-gcc" role="."/></para>
  94. </sect2>
  95. </sect1>