From patchwork Tue Jul 21 13:22:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 6835851 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 557419F38B for ; Tue, 21 Jul 2015 13:22:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73F35205EC for ; Tue, 21 Jul 2015 13:22:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 667D8205E9 for ; Tue, 21 Jul 2015 13:22:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753415AbbGUNWt (ORCPT ); Tue, 21 Jul 2015 09:22:49 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:35879 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbbGUNWs (ORCPT ); Tue, 21 Jul 2015 09:22:48 -0400 Received: by wgbcc4 with SMTP id cc4so63239581wgb.3 for ; Tue, 21 Jul 2015 06:22:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fZhpTmE7JhNd/ZaxsOLnbJ24eDWR9TAp5aQXSF1PHvY=; b=TWn7i5sYMET6TxhUFUC6lacpj8TFIY+B3rlQMtU4AwQNrlmrPdkadooVcIDDQsVGJg iLT6cpDS17TQLv0eoI6qvxZJkjW93v8uIZDZJWh91F16BJte0VANEOAqNzyz0ng6d58L r8U3sYIwjMJoIfFDDvZBrhogmK6rGagbh1JjjUizSOFuZVKOelyYee33ObXy/aciekGT oknbeJbdFrHmFVuvOIrGyTZ8b4xfoEd4DcFJFN2pIDzjyGxTiNHbNy6m7V8jv5mxKX7T ljPioWb3IePyMbLhm08YsFJ7E7/TaZnYrj5zLmssheGDYuLqQzVmIF2RrZ8hrk4Jbjyn RCKA== X-Gm-Message-State: ALoCoQmk7qdfew45V0+akGiSU8J+jtRr/X/BTgRsML+vOLLeLOu3BRnIQmP7CANKmDbix7Hvn2YC X-Received: by 10.180.92.40 with SMTP id cj8mr30256234wib.92.1437484967188; Tue, 21 Jul 2015 06:22:47 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-144-121-210.as13285.net. [78.144.121.210]) by smtp.gmail.com with ESMTPSA id wx9sm25492603wjb.6.2015.07.21.06.22.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Jul 2015 06:22:46 -0700 (PDT) From: Srinivas Kandagatla To: Michal Marek Cc: yann.morin.1998@free.fr, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH RFC] merge_config.sh: Add support to pass arguments to make Date: Tue, 21 Jul 2015 14:22:36 +0100 Message-Id: <1437484956-23985-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The issue is flags like ARCH can be passed to make via environment variable or at command line by passing "ARCH=" argument to make file. The former case works fine if used with merge_config but the later case would not work and resulting config file from merge_config is useless. I hit this issue when I started using config fragments on arm64 bit platform and I usually pass ARCH at the make command line. As it is common for users like me to pass ARCH variable in command line, providing such flexiblity in merge_config makes more sense. This patch adds support to pass arguments to make file, without this patch the user has to set the enviroment variables which is not explicit. Signed-off-by: Srinivas Kandagatla --- scripts/kconfig/merge_config.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index ec8e203..8d9cae4 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -28,6 +28,7 @@ trap clean_up HUP INT TERM usage() { echo "Usage: $0 [OPTIONS] [CONFIG [...]]" + echo " -a arguments to make command. ex: ARCH=arm" echo " -h display this help text" echo " -m only merge the fragments, do not execute the make command" echo " -n use allnoconfig instead of alldefconfig" @@ -39,6 +40,7 @@ RUNMAKE=true ALLTARGET=alldefconfig WARNREDUN=false OUTPUT=. +MAKE_ARGS="" while true; do case $1 in @@ -61,6 +63,11 @@ while true; do shift continue ;; + "-a") + MAKE_ARGS=$2 + shift 2 + continue + ;; "-O") if [ -d $2 ];then OUTPUT=$(echo $2 | sed 's/\/*$//') @@ -139,7 +146,7 @@ fi # Use the merged file as the starting point for: # alldefconfig: Fills in any missing symbols with Kconfig default # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set -make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET +make $MAKE_ARGS KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET # Check all specified config values took (might have missed-dependency issues)