GNOME Bugzilla – Bug 134838
Configure fails to use -lm for Python
Last modified: 2005-03-14 17:10:37 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)
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 ?
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.)
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}"
Yes, the bug is gone. Your fix seems to work just fine! :-)
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
OK, updated the CVS. It will be in next gcompris release.