[xml] libxml2 cross-compilation && Python

The libxml2 configure script sets PYTHON_LIBS as

        PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags`

How is this expected to work in a cross-compilation environment?  
For example, I am on an x86_64 host building for arm-linux.
So by running this command, I'll always get a library path for x86_64 libraries.
Note that I can't run the arm-linux binary on my x86_64 host.

How is this expected to work?  Is it expected that you can already run your target binaries on your build 
host (using some simulator)?
Should Python support be explicitly disabled when cross-compiling?
Should the configure script be tweaked to massage the output to replace the -L line with something that 
involves $prefix?
Am I completely confused and doing something wrong?  Missing command line parameter? 

Here is the error message I get, as expected when trying to link an x86_64 library to an arm image:

CCLD   libxml2mod.la
 could not read symbols: File format not recognized

configure determined that PYTHON_LIBS should be

-L/project/swbuild38/balsup/trees/gpl/scratch/sysroot/x86_64-linux/usr/local/lib/python2.7/config -lpthread 
-ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic

when in fact it should be

PYTHON_LIBS = -L/project/swbuild38/balsup/trees/gpl/scratch/sysroot/arm-linux/usr/local/lib/python2.7/config 
-lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic

What is the best solution?
Certainly I can massage configure to do what I want in this case, but I don't know the correct general 
Simply changing x86_64 to arm (using sed in the PYTHON_LIBS setting) is sufficient, but is not a general 

Using libxml2.9.0 and python2.7.2

Note that PYTHON_INCLUDES was already correct as it is based on $prefix.

./configure --host=arm-linux-gnu 

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