linux - libtool 库版本编号

标签 linux shared-libraries gnu libtool

目前我正在使用选项链接成功构建的库

libtool --mode=link g++ -version-info 1:0

这会产生一个名为

的库
libxxx.so.1.0.0

到目前为止一切都很好。我的问题:如何影响版本方案中的最后一位数字,意味着如何在库名称末尾具有与 0 不同的值?

谢谢!

最佳答案

请参阅Libtool manual中的“更新库版本信息” ,它解释了这些数字的含义以及为什么 -version-info 1:0:3 无效:

If you want to use libtool’s versioning system, then you must specify the version information to libtool using the -version-info flag during link mode (see Link mode).

This flag accepts an argument of the form current[:revision[:age]]. So, passing -version-info 3:12:1 sets current to 3, revision to 12, and age to 1.

If either revision or age are omitted, they default to 0. Also note that age must be less than or equal to the current interface number.

Here are a set of rules to help you update your library version information:

  1. Start with version information of 0:0:0 for each libtool library.
  2. Update the version information only immediately before a public release of your software. More frequent updates are unnecessary, and only guarantee that the current interface number gets larger faster.
  3. If the library source code has changed at all since the last update, then increment revision (c:r:a becomes c:r+1:a).
  4. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
  5. If any interfaces have been added since the last public release, then increment age.
  6. If any interfaces have been removed or changed since the last public release, then set age to 0.

Never try to set the interface numbers so that they correspond to the release number of your package. This is an abuse that only fosters misunderstanding of the purpose of library versions. Instead, use the -release flag (see Release numbers), but be warned that every release of your package will not be binary compatible with any other release.

您可能还想在 Autotools Mythbuster 中阅读有关库版本控制的信息。对此事进行更广泛的处理。

关于linux - libtool 库版本编号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47713592/

相关文章:

linux - 从收到的 TCP 数据包中打开带有 CEC 的 AMP

c++ - 项目使用旧版本的boost库

linux - 运行并行进程,如果失败则全部退出

linux - 意外标记附近的 Bash 语法错误 `done' vi 编辑器以红色突出显示

linux - 如何禁用 systemd 日志记录到控制台?

linux - Arduino IDE 不能在 Arch Linux 上运行

svn - Tortoise SVN 忽略 .so 文件

java - Android Studio : generating . so文件使用实验性插件

c - 错误 : PHDR segment not covered by LOAD segment

makefile - GNU Make 中的条件依赖