Libtool slowness, double building?

拈花ヽ惹草 提交于 2019-12-06 00:57:04

By default Libtool creates two types of libraries: static and shared. (aka libfoo.a and libfoo.so)

Static and shard require different compilation flags. Dynamic libraries -- shared objects use Position Independent Code with following gcc flags:

-fPIC -DPIC

Static are not. You can force build only one type by specifing

./configure --disable-shared

or

./configure --disable-static

Rationale

Usually when library is provided for user it provide in two setups -- static for development that allows create pure static builds and dynamic for use by most of programs that use this library. So, usually when you install library in the system you only install shared object. (aka libfoo_XYZ.deb)

When you add development version (aka libfoo-dev_XYZ.deb) you add headers and statically build version of the library that allows users make staic builds if they whant.

This is common practice for shipping libraries in UNIX. Thus libtool does this for you automatically.

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