In configure add option --enable-static

This option enable static build for server binaries and map cache.
For plugins this option enable static linking with gcc.