From 5ef32b9530198f22a01c65e6d297644e19b89c5c Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 6 Sep 2021 11:44:58 -0500 Subject: [PATCH] Allow standalone builds to override .config filename too. --- scripts/single.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/single.sh b/scripts/single.sh index c40c6bcf..ba30441f 100755 --- a/scripts/single.sh +++ b/scripts/single.sh @@ -12,16 +12,16 @@ fi [ "$PREFIX" == "${PREFIX%/}" ] && PREFIX="${PREFIX:+$PREFIX/}" # Harvest TOYBOX_* symbols from .config -if [ ! -e .config ] +if [ ! -e ${KCONFIG_CONFIG:=.config} ] then - echo "Need .config for toybox global settings. Run defconfig/menuconfig." >&2 + echo "Need $KCONFIG_CONFIG for toybox global settings. Run defconfig/menuconfig." >&2 exit 1 fi # Force dependencies to rebuild headers if we build multiplexer after this. -touch -c .config +touch -c "$KCONFIG_CONFIG" -export KCONFIG_CONFIG=.singleconfig +SINGLE_CONFIG=.singleconfig for i in "$@" do echo -n "$i:" @@ -33,7 +33,7 @@ do exit 1 fi - make allnoconfig > /dev/null || exit 1 + KCONFIG_CONFIG="$SINGLE_CONFIG" make allnoconfig > /dev/null || exit 1 DEPENDS= MPDEL= @@ -45,13 +45,13 @@ do fi # Enable stuff this command depends on - DEPENDS="$({ echo $DEPENDS; sed -n "/^config *$i"'$/,/^$/{s/^[ \t]*depends on //;T;s/[!][A-Z0-9_]*//g;s/ *&& */|/g;p}' $TOYFILE; sed -n 's/CONFIG_\(TOYBOX_[^=]*\)=y/\1/p' .config;}| xargs | tr ' ' '|')" + DEPENDS="$({ echo $DEPENDS; sed -n "/^config *$i"'$/,/^$/{s/^[ \t]*depends on //;T;s/[!][A-Z0-9_]*//g;s/ *&& */|/g;p}' $TOYFILE; sed -n 's/CONFIG_\(TOYBOX_[^=]*\)=y/\1/p' "$KCONFIG_CONFIG";}| xargs | tr ' ' '|')" NAME=$(echo $i | tr a-z- A-Z_) sed -ri -e "$MPDEL" \ -e "s/# (CONFIG_($NAME|${NAME}_.*${DEPENDS:+|$DEPENDS})) is not set/\1=y/" \ - "$KCONFIG_CONFIG" || exit 1 #&& grep "CONFIG_TOYBOX_" .config >> "$KCONFIG_CONFIG" || exit 1 + "$SINGLE_CONFIG" || exit 1 export OUTNAME="$PREFIX$i" rm -f "$OUTNAME" && - scripts/make.sh || exit 1 + KCONFIG_CONFIG="$SINGLE_CONFIG" scripts/make.sh || exit 1 done -- 2.39.2