You should be able to compile the whole binary statically just like you can build a perl interpreter with XS modules linked statically. I've never used that technique, but IIRC the mechanism shouldn't be much different from compiling with a shared library.