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: Greg Troxel
Subject: Re: [gpsd-dev] [PATCH]: Link Python extensions with libpython
Date: Tue, 09 Dec 2014 09:04:01 -0500
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.4 (berkeley-unix)

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 :-)

But seriously, you've checked how things behave, but I'd like to see
what happens grounded in the python documentation of how things are
supposed to behave, and not respond to errors in config scripts (instead
filing bugs someplace to have them fixed).

Above, it looks like the pkg-config output is right - it sets paths for
-L and -R, and just links against the python shlib.  The python shlib
links with various things:

  /usr/pkg/lib/libpython2.7.so:
        -lutil.7 => /usr/lib/libutil.so.7
        -lgcc_s.1 => /lib/libgcc_s.so.1
        -lc.12 => /usr/lib/libc.so.12
        -lm.0 => /usr/lib/libm.so.0
        -lpthread.1 => /usr/lib/libpthread.so.1

but users of the library shouldn't have to know or care.

I wonder if sysconfig.get_config_vars('LIBRARY') is supposed to return
what python needs, rather than what users should use.

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.

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.


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.

Attachment: pgpO6ehN5ci8p.pgp
Description: PGP signature


reply via email to

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