Bug 57800

Summary: Please prefer pkg-config over python-config
Product: systemd Reporter: Michał Górny <mgorny>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: enhancement    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Michał Górny 2012-12-02 11:02:24 UTC
systemd recently started using python-config to detect python. This method is outdated and the modern way is to use pkg-config modules which are installed in python2.7+.

  $ pkg-config --cflags --libs python-2.7
  -I/usr/include/python2.7  -lpython2.7
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-03-14 04:11:46 UTC
That would simplify a lot of things for us. But it seems to be only available from 2.7, but we support 2.6 now. I guess we could drop support for 2.6.

One advantage of python-config is that it is easy to go from python-config to python by simple string substitution. Let's say that I detect flags and libs for some python. How do I know which binary to call?
Comment 2 Michał Górny 2013-03-14 08:18:20 UTC
(In reply to comment #1)
> That would simplify a lot of things for us. But it seems to be only
> available from 2.7, but we support 2.6 now. I guess we could drop support
> for 2.6.

Well, as the summary states, I was suggesting using it and default and having a fallback to python-config. But either way's fine, I think.

> One advantage of python-config is that it is easy to go from python-config
> to python by simple string substitution. Let's say that I detect flags and
> libs for some python. How do I know which binary to call?

I'd say it's just another substitution. Since you would call:

  $ pkg-config --libs python-${PYTHON_VERSION}

You could just go for:

  python${PYTHON_VERSION}

However, I'm not sure where you would need that.
Comment 3 Zbigniew Jedrzejewski-Szmek 2013-07-26 15:32:30 UTC
Fixed in http://cgit.freedesktop.org/systemd/systemd/commit/?id=a6c0b31d5.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.