libstdc++.xml 3.8 KB

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