[Distutils] Re: Add multiple frozen modules

M.-A. Lemburg mal@lemburg.com
Thu, 15 Jul 1999 13:18:17 +0200


Sorry to jump into this discussion this late... Jim kindly made
me take a closer look at the thread.

As far as I have skimmed the discussion, you are mostly talking
about freeze'ing on Windows platforms. Well, then I'm the wrong
guy to say anything, because my knowledge of that platform doesn't
go too deep.

All I can say is that Florent Heyworth has been able to create
a cgipython binary (see the mxCGIPython project on my Python Pages)
for NT which includes the Python lib as frozen modules in the
EXE.

Here are some instructions which I copied from a mail by
Florent (hope this is ok, Florent):

"""
> BTW: What did you have to do to compile the thingie on WinNT ?
> I read that freeze.py works on WinNT too, but have never tried it.

Well , it works but I needed to make a few changes as the whole 
build process on windows is geared to producing dlls - what i did 
was this (I had to do this by hand - maybe I'll try to find the time to 
automate this):

- - removed the dllmain routine in the python15 classes
- - undefined the USE_DL_IMPORT macro in config.h
- - ran freeze.py from the command line as defined im your makefile
- - added the *.c files created into the python15 project
- - replaced the standard frozen.c with the newly created frozen.c in 
CGIPython - the "main" method here calls Py_FrozenMain
- - added frozen_dllmain.c from the "PC" directory because that's 
where PyWinFreeze_ExeInit and PyWinFreeze_ExeTerm are 
defined
- - changed the static struct _frozen _PyImport_FrozenModules[] 
definition to extern struct _frozen _PyImport_FrozenModules[]
- - changed the preprocessor definitions to:
NDEBUG,WIN32,_CONSOLE,_MBCS
- - changed the link options to /subsystem:console

And that was it.
"""

More information on installing such a binary is on the mxCGIPython
web-page.

Hope this helps a bit... Florent is the one to ask for details ;-)

--

Something else which might also be related:

The problem with this binary is that it fails to load shared
libs (DLLs on WinNT). This fails for both Unix and Windows
platforms. I haven't dug any deeper into this, but its either
a linker problem (Python's symbols are not found) or some problem with
the interaction of the import mechanism and frozen modules (I had
some reports about the loader not finding the initXXX() functions
of the shared extension modules).

Does anybody have a clue on this one ? Maybe some tips on how
to set the linker options ?

Cheers,
-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                   169 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/