GNU Autotools:在没有版本信息的情况下重建 [英] GNU Autotools: rebuild without version info
问题描述
我需要构建一个配置了 autotools 的库.通常的 configure &&制作&&make install
步骤生成版本化的共享库,类似于 libfoo.so.xx
是否可以修改 configure.ac 或 Makefile.am (当然还有 autoreconf ),以便 un-versioned lib 正在构建.
I need to build a lib that is configured with autotools. The usual configure && make && make install
steps produce versioned shared lib, something like libfoo.so.x.x
Is it possible to modify configure.ac or Makefile.am (and of course follow up with autoreconf ) so that un-versioned lib is build.
谢谢!
推荐答案
是的,假设库是用libtool
构建的,可以通过添加-avoid-去掉版本信息version
标记到库的 LDFLAGS.
Yes, assuming that the library is built with libtool
, you can remove the version information by adding the -avoid-version
flag to the library's LDFLAGS.
例如,如果之前有libfoo_la_LDFLAGS = -version-info 1:0
您将其更改为 libfoo_la_LDFLAGS = -avoid-version
.在此之后,您将重新生成并重新运行配置(autoreconf -vfi && ./configure)并重建.
For example, if before there was
libfoo_la_LDFLAGS = -version-info 1:0
you would change it to libfoo_la_LDFLAGS = -avoid-version
. After this, you'd regenerate and rerun configure (autoreconf -vfi && ./configure) and rebuild.
仅仅删除 -version-info ...
是不够的,因为 libtool 会生成一个版本信息为 0.0.0 的库.
Simply removing -version-info ...
isn't sufficient, since libtool will then generate a library with version info 0.0.0.
查看 libtool 手册了解更多信息:http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html
See the libtool manual for more information: http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html
这篇关于GNU Autotools:在没有版本信息的情况下重建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!