Building a python executable archive

Rich Browne rich.browne at hp.com
Wed Sep 11 12:26:20 EDT 2002


I'm trying to build python as an archive bound executable.  

This sounds dumb, Python is inherently dynamic, so why am I doing
this?
Because the python executable will have to execute without any dynamic
dependencies on shared libs outside the build environment that I plan
to install it in.

I have succeeded in statically linking most of the shared objects in
lib-dynload, by modifing Modules/Setup.dist.  I have edited the
Makefile so that it will not build any shared objects, changed some
linker/compiler options to link archive and specified dynload_stub.o
and the dynamic loader.  I also undefined the preprocessor directives
HAVE_DYNAMIC_LOADER and DLOPEN.  This works, but I'm looking for an
easier(automated)way to do this.  Is there a configure option that
will allow me to do this more easily?  And is there anything that I'm
forgetting?  It seems to work fine.  All the formerly shared objects
are in the list of builtin_modules and I've used some of them, but I
haven't thoroughly tested this.

Also, what is the difference between the *.pyo and *.pyc files.



More information about the Python-list mailing list