Building static Python binary

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


Hello,

I have trouble building Python static binary (for use with 'freeze.py', 
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
         linux-gate.so.1 =>  (0x0075b000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x00900000)
         libdl.so.2 => /lib/libdl.so.2 (0x008d1000)
         libutil.so.1 => /lib/libutil.so.1 (0x03bbe000)
         libssl.so.6 => /lib/libssl.so.6 (0x002e3000)
         libcrypto.so.6 => /lib/libcrypto.so.6 (0x001a1000)
         libm.so.6 => /lib/libm.so.6 (0x008d7000)
         libc.so.6 => /lib/libc.so.6 (0x0078b000)
         /lib/ld-linux.so.2 (0x0076d000)
         libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x005ae000)
         libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x004ce000)
         libcom_err.so.2 => /lib/libcom_err.so.2 (0x00767000)
         libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00719000)
         libresolv.so.2 => /lib/libresolv.so.2 (0x037ab000)
         libz.so.1 => /usr/lib/libz.so.1 (0x00919000)
         libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00741000)
         libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x03909000)
         libselinux.so.1 => /lib/libselinux.so.1 (0x00caf000)
         libsepol.so.1 => /lib/libsepol.so.1 (0x00566000)



How can I make the python binary static?




More information about the Python-list mailing list