Freeze Question

Skip Montanaro skip at pobox.com
Mon Aug 4 15:15:14 EDT 2003


    David> are there any good places that describe more explicitly how to
    David> build a static python?

I think Modules/Setup is about it.  If I had to do this today, here's what
I'd do.

    1. Starting from a clean source tree, run the 'script' command to get
       a log of the session in a file named 'typescript'.

    2. Exit the script session.

    3. Run the usual 'configure ; make' commands.

    4. Edit Modules/Setup, uncommenting those modules which you want built
       statically.  Many are simple and require no extra compile or link
       flags.  For others, use the build commands found in the typescript
       file to identify -I..., -L..., and -l... flags.  Obviously, omit or
       modify any flags that would be used to generate a shared library
       (-shared, -Bshared, -fPIC, etc).

    5. Run 'make clean ; make'

    6. Test the resulting executable.

    7. Repeat steps 4-6 as necessary.

    8. Congratulate yourself on a job well done and buy yourself a beer.

If that is an unappealing process for some reason, try this shortcut:

    1. Pay a consultant to do it.

    2. Get other work done.

    3. Congratulate your consultant on a job well done and buy both of you a
       beer.

There is a third, somewhat longer term, alternative:

    1. Teach distutils how to build a static Python executable.

    2. Submit a patch to SF.

    3. Buy yourself two beers.

Skip






More information about the Python-list mailing list