1 Fix get_python_inc() for cross-compilation
3 When we are cross compiling, doing os.path.dirname(sys.executable) to
4 get the build directory is incorrect, because we're executing the host
5 Python to build things for the target. Instead, we should use the
8 This fixes cross-compilation, which was adding incorrect header paths
9 pointing to the location where the host Python was built:
11 /home/thomas/projets/buildroot/output/host/usr/bin/arm-none-linux-gnueabi-gcc -fPIC -fno-strict-aliasing \
12 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -DNDEBUG -g -O3 -Wall -Wstrict-prototypes \
13 -I/usr/include -I. -IInclude -I./Include -I/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/include \
14 -I/home/thomas/projets/buildroot/output/host/usr/bin/Include -I/home/thomas/projets/buildroot/output/host/usr/bin \
15 -c /home/thomas/projets/buildroot/output/build/python-2.7.6/Modules/_struct.c \
16 -o build/temp.linux2-arm-2.7/home/thomas/projets/buildroot/output/build/python-2.7.6/Modules/_struct.o
18 This patch allows to fix the
19 /home/thomas/projets/buildroot/output/host/usr/bin/Include and
20 /home/thomas/projets/buildroot/output/host/usr/bin paths that are
21 incorrectly added to the header paths.
23 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
24 Index: b/Lib/distutils/sysconfig.py
25 ===================================================================
26 --- a/Lib/distutils/sysconfig.py
27 +++ b/Lib/distutils/sysconfig.py
30 if os.name == "posix":
32 - buildir = os.path.dirname(sys.executable)
33 + buildir = project_base
35 # python.h is located in the buildir