python-ldap freezing

Alexander Meisel python-ldap-dev at
Tue May 20 11:04:48 CEST 2003


just an update how to do it.
It is possible to freeze the python ldap library with your code.
All you have to do is to archive the .o files into a file called _ldap.a
and link them against the frozen binary.
If you build py-ldap you find the .o files in /build/tmp..../*.o
You need to build an archive (which basically combines them to one file)
Linux: ar c _ldap.a /path/to/o/files/*.o
Solaris: ar -q _ldap.a /path/to/o/files/*.o

Then you use as you normally would. After the make, you see the last
giant gcc line which links everything to the binary. Copy and paste the line
but add the _ldap.a file before the libpython2.2.a. You basically link the
file again, but this time with the ldap library.

Happy code freezing!

            Alexander Meisel

On Tue, May 13, 2003 at 09:12:25PM +0200, Michael Ströder wrote:
> Alexander Meisel wrote:
> > 
> > I have to freeze the software I wrote in order to get it running on a
> > system which is not allowed to have a python (in fact any scripting language)
> > installation. I use the python ldap module with the utility in the
> > Python tools distribution, but don't quite know what to do (in the building
> > process) to the module to make it 'freezable'.
> The following note in Python-2.2.2/Tools/freeze/README does not sound too good.
> --------------------------------- snip ---------------------------------
> A warning about shared library modules
> --------------------------------------
> When your Python installation uses shared library modules such as
> _tkinter.pyd, these will not be incorporated in the frozen program.
>   Again, the frozen program will work when you test it, but it won't
>   work when you ship it to a site without a Python installation.
> --------------------------------- snip ---------------------------------
> I tried to freeze Demo/ but did not succeed.
> Ciao, Michael.

More information about the python-ldap mailing list