From patchwork Fri Oct 19 23:06:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1620291 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 13087DF2AB for ; Fri, 19 Oct 2012 23:06:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757064Ab2JSXGk (ORCPT ); Fri, 19 Oct 2012 19:06:40 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:59616 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758501Ab2JSXGj (ORCPT ); Fri, 19 Oct 2012 19:06:39 -0400 Received: by mail-we0-f174.google.com with SMTP id t9so499018wey.19 for ; Fri, 19 Oct 2012 16:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=JqQ4ia+AU+FAEtgotE7hRi0mTR4bwWdNkA7ue/zVno4=; b=F1nVanX9XmkdUNxufKiXn4H1+fdEcY1xoXz6m5Qrormr9A9YxKG9S4n6AQltC4orM3 AVJes0O1r+v5lwoncBSFP66BKcN5CtUHtYIbdmP473zv/wvf64N4ccVOjn3ml7OTRUbc Jb+OnwqmCnizm3PDWm/mo+LLlyqmwJtrD65sbONVmXOvXeUFX4nfnTv4l/0tsLHXc3QC Btxt0uWCmFjY6HKgMsw+5iPLdp79tgfMRvOl1sJ3YU4StDTtAwxq4N6Oq2Qc2FoqOFL6 X0mR0VKu7+5Qes8fswC2ZanxOMBz8Ud6B5m5YCo37jiG0pLKVgZ9ugwNzsjS1cO98mRk TiOQ== Received: by 10.216.141.16 with SMTP id f16mr1699661wej.130.1350687997843; Fri, 19 Oct 2012 16:06:37 -0700 (PDT) Received: from localhost.localdomain (ARennes-256-1-43-34.w90-32.abo.wanadoo.fr. [90.32.26.34]) by mx.google.com with ESMTPS id fp6sm17125857wib.0.2012.10.19.16.06.37 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Oct 2012 16:06:37 -0700 (PDT) From: "Yann E. MORIN" To: linux-kbuild@vger.kernel.org Cc: Michal Marek , linux-kernel@vger.kernel.org, "Yann E. MORIN" Subject: [PATCH 3/3] kconfig: get CONFIG_ prefix from the environment Date: Sat, 20 Oct 2012 01:06:25 +0200 Message-Id: <1350687985-21053-4-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1350687985-21053-1-git-send-email-yann.morin.1998@free.fr> References: <1350687985-21053-1-git-send-email-yann.morin.1998@free.fr> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Currently, the CONFIG_ prefix is hard-coded in the kconfig frontends executables. This means that two projects that use kconfig with different prefixes can not share the same kconfig frontends. Instead of hard-coding the prefix in the frontends, get it from the environment, and revert back to hard-coded value if not found. Signed-off-by: "Yann E. MORIN" --- scripts/kconfig/gconf.c | 2 +- scripts/kconfig/lkc.h | 2 +- scripts/kconfig/nconf.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c index adc2306..f2bee70 100644 --- a/scripts/kconfig/gconf.c +++ b/scripts/kconfig/gconf.c @@ -10,6 +10,7 @@ # include #endif +#include #include "lkc.h" #include "images.c" @@ -22,7 +23,6 @@ #include #include #include -#include //#define DEBUG diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 7aa9db0..7577a7f 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -41,7 +41,7 @@ extern "C" { #endif static inline const char *CONFIG_prefix(void) { - return CONFIG_; + return getenv( "CONFIG_" ) ?: CONFIG_; } #undef CONFIG_ #define CONFIG_ CONFIG_prefix() diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c index 261f926..ce93e87 100644 --- a/scripts/kconfig/nconf.c +++ b/scripts/kconfig/nconf.c @@ -7,6 +7,7 @@ */ #define _GNU_SOURCE #include +#include #include "lkc.h" #include "nconf.h"