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 134838 - Configure fails to use -lm for Python
Configure fails to use -lm for Python
Status: VERIFIED FIXED
Product: gcompris
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Bruno Coudoin
Rami Aubourg-Kaires
Depends on:
Blocks:
 
 
Reported: 2004-02-19 14:13 UTC by Göran Uddeborg
Modified: 2005-03-14 17:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Göran Uddeborg 2004-02-19 14:13:30 UTC
Trying to build gcompris on my Fedora system, the configure script said

checking for Py_Initialize in -lpython2.2... no

That suprised me a bit, since I do have Python installed.  Taking a closer
look at the log, I found that it was because the test link failed to
include -lm when linking the test program.  I got error messages like this:

/usr/lib/python2.2/config/libpython2.2.a(floatobject.o)(.text+0x1289): In
function `float_pow':
: undefined reference to `pow'

and so on for a number of the math functions.

I looked further in the configure.in, and saw the file
.../pythonX.X/config/Makefile is used to find what necessary libraries
should be used.  In this file, -lm is included, but not found by the
pattern used in configure.in.  The relevant part of the Makefile looks like
this

LIBM=           -lm
LIBC=           
SYSLIBS=        $(LIBM) $(LIBC)
Comment 1 Bruno Coudoin 2004-02-19 22:53:37 UTC
I don't understand very well. 
The file you mention as .../pythonX.X/config/Makefile
Does it bellong to gcompris or is part of the devel python install ?
Comment 2 Göran Uddeborg 2004-02-20 23:13:21 UTC
The file .../pythonX.X/config/Makefile is part of python-devel.  But
it is referenced in configure.in of gcompris (line 203 through 210 in
gcompris 5.2), used to figure out what libraries to link Python with.

(The file configure.in IS source, isn't it?  It's not generated from
anything in yet another step?  I know it is used to generate the file
configure.  I thought it was not in turn itself generated, but I don't
know those things very well.)
Comment 3 Bruno Coudoin 2004-02-23 22:15:54 UTC
I see your point now. On my Mandrake, -lm library is not linked but
the test passes. It is good anyway to add -lm. Please, could you
change gcompris configure.in to look like bellow and confirm me the
bug is gone.

    dnl extra required libs
      python_localmodlibs=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p'
$python_makefile`
      python_basemodlibs=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p'
$python_makefile`
      python_other_libs=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $python_makefile`
      python_libs_m=`sed -n -e 's/^LIBM=\(.*\)/\1/p' $python_makefile`
      python_libs_cflags=`sed -n -e 's/^LINKFORSHARED=\(.*\)/\1/p'
$python_makefile`
      python_libs="${python_localmodlibs} ${python_basemodlibs}
${python_other_libs} ${python_libs_m}"
Comment 4 Göran Uddeborg 2004-02-24 11:26:25 UTC
Yes, the bug is gone.  Your fix seems to work just fine! :-)
Comment 5 Rami Aubourg-Kaires 2004-02-25 16:50:03 UTC
Can we consider the bug as fixed, then? 
This might be useful for other distros (SuSE...),too, where the 
gcompris python plugin isn't found. 
 
Rami 
Comment 6 Bruno Coudoin 2004-02-27 23:43:28 UTC
OK, updated the CVS. It will be in next gcompris release.