libstdc++.xml 4.0 KB

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