GNU Autotools:无需版本信息即可重建 [英] GNU Autotools: rebuild without version info

查看:71
本文介绍了GNU Autotools:无需版本信息即可重建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要构建一个配置有自动工具的库.通常的configure && make && make install步骤生成版本化的共享库,例如libfoo.so.x.x是否可以修改configure.ac或Makefile.am(当然还要跟上autoreconf),以便构建未版本化的lib.

谢谢!

解决方案

是的,假设该库是使用libtool构建的,则可以通过在库的LDFLAGS中添加-avoid-version标志来删除版本信息. >

例如,如果之前有 libfoo_la_LDFLAGS = -version-info 1:0,您将其更改为libfoo_la_LDFLAGS = -avoid-version.之后,您将重新生成并重新运行配置(autoreconf -vfi&& ./configure)并重新生成.

仅删除-version-info ...是不够的,因为libtool随后将生成版本信息为0.0.0的库.

有关更多信息,请参见libtool手册: http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html

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.

Thank you!

解决方案

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.

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.

Simply removing -version-info ... isn't sufficient, since libtool will then generate a library with version info 0.0.0.

See the libtool manual for more information: http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html

这篇关于GNU Autotools:无需版本信息即可重建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆