libffi.xml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?xml version="1.0" encoding="UTF-8"?>
  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-system-libffi" role="wrap">
  8. <?dbhtml filename="libffi.html"?>
  9. <sect1info condition="script">
  10. <productname>libffi</productname>
  11. <productnumber>&libffi-version;</productnumber>
  12. <address>&libffi-url;</address>
  13. </sect1info>
  14. <title>Libffi-&libffi-version;</title>
  15. <indexterm zone="ch-system-libffi">
  16. <primary sortas="a-libffi">libffi</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Libffi 库提供一个可移植的高级编程接口,用于处理不同调用惯例。
  21. 这允许程序在运行时调用任何给定了调用接口的函数。</para>
  22. <segmentedlist>
  23. <segtitle>&buildtime;</segtitle>
  24. <segtitle>&diskspace;</segtitle>
  25. <seglistitem>
  26. <seg>&libffi-ch6-sbu;</seg>
  27. <seg>&libffi-ch6-du;</seg>
  28. </seglistitem>
  29. </segmentedlist>
  30. </sect2>
  31. <sect2 role="installation">
  32. <title>安装 Libffi</title>
  33. <para>修改 Makefile ,将头文件安装到标准的
  34. <filename class="directory">/usr/include</filename> 目录,而不是
  35. <filename class="directory">/usr/lib/libffi-3.2.1/include</filename>。</para>
  36. <screen><userinput remap="pre">sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' \
  37. -i include/Makefile.in
  38. sed -e '/^includedir/ s/=.*$/=@includedir@/' \
  39. -e 's/^Cflags: -I${includedir}/Cflags:/' \
  40. -i libffi.pc.in</userinput></screen>
  41. <para>准备安装 libffi:</para>
  42. <screen><userinput remap="configure">./configure --prefix=/usr --disable-static --with-gcc-arch=native</userinput></screen>
  43. <variablelist>
  44. <title>The meaning of the configure option:</title>
  45. <varlistentry>
  46. <term><parameter>--with-gcc-arch=native</parameter></term>
  47. <listitem>
  48. <!--para>Ensure gcc optimizes for the current system. If this
  49. is not specified, the system is guessed and the code generated
  50. may not be correct for some systems. If the generated code
  51. will be copied from the native system to a less capable
  52. system, use the less capable system as a parameter. For details
  53. about alternative system types, see <ulink
  54. url='https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/x86-Options.html'>
  55. the x86 options in the gcc manual</ulink>.</para-->
  56. <para>保证 gcc 为当前系统进行优化。如果不使用该选项,
  57. 构建系统会猜测系统架构,在某些系统上可能生成不正确的代码。
  58. 如果要将生成的代码从本地系统复制到指令集功能较弱的系统中,
  59. 需要使用目标系统架构作为该选项的参数值,参阅
  60. <ulink
  61. url='https://gcc.gnu.org/onlinedocs/gcc-&gcc-version;/gcc/x86-Options.html'>
  62. gcc 手册中提供的的 x86 选项</ulink>。</para>
  63. </listitem>
  64. </varlistentry>
  65. </variablelist>
  66. <para>编译该软件包:</para>
  67. <screen><userinput remap="make">make</userinput></screen>
  68. <para>运行以下命令以测试编译结果:</para>
  69. <screen><userinput remap="test">make check</userinput></screen>
  70. <para>安装该软件包:</para>
  71. <screen><userinput remap="install">make install</userinput></screen>
  72. </sect2>
  73. <sect2 id="contents-libffi" role="content">
  74. <title>Libffi 的内容</title>
  75. <segmentedlist>
  76. <segtitle>安装的库</segtitle>
  77. <seglistitem>
  78. <seg>libffi.so</seg>
  79. </seglistitem>
  80. </segmentedlist>
  81. <variablelist>
  82. <bridgehead renderas="sect3">简要描述</bridgehead>
  83. <?dbfo list-presentation="list"?>
  84. <?dbhtml list-presentation="table"?>
  85. <varlistentry id="libffi">
  86. <term><filename class="libraryfile">libffi</filename></term>
  87. <listitem>
  88. <para>包含 libffi API 函数</para>
  89. <indexterm zone="ch-system-libffi">
  90. <primary sortas="c-libffi">libffi</primary>
  91. </indexterm>
  92. </listitem>
  93. </varlistentry>
  94. </variablelist>
  95. </sect2>
  96. </sect1>