How to statically-link a complex program How to statically-link a complex program linux linux

How to statically-link a complex program


Most autoconf generated configure script will allow you to make a static build:

 ./configure --enable-static make

If that doesn't work, you may be able to pass linker flags in via LDFLAGS, like this:

 ./configure LDFLAGS=-static


Yeah, you need to edit the make file and add the -static parameter to gcc during the link.


If you cannot compile a static binary, I've had good results using Statifier.