Building static binaries is nontrivial under Linux, due to the enormous number of library dependencies that come from GNOME and associated libraries. Additionally:
Many libraries do not come with their static (lib*.a) versions shipped, so we need to build them ourselves.
Some libraries can't be linked statically, such as glibc, because of libnss*.so.
Some libraries depend on data files and modules from the original package, especially in the case of gtk/gnome. Problems don't only appear when the user is missing these data files; things may not work because different distributions put files in different paths.
The current solution is to build a partially static binary, with
the most common libraries left dynamically linked
(glibc
and gtk
).
gtkmm
, gtksourceview
,
gtkhtml
and dependencies (like gnome) are
linked statically. The ideal solution would be to build custom
binaries for each major/chosen distribution, but we don't have
time/resources for that at the moment.
To build these binaries:
Look at the source/linux/static_make
script for all the files that should be removed/moved out of
/usr/lib
.
Run the script.
That's needed to force the linker to look for the static version of each library and also to explicitly list the dependency libs that were otherwise linked to the dynamic libs.