GNU Autotools: rebuild without version info

对着背影说爱祢 提交于 2019-11-29 18:52:55

问题


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!


回答1:


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



来源:https://stackoverflow.com/questions/11989255/gnu-autotools-rebuild-without-version-info

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!