libstdc++.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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 directory for Libstdc++ and enter it:</para>
  40. <screen><userinput remap="pre">mkdir -pv ../gcc-build
  41. cd ../gcc-build</userinput></screen>
  42. <para>Prepare Libstdc++ for compilation:</para>
  43. <screen><userinput remap="configure">../gcc-&gcc-version;/libstdc++-v3/configure \
  44. --host=$LFS_TGT \
  45. --prefix=/tools \
  46. --disable-multilib \
  47. --disable-shared \
  48. --disable-nls \
  49. --disable-libstdcxx-threads \
  50. --disable-libstdcxx-pch \
  51. --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</userinput></screen>
  52. <variablelist>
  53. <title>The meaning of the configure options:</title>
  54. <varlistentry>
  55. <term><parameter>--host=...</parameter></term>
  56. <listitem>
  57. <para>Indicates to use the cross compiler we have just built
  58. instead of the one in <filename>/usr/bin</filename>.</para>
  59. </listitem>
  60. </varlistentry>
  61. <varlistentry>
  62. <term><parameter>--disable-libstdcxx-threads</parameter></term>
  63. <listitem>
  64. <para>Since we have not built the thread C library, the C++
  65. one cannot be built as well.</para>
  66. </listitem>
  67. </varlistentry>
  68. <varlistentry>
  69. <term><parameter>--disable-libstdcxx-pch</parameter></term>
  70. <listitem>
  71. <para>This switch prevents the installation of precompiled
  72. include files, which are not needed at this stage.</para>
  73. </listitem>
  74. </varlistentry>
  75. <varlistentry>
  76. <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
  77. <listitem>
  78. <para>This is the location where the standard include files are
  79. searched by the C++ compiler. In a normal build, this information
  80. is automatically passed to the Libstdc++ <command>configure</command>
  81. options from the toplevel directory. In our case, this information
  82. must be explicitly given.</para>
  83. </listitem>
  84. </varlistentry>
  85. </variablelist>
  86. <para>Compile libstdc++ by running:</para>
  87. <screen><userinput remap="make">make</userinput></screen>
  88. <para>Install the library:</para>
  89. <screen><userinput remap="install">make install</userinput></screen>
  90. </sect2>
  91. <sect2 role="content">
  92. <title/>
  93. <para>Details on this package are located in
  94. <xref linkend="contents-gcc" role="."/></para>
  95. </sect2>
  96. </sect1>