Patchwork [3/5] python-thrift: fix cross building

login
register
mail settings
Submitter Gustavo Zacarias
Date Oct. 25, 2013, 12:15 p.m.
Message ID <1382703323-31038-3-git-send-email-gustavo@zacarias.com.ar>
Download mbox | patch
Permalink /patch/286133/
State Accepted
Commit db164caf12ac8a8a0af53e181450762d680c82d8
Headers show

Comments

Gustavo Zacarias - Oct. 25, 2013, 12:15 p.m.
The C code (fastbinary.so) wasn't built using the cross compiler, hence
it was unusable. Fix it.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/python-thrift/python-thrift.mk | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
Ryan Barnett - Oct. 25, 2013, 9:54 p.m.
Gustavo Zacarias <gustavo@zacarias.com.ar> wrote on 10/25/2013 07:15:21 
AM:

> The C code (fastbinary.so) wasn't built using the cross compiler, hence
> it was unusable. Fix it.
> 
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>

Acked-by: Ryan Barnett <rjbarnet@rockwellcollins.com>

> ---
>  package/python-thrift/python-thrift.mk | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>

Patch

diff --git a/package/python-thrift/python-thrift.mk b/package/python-thrift/python-thrift.mk
index 4cd35e5..65733d4 100644
--- a/package/python-thrift/python-thrift.mk
+++ b/package/python-thrift/python-thrift.mk
@@ -9,13 +9,18 @@  PYTHON_THRIFT_SOURCE = thrift-$(PYTHON_THRIFT_VERSION).tar.gz
 PYTHON_THRIFT_SITE = http://pypi.python.org/packages/source/t/thrift
 PYTHON_THRIFT_LICENSE = Apache-2.0
 PYTHON_THRIFT_LICENSE_FILES = README
-
 PYTHON_THRIFT_DEPENDENCIES = python
 
 define PYTHON_THRIFT_BUILD_CMDS
 	(cd $(@D); \
-		PYTHONXCPREFIX="$(STAGING_DIR)/usr/" \
-		LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
+		CC="$(TARGET_CC)" \
+		CFLAGS="$(TARGET_CFLAGS)" \
+		LDSHARED="$(TARGET_CROSS)gcc -shared" \
+		CROSS_COMPILING=yes \
+		_python_sysroot=$(STAGING_DIR) \
+		_python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION) \
+		_python_prefix=/usr \
+		_python_exec_prefix=/usr \
 		$(HOST_DIR)/usr/bin/python setup.py build)
 endef