Commit 2cd3faf8 authored by Petr Vorel's avatar Petr Vorel Committed by Masahiro Yamada

merge_config.sh: Allow to define config prefix

with CONFIG_ environment variable.

merge_config.sh uses CONFIG_ which is used in kernel and other projects.
There are some projects which use kconfig with different prefixes (e.g.
buildroot: BR2_ prefix). CONFIG_ variable is already used for this
purpose in kconfig binary (scripts/kconfig/lkc.h), let's use the same
rule for in merge_config.sh.
Suggested-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarPetr Vorel <petr.vorel@gmail.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 3f80babd
...@@ -33,12 +33,15 @@ usage() { ...@@ -33,12 +33,15 @@ usage() {
echo " -n use allnoconfig instead of alldefconfig" echo " -n use allnoconfig instead of alldefconfig"
echo " -r list redundant entries when merging fragments" echo " -r list redundant entries when merging fragments"
echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead." echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead."
echo
echo "Used prefix: '$CONFIG_PREFIX'. You can redefine it with \$CONFIG_ environment variable."
} }
RUNMAKE=true RUNMAKE=true
ALLTARGET=alldefconfig ALLTARGET=alldefconfig
WARNREDUN=false WARNREDUN=false
OUTPUT=. OUTPUT=.
CONFIG_PREFIX=${CONFIG_-CONFIG_}
while true; do while true; do
case $1 in case $1 in
...@@ -99,7 +102,8 @@ if [ ! -r "$INITFILE" ]; then ...@@ -99,7 +102,8 @@ if [ ! -r "$INITFILE" ]; then
fi fi
MERGE_LIST=$* MERGE_LIST=$*
SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p"
TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
echo "Using $INITFILE as base" echo "Using $INITFILE as base"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment