[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2] autoconf: check for Python.h header and -lpython* lib



>>> On 12.03.12 at 14:35, Roger Pau MonnÃ<roger.pau@xxxxxxxxxxxxx> wrote:
> 2012/3/12 Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>:
>> Roger Pau Monne writes ("[PATCH v2] autoconf: check for Python.h header and 
> -lpython* lib"):
>>> autoconf: check for Python.h header and -lpython* lib
>>
>> Right, this is better.
>>
>>> +ac_previous_cppflags=$CPPFLAGS
>> ...
>>> +AC_CHECK_HEADER([Python.h], [],
>>> +    [AC_MSG_ERROR([Unable to find Python development headers])],)
>>> +AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
>>> +    [AC_MSG_ERROR([Unable to find a suitable python development library])])
>>> +CPPFLAGS=$ac_previous_cppflags
>>> +LDLFAGS=$ac_previous_ldflags
>>
>> But AFAICT we go to all this effort to find the right python flags and
>> then we throw them away.  This is a bit odd.  Shouldn't we be passing
>> this in some PYTHON_FOOFLAGS variables for the benefit of tools/python ?
> 
> This would only be needed to compile Python C modules, but since
> python uses it's own standart build script (tools/python/setup.py) and
> we already pass to the setup.py script the desired python version to
> use, it already fetches the necessary includes/libs using it's own
> mechanisms.

I'm sorry to say that, but this change is pretty incompatible: Not only
does Python not provide any python-config prior to 2.5.x, but
additionally was Ian's point above very valid: Stripping all the other
-l options causes a configure failure for me:

configure:6176: checking for PyArg_ParseTuple in -lpython2.4
configure:6201: gcc -o conftest  -g -O2   -g -O2  -I/usr/include/python2.4 
-I/usr/include/python2.4 
-L/usr/lib/python2.4/config conftest.c -lpython2.4   >&5
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function 
`posix_tmpnam':
(.text+0x81e): warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function 
`posix_tempnam':
(.text+0x90c): warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
`complex_abs':
(.text+0x54d): undefined reference to `hypot'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
`_Py_c_pow':
(.text+0x2418): undefined reference to `hypot'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
`_Py_c_pow':
(.text+0x242a): undefined reference to `pow'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
`_Py_c_pow':
(.text+0x243f): undefined reference to `atan2'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
`_Py_c_pow':
(.text+0x2470): undefined reference to `cos'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
`_Py_c_pow':
(.text+0x2483): undefined reference to `sin'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
`_Py_c_pow':
(.text+0x24f6): undefined reference to `exp'
/usr/lib/python2.4/config/libpython2.4.a(complexobject.o): In function 
`_Py_c_pow':
(.text+0x2507): undefined reference to `log'
/usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function 
`float_rem':
(.text+0x17c8): undefined reference to `fmod'
/usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function 
`float_divmod':
(.text+0x25a8): undefined reference to `fmod'
/usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function 
`float_pow':
(.text+0x296f): undefined reference to `pow'
/usr/lib/python2.4/config/libpython2.4.a(floatobject.o): In function 
`float_pow':
(.text+0x2a03): undefined reference to `fmod'
/usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function 
`_PyImport_GetDynLoadFunc':
(.text+0x12e): undefined reference to `dlsym'
/usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function 
`_PyImport_GetDynLoadFunc':
(.text+0x195): undefined reference to `dlopen'
/usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function 
`_PyImport_GetDynLoadFunc':
(.text+0x1c3): undefined reference to `dlsym'
/usr/lib/python2.4/config/libpython2.4.a(dynload_shlib.o): In function 
`_PyImport_GetDynLoadFunc':
(.text+0x232): undefined reference to `dlerror'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
`PyThread_release_lock':
(.text+0x49): undefined reference to `sem_post'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
`PyThread_acquire_lock':
(.text+0xc7): undefined reference to `sem_wait'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
`PyThread_acquire_lock':
(.text+0xe2): undefined reference to `sem_trywait'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
`PyThread_free_lock':
(.text+0x1f2): undefined reference to `sem_destroy'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
`PyThread_allocate_lock':
(.text+0x267): undefined reference to `sem_init'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
`PyThread_start_new_thread':
(.text+0x568): undefined reference to `pthread_create'
/usr/lib/python2.4/config/libpython2.4.a(thread.o): In function 
`PyThread_start_new_thread':
(.text+0x586): undefined reference to `pthread_detach'
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function 
`posix_forkpty':
(.text+0x3189): undefined reference to `forkpty'
/usr/lib/python2.4/config/libpython2.4.a(posixmodule.o): In function 
`posix_openpty':
(.text+0x3218): undefined reference to `openpty'
collect2: ld returned 1 exit status

As you can see, all unresolved symbols revolve around symbols from
those other libraries - the symbol looked for (PyArg_ParseTuple) is not
among them.

As this is the second time (out of two tries) that the newly added
configure logic causes problems for me (and hence eats time intended
to be spent elsewhere), I really have to question to quality of all of
this. Am I to expect that going forward I will have to plan several
hours for taking a fresh snapshot, rather than just making my
(usually short) patch queue apply and build?

Jan

>> Ian.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx 
> http://lists.xen.org/xen-devel 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.