build a static python executable on linux?

Skip Montanaro skip at pobox.com
Tue Sep 30 10:03:45 EDT 2003


    Alex> I am able to compile a static interpreter (using -static
    Alex> -static-libgcc) but I can not build the extensions correctly.

You effectively need to transport yourself back in time before distutils
existed, and modify Modules/Setup (or more correctly, Modules/Setup.local)
appropriately to define the build commands for all the extension modules you
want to include in your interpreter.  It's a little tedious the first time
(it will probably take a few iterations to get everything correct), but once
you get the hang of it, it's easy to do.  Use the compile and link commands
output by distutils to give yourself a head start on -I, -L and -l flags to
include in your definitions.  Many of the commented out definitions are
probably also close.

If you identify some modules with no commented out build definitions in the
Setup file, please file a bug report on SourceForge.

Skip





More information about the Python-list mailing list