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'
Yes, it can be done! Use the
--disable-shared
option.For example:
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.