gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] [PATCH]: Link Python extensions with libpython


From: Matt
Subject: Re: [gpsd-dev] [PATCH]: Link Python extensions with libpython
Date: Thu, 25 Dec 2014 15:46:50 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/12/14 01:04, Greg Troxel wrote:
> 
> I tend to agree with Bernd about using python-config.  But another 
> question: could it basically be viewed as a bug in python on cygwin
> that we're even having this discussion?
> 
> On a NetBSD system:
> 
> $ pkg-config python-2.7 --libs -L/usr/pkg/lib -Wl,-R/usr/pkg/lib
> -lpython2.7
> 
> $ python2.7-config --libs -lutil -lm -lpython2.7
> 
> which may indicate bugs in how python2.7-config is treated by
> pkgsrc :-)
> 

Ok, patch to use python-config attached, with the option to override
its location (eg for cross compilation) via an environment variable,
as is already done for other tools.

Interesting to compare my Debian to your NetBSD:

$ pkg-config python --libs
- -lpython2.7

$ pkg-config python-2.7 --libs
- -lpython2.7

$ python-config --libs
- -lpthread -ldl  -lutil -lm  -lpython2.7

$ python2.7-config --libs
- -lpthread -ldl  -lutil -lm  -lpython2.7

I don't understand why on both systems, the output of pkg-config foo
- --libs and foo-config --libs differs. I would have expected them to be
the same.

> The larger issue seems to be dll names vs -l.   Is your python
> version also from cygwin?  It seems like when building under cygwin
> all your dependencies should also be from cygwin.

Yes, everything here is cygwin currently; I am not directly using any
MinGW or native Windows tools (yet).

For Cygwin, everyything works when I just trust python-config to Do
The Right Thing. And if it broke, I think it would be a bug in
python-config rather than gpsd's SConstruct script.

> I would think pkg-config should be used.  That's what autoconf
> would have been.  It's merely a coincident that we are using
> SConstruct which is written in python.

I feel we should trust python-config to know python better than
pkg-config?

> Also, Bernd's point about cross compiling is a good one.  python
> doesn't seem super cross friendly, but we shouldn't make things
> worse.  And definitely the target system's pkg-config setup (or
> python-config) should be used; the python instance running
> SConstruct is entirely different logically.

Agreed, use of distutils running in the scons process for this purpose
is totally wrong; it hinders cross compilation.
A while ago I did a cygwin host --> mingw target cross compile, and
sure enough this got in my way when I attempted to run tests.
Also, ultimately, I would like to enable Linux host --> mingw target
cross compilation.
So for a number of reasons I want cross compilation to work well.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJUm5a6AAoJECH/phKUbjXC9bcIANIkVPdfIBh7/qzPuOLJfsJv
WGfAQ6iABNSBz667Od4X6EOIA7hgLg9kaZ06+5b46kR19toWXnAc2BNLXoMj8tfN
XJpP5KQ6TJPzo2Mue+12nxbJb9saZZvv63nIHrPDQWIy9S8V6kjAeseDLwFBLAxI
j5O1/QgAcRn6oeRvArMT53YWEofySaKfwY8ZEvuPomZPljbXa2igZR9Cjh7ZG0X1
UoPcObYtnXgrWMUop+22ReYnIRg2WpWNEirQLeEULAgFQ+hh2238PdeiExALxrRv
pDjZVK9HCIU5IFwI0dRFN+ZwhWbzJlObxWA50t+Ouy0j6zeQ0yEphEO8ZcK8+Eg=
=IuI0
-----END PGP SIGNATURE-----

Attachment: link-python-extensions-with-libpython-attempt-3.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]