Win32 Binaries?

Michael Ströder michael at stroeder.com
Thu Aug 14 12:34:48 CEST 2003


Mauro,

thanks for your response. I'm very much interested in getting these issues 
solved.

Mauro Cicognini wrote:
> I attach the old setup.cfg from PythonLDAP 2.0.0pre04 that used to work 
> perfectly. I *had* hacked setup.py a little bit then, to make it simple 
> to define symbols. BTW, the particular symbol I need is just "WIN32".

Can you please post your setup.py hack?

>    1. There's no way (AFAIK) to simply "define" a preprocessor symbol
>       within setup.cfg. The distutils scripts expect to have a list of
>       one- or two-element tuples, but the parser has no way to pull
>       those from the .cfg. Besides, the one-element tuple means to
>       "undefine" the symbol, whereas I'd like to just "define" it
>       without giving it a value, which is unnecessary. I managed to
>       insert it using a crude hack within setup.py (just as I had done
>       with the earlier version), but I do not like this solution.

Wouldn't

extra_compile_args = -DWIN32

help?

I can also modify setup.py to properly build the two-tuple list of defines 
from a line (see attached diff)

defines = WIN32

>    2. The "HAVE_XXX" symbol definition in setup.py is Linux-centric:
>       since the libraries under Windows have slightly different names
>       (for instance, "olber32" instead of just "lber"), those symbols
>       would just not get defined. This however was simple enough to fix.

Mainly the HAVE_LIBLDAP_R is of interest. How's the libldap_r called on 
Windows? Additionally you can try to manually set -DHAVE_LIBLDAP_R etc. in 
setup.cfg.

>    3. It appears that any library path under "library_dirs" for some
>       reason gets copied over to "runtime_library_dirs", which makes no
>       sense to me.

No clue why David did it. I removed it and it stills builds under Linux. I'd 
appreciate if others test it on different platforms.

>    4. The linker get called without the default libraries, and in such a
>       way that a whole lot of symbols are found twice, so it just barfs
>       and never links.

Any clue how to solve that?

> After these unsuccessful attempts, I had modified setup.py (which could 
> be OK)

Please post your modifications to setup.py. Proposals welcome.

> but I had also started changing the default Python library 
> scripts, and I'm not comfortable with this.

This is certainly no option.

> So I pulled up the old MSVC 
> project I used for PythonLDAP 1.x, worked on it for a while and got the 
> library to compile nicely.

My goal is to have a setup.py which is suitable to build python-ldap on any 
platform with a platform-specific setup.cfg. So let's sort out the issues 
together. I don't have a Win32 system to test a build therefore your input 
is highly appreciated.

I've attached a unified diff for setup.py. Please test.

Ciao, Michael.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: setup-1.51.py.diff
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20030814/0dbe1d02/attachment.ksh>


More information about the python-ldap mailing list