From patchwork Mon Sep 30 21:20:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 279265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id CD38D2C00BB for ; Tue, 1 Oct 2013 07:20:58 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6A4338C84E; Mon, 30 Sep 2013 21:20:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T6CZC2uWdnk0; Mon, 30 Sep 2013 21:20:56 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D2BCA8C7ED; Mon, 30 Sep 2013 21:20:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 5EC221CE6B3 for ; Mon, 30 Sep 2013 21:20:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5B4EB93B09 for ; Mon, 30 Sep 2013 21:20:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JZzxrDVzh8c9 for ; Mon, 30 Sep 2013 21:20:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (top.free-electrons.com [176.31.233.9]) by hemlock.osuosl.org (Postfix) with ESMTP id B0C4693AE4 for ; Mon, 30 Sep 2013 21:20:51 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id AF2B28CE; Mon, 30 Sep 2013 23:20:54 +0200 (CEST) Received: from localhost (AToulouse-651-1-249-226.w90-50.abo.wanadoo.fr [90.50.128.226]) by mail.free-electrons.com (Postfix) with ESMTPSA id 4E16B8A7 for ; Mon, 30 Sep 2013 23:20:54 +0200 (CEST) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Mon, 30 Sep 2013 23:20:46 +0200 Message-Id: <1380576047-21001-3-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1380576047-21001-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1380576047-21001-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [PATCH 3/4] python3: fix python-config for cross-compilation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Some packages (trace-cmd) use python3-config to find out which headers and libraries should be used to link against the Python libraries. By default, python3-config returns paths that are inappropriate for cross-compilation: this patch fixes this by prepending those paths by the staging directory location. Signed-off-by: Thomas Petazzoni --- package/python3/python3.mk | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/package/python3/python3.mk b/package/python3/python3.mk index a8a1942..e6cf8d4 100644 --- a/package/python3/python3.mk +++ b/package/python3/python3.mk @@ -124,14 +124,20 @@ PYTHON3_MAKE_ENV = \ PYTHON_MODULES_INCLUDE=$(STAGING_DIR)/usr/include \ PYTHON_MODULES_LIB="$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib" -# python distutils adds -L$LIBDIR when linking binary extensions, causing -# trouble for cross compilation -define PYTHON3_FIXUP_LIBDIR +# 1. python distutils adds -L$LIBDIR when linking binary extensions, +# causing trouble for cross compilation. +# +# 2. adjust the python-config in the staging directory so that it +# returns include paths that are valid on the build machine (i.e +# prefixed by the STAGING_DIR). +define PYTHON3_FIXUP_DIRS $(SED) 's|^LIBDIR=.*|LIBDIR= $(STAGING_DIR)/usr/lib|' \ $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/config-3.3m/Makefile + $(SED) "s|'-I'|'-I$(STAGING_DIR)'|" \ + $(STAGING_DIR)/usr/bin/python$(PYTHON3_VERSION_MAJOR)-config endef -PYTHON3_POST_INSTALL_STAGING_HOOKS += PYTHON3_FIXUP_LIBDIR +PYTHON3_POST_INSTALL_STAGING_HOOKS += PYTHON3_FIXUP_DIRS # # Remove useless files. In the config/ directory, only the Makefile