From patchwork Thu Jan 10 19:52:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Fr=C3=B6berg?= X-Patchwork-Id: 211141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 5EBEC2C00E1 for ; Fri, 11 Jan 2013 07:02:29 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id DFEFEA02DA; Thu, 10 Jan 2013 20:02:29 +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 M6pIzs9bGdzv; Thu, 10 Jan 2013 20:02:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2C4EDA02E5; Thu, 10 Jan 2013 20:02:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 935738F74B for ; Thu, 10 Jan 2013 20:02:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 315968CF94 for ; Thu, 10 Jan 2013 20:02:21 +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 wlGtwnpJAYIa for ; Thu, 10 Jan 2013 20:02:15 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.petroprogram.com (mail.petroprogram.com [194.89.34.74]) by whitealder.osuosl.org (Postfix) with ESMTPS id 921A88CFD1 for ; Thu, 10 Jan 2013 20:02:08 +0000 (UTC) Received: from localhost.fi (88-148-147-17.bb.dnainternet.fi [88.148.147.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: stefan.froberg@petroprogram.com) by mail.petroprogram.com (Postfix) with ESMTPSA id 8FE7D4DB6D; Thu, 10 Jan 2013 21:52:57 +0200 (EET) From: =?UTF-8?q?Stefan=20Fr=C3=B6berg?= To: buildroot@busybox.net Date: Thu, 10 Jan 2013 21:52:39 +0200 Message-Id: <1357847559-31530-2-git-send-email-stefan.froberg@petroprogram.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1357847559-31530-1-git-send-email-stefan.froberg@petroprogram.com> References: <1357847559-31530-1-git-send-email-stefan.froberg@petroprogram.com> MIME-Version: 1.0 Cc: thomas.petazzoni@free-electrons.com Subject: [Buildroot] [PATCH v2] pkg-infra: add _CONFIG_FIXUP to fix *-config files 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: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net This patch will add _CONFIG_FIXUP variable to buildroot infra. It's purpose is to inform buildroot that the package in question contains some $(STAGING_DIR)/usr/bin/*-config files and that we want to automatically fix prefixes of such files. It is often the case that many packages call these files during their configuration step to determine 3rd party library package locations and any flags needed to link against them. For example: Some package might try to check the existense and linking flags of NSPR package by calling $(STAGING_DIR)/usr/bin/nspr-config --prefix. Without this fix, NSPR would return /usr/ as it's prefix which is wrong when cross-compiling. Correct would be $(STAGING_DIR)/usr. All packages that have _INSTALL_STAGING = YES defined and also install some config file(s) into $(STAGING_DIR)/usr/bin must hereafter also define _CONFIG_FIXUP with the corresponding filename(s). For example: DIVINE_CONFIG_FIXUP = divine-config or for multiple files: IMAGEMAGICK_CONFIG_FIXUP = Magick-config Wand-config Signed-off-by: Stefan Fröberg Acked-by: Arnout Vandecappelle (Essensium/Mind) --- package/pkg-generic.mk | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index a570ad7..9f6ea7b 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -121,6 +121,12 @@ $(BUILD_DIR)/%/.stamp_staging_installed: @$(call MESSAGE,"Installing to staging directory") $($(PKG)_INSTALL_STAGING_CMDS) $(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep)) + $(Q)if test -n "$($(PKG)_CONFIG_FIXUP)" ; then \ + $(call MESSAGE,"Fixing package configuration files") ;\ + $(SED) "s,^prefix=.*,prefix=$(STAGING_DIR)/usr,g" \ + -e "s,^exec_prefix=.*,exec_prefix=$(STAGING_DIR)/usr,g" \ + $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_FIXUP)) ;\ + fi $(Q)touch $@ # Install to images dir