From 9078f197633c365fda4009dfb79cc4e4fc2df9ae Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 19 Nov 2020 11:32:27 +0200 Subject: [PATCH] busybox: Set CC fallback once --- core/busybox/build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/busybox/build b/core/busybox/build index 474d019b..a0d907e4 100755 --- a/core/busybox/build +++ b/core/busybox/build @@ -5,18 +5,18 @@ for patch in *.patch; do done # Remove forced gcc/g++ usage so builds work on gcc-less systems. -sed -i "s#= g[c+][c+]#= ${CC:-cc}#g" Makefile -sed -i "s#\(\$(CROSS_COMPILE)\)gcc#\1${CC:-cc}#g" Makefile +sed -i "s#= g[c+][c+]#= ${CC:=cc}#g" Makefile +sed -i "s#\(\$(CROSS_COMPILE)\)gcc#\1${CC}#g" Makefile # Ensure that busybox's build system is aware that 'cc' may point # to clang rather than GCC. This is the case in non-GCC systems. -case $("${CC:-cc}" --version) in (*clang*) - sed -i "s&\(\$(CC),\)clang&\1$CC&g" Makefile.flags +case $("$CC" --version) in (*clang*) + sed -i "s&\(\$(CC),\)clang&\1${CC}&g" Makefile.flags esac # Build and install regular busybox. # This excludes utilities which require 'suid' to function. -make CC="${CC:-cc}" HOSTCC="${CC:-cc}" +make CC="$CC" HOSTCC="$CC" make CONFIG_PREFIX="$1/usr" install # Rename the binary temporarily. @@ -25,7 +25,7 @@ mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-nosuid" # Build and install suid busybox. # This _only_ includes utlities which require 'suid' to function. cp -f .config-suid .config -make CC="${CC:-cc}" HOSTCC="${CC:-cc}" +make CC="$CC" HOSTCC="$CC" make CONFIG_PREFIX="$1/usr" install # Aptly name the busybox binaries.