Build libtool application with static linking to local components

こ雲淡風輕ζ 提交于 2019-12-12 03:27:59

问题


I am working with an open-source application that uses libtool in its build process. I would like to statically link the local components of the application with the following intended benefits:

  • doesn't require libtool wrapper to launch
  • function calls aren't indirected by dynamic linking during debugging
  • avoid unintended dynamic linking to existing system-installed library

Is there a standard option to the build process that does this?

Due to dependencies on non-static system libraries I can't just use:

./configure LDFLAGS='-static'

回答1:


Yes, it can be done! Use the --disable-shared option.

For example:

./configure --enable-debug --disable-shared

Now the generated executable is a directly executable binary rather than a libtool script.

This has the added benefit of roughly halving the build time.



来源:https://stackoverflow.com/questions/37191903/build-libtool-application-with-static-linking-to-local-components

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