help linking to python for dbus-python bindings

Mark Mikofski bwanamarko at yahoo.com
Wed Jul 4 22:08:46 PDT 2012


Simon, thanks so much for helping me (and others) in getting dbus-python built for windows! I will try out the wip-windows branch and let you know how it goes. 

*IT WORKS!*

Also, I'm hopeful for the cmake build, because the win32 python is build on msvc90, and uses that redist for extensions, altho supposedly alt compilers can also be used (I've yet to test this - but I guess mingw-gcc-4.7  works!). Of course this will pose another issue for dbus-glib, which I haven't successfully built with msvc.

Question on merging the cmake branch - have Ralf Habacker's KDE patches [1] been merged? I don't think they were merged in choeger's fork, and they probably have some redundancies. I guess maybe it would be nice to have all of the windows ports sync'd upstream (as was done for dbus) so there is a single source.

Also, maybe I should have filed a bug, but I think it's an automake bug in python.m4 [2] not in dbus-python. The command that finds the python package directory, gets mangled on windows because it doesn't pad the backslashes with an extra backslash, so everything get run together, e.g. ${prefix}Libsite-packages, instead of ${prefix}\\Lib\\site-packages. My fix is to edit the configure file and add ".replace('\\\\\','/')" to those lines. Then it works on windows.

Also, I am still getting the following warnings during make:

    libtool: link: warning: undefined symbols not allowed in i686-pc-mingw32 sharedlibraries

Anyway, thanks again!

[1] http://websvn.kde.org/trunk/kdesupport/emerge/portage/testing/dbus-python/ 

[2] http://poquitopicante.blogspot.com/2012/07/pythonm4-macro-not-for-windows-mingw32.html


Thanks,
Mark Mikofski
poquitopicante.blogspot.com
breakingbytes.blogspot.com
www.breaking-bytes.com


________________________________
 From: Simon McVittie <simon.mcvittie at collabora.co.uk>
To: dbus at lists.freedesktop.org 
Sent: Wednesday, July 4, 2012 4:29 AM
Subject: Re: help linking to python for dbus-python bindings
 
On 04/07/12 01:44, Mark Mikofski wrote:
> I have passed PYTHON_LIBS="-L/c/python27/libs -llibpython27.a" with and
> without the "a" extension.

The right syntax for -l (at least on Unix...) looks like "-lpython27".
You shouldn't specify the "lib" at the beginning, or the extension (.a,
.dll, .lib) at the end - the compiler should add those automatically.

If you have libraries visible to your compiler in
/c/python27/libs/libpython27.a, /c/python27/libs/libpython27.lib and/or
/c/python27/libs/libpython27.dll (probably easiest to copy them all into
the same directory?) then the correct value for PYTHON_LIBS would be:

    PYTHON_LIBS="-L/c/python27/libs -lpython27"

Please try this patched version of the dbus-python source, which should
hopefully improve matters on Windows:

http://people.freedesktop.org/~smcv/dbus-python-1.1.1.20120704.tar.gz

or get the 'wip-windows' branch from the dbus-python git repository
(it's the same code). Let me know if this works better, I'll merge it if
there's positive feedback.

> I also made my own library from python27.dll using the directions on
> mingw faqs [1], then linking using PYTHON_LIBS="-L/mingw/lib
> -libpython27" which is where I copied the library too, both with and
> without the "a" extension.

When reporting a bug or asking for help, a good format is:

* what you did (in enough detail that someone else could do exactly the
same - so in this case, please include the exact configure and make
commands you used)

* what you expected to happen (presumably "a _dbus_bindings.pyd that I
can import" in this case)

* what actually happened, including the exact text of any error messages

Thanks,
    S
_______________________________________________
dbus mailing list
dbus at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dbus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20120704/64bb02be/attachment.html>


More information about the dbus mailing list