Building static Python binary

mk mrkafk at
Mon Oct 26 17:07:33 CET 2009


I have trouble building Python static binary (for use with '', 
as frozen Python programs do not include dynamically linked libs). Anybody?

./configure --disable-shared --with-ldflags=-ldl

And yet after compiling the resulting binary is linked with following 
dynamic libraries:

[root at localhost Python-2.6.2]# ldd python =>  (0x0075b000) => /lib/ (0x00900000) => /lib/ (0x008d1000) => /lib/ (0x03bbe000) => /lib/ (0x002e3000) => /lib/ (0x001a1000) => /lib/ (0x008d7000) => /lib/ (0x0078b000)
         /lib/ (0x0076d000) => /usr/lib/ (0x005ae000) => /usr/lib/ (0x004ce000) => /lib/ (0x00767000) => /usr/lib/ (0x00719000) => /lib/ (0x037ab000) => /usr/lib/ (0x00919000) => /usr/lib/ (0x00741000) => /lib/ (0x03909000) => /lib/ (0x00caf000) => /lib/ (0x00566000)

How can I make the python binary static?

More information about the Python-list mailing list