Build libtool application with static linking to l

2019-09-05 17:16发布

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'

标签: libtool
1条回答
SAY GOODBYE
2楼-- · 2019-09-05 17:42

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.

查看更多
登录 后发表回答