After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 448711 - use python-config to get python includes
use python-config to get python includes
Status: RESOLVED FIXED
Product: gnome-menus
Classification: Core
Component: general
2.19.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-menus dummy account
gnome-menus dummy account
Depends on:
Blocks:
 
 
Reported: 2007-06-18 08:36 UTC by Sebastien Bacher
Modified: 2007-08-08 20:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
use python-config to get python includes (803 bytes, patch)
2007-06-18 08:37 UTC, Sebastien Bacher
none Details | Review
version updated to use test -x (721 bytes, patch)
2007-06-18 08:46 UTC, Sebastien Bacher
committed Details | Review
ubuntu-python-config (1.39 KB, text/plain)
2007-08-02 20:57 UTC, Gilles Dartiguelongue
  Details
gentoo-python-config (179 bytes, text/plain)
2007-08-02 21:04 UTC, Gilles Dartiguelongue
  Details

Description Sebastien Bacher 2007-06-18 08:36:49 UTC
This patch is shipped with the Ubuntu package and required to do a build using
python-dbg
Comment 1 Sebastien Bacher 2007-06-18 08:37:12 UTC
Created attachment 90191 [details] [review]
use python-config to get python includes
Comment 2 Sebastien Bacher 2007-06-18 08:46:17 UTC
Created attachment 90194 [details] [review]
version updated to use test -x
Comment 3 Vincent Untz 2007-06-18 09:17:03 UTC
Thanks!
Comment 4 Cosimo Cecchi 2007-07-09 09:46:46 UTC
This does not work in gentoo.
python-config gives this output

-lpython2.4 -lm -L/usr/lib/python2.4/config

and gnome-menus-2.19.5 refuses to configure with --enable-python.
Reverting to previous version of acinclude.m4 fixes the issue.
Comment 5 Gilles Dartiguelongue 2007-07-12 22:16:21 UTC
Hi, I'm one of the gentoo developers and can confirm the previous comment.
Python version is 2.4.4. Is this flag limited to 2.5 by any chance ?
Comment 6 Gilles Dartiguelongue 2007-07-12 22:17:54 UTC
adding gnome herd to track down this issue.
Comment 7 Cosimo Cecchi 2007-07-18 12:54:11 UTC
This also happens on gnome-python-2.19.1 and gnome-python-desktop-2.19.1.
Comment 8 Vincent Untz 2007-07-22 22:15:36 UTC
So, it works with my version of python2.4-config. Don't know why.
Comment 9 Gilles Dartiguelongue 2007-07-22 22:28:27 UTC
some ubuntu hackers around could enlighten us on what they do with their python patching/building ?
Comment 10 Sebastien Bacher 2007-07-23 10:28:07 UTC
the patch has a test for python-config, if you don't have it available it uses the static definition
Comment 11 Cosimo Cecchi 2007-07-23 10:51:01 UTC
Sebastian, our problem, at least on Gentoo is that we do have python-config, but calling it does not give the expected includes, but just 
-lpython2.4 -lm -L/usr/lib/python2.4/config
Comment 12 Gilles Dartiguelongue 2007-08-02 20:57:47 UTC
Created attachment 92948 [details]
ubuntu-python-config
Comment 13 Gilles Dartiguelongue 2007-08-02 21:04:43 UTC
Created attachment 92949 [details]
gentoo-python-config

here is gentoo's python-config script. Obviously ubuntu's version if far more complete and it seems more generic to me. I don't know where to pick the "reference" version of this file. I asked for directions from our python guys but they seem to be busy at the moment.

and to get back to the bug, we can now see why this patch won't work on gentoo atm. I see that gnome-python as this too and I bet it'll spread on other packages sooner or later and I don't really want to unpatch all of these...
Comment 14 Sebastien Bacher 2007-08-02 22:07:10 UTC
The upstream version is on http://svn.python.org/projects/python/trunk/Misc/python-config.in and is similar to the Ubuntu one, looks like a gentoo bug
Comment 15 Daniel Gryniewicz 2007-08-08 18:19:40 UTC
Yes and no; as I understand it, python 2.4 didn't ship a python-config (at least, it's not in the tarball for 2.4.4)  Obviously python 2.5 does, so it's fine.  But, depending on python-config fails when python 2.4 or less is installed.  So, either python-config shouldn't be needed, or the dep for python should be for 2.5, I believe.

I'll try and get our manually created python-config for 2.4 updated to work.

Does ubuntu have one for python 2.4?  Does this work with that?
Comment 16 Sebastien Bacher 2007-08-08 20:37:19 UTC
did you read the change?

"+if test -x "$PYTHON-config"; then
+PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
+else"

the "if test -x "$PYTHON-config"; then" means that if there is a python-config it's used otherwise it does the same thing as before the change
Comment 17 Daniel Gryniewicz 2007-08-08 20:40:22 UTC
Ah, I missed that.  So the problem is gentoo's abortive python-config for 2.4.  I'll get it fixed.