libstdc++.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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-tmpp1-sbu;</seg>
  33. <seg>&libstdcpp-tmpp1-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>Specifies that the cross compiler we have just built
  62. should be used instead of the one in
  63. <filename>/usr/bin</filename>.</para>
  64. </listitem>
  65. </varlistentry>
  66. <varlistentry>
  67. <term><parameter>--disable-libstdcxx-pch</parameter></term>
  68. <listitem>
  69. <para>This switch prevents the installation of precompiled
  70. include files, which are not needed at this stage.</para>
  71. </listitem>
  72. </varlistentry>
  73. <varlistentry>
  74. <term><parameter>--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version;</parameter></term>
  75. <listitem>
  76. <para>This is the location where the C++ compiler should search for the
  77. standard include files. In a normal build, this information
  78. is automatically passed to the libstdc++ <command>configure</command>
  79. options from the top level directory. In our case, this information
  80. must be explicitly given.</para>
  81. </listitem>
  82. </varlistentry>
  83. </variablelist>
  84. <para>Compile libstdc++ by running:</para>
  85. <screen><userinput remap="make">make</userinput></screen>
  86. <para>Install the library:</para>
  87. <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
  88. </sect2>
  89. <sect2 role="content">
  90. <title/>
  91. <para>Details on this package are located in
  92. <xref linkend="contents-gcc" role="."/></para>
  93. </sect2>
  94. </sect1>