busybox: Fix build when 'cc' is clang.

This simply makes busybox's build system aware of the fact that
cc == clang (it usually hardcodes clang).

Closes #240
This commit is contained in:
Dylan Araps 2020-11-19 11:27:12 +02:00
parent eb412f08f5
commit e8f700827d
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

View File

@ -8,6 +8,12 @@ done
sed -i "s#= g[c+][c+]#= ${CC:-cc}#g" Makefile
sed -i "s#\(\$(CROSS_COMPILE)\)gcc#\1${CC:-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
esac
# Build and install regular busybox.
# This excludes utilities which require 'suid' to function.
make CC="${CC:-cc}" HOSTCC="${CC:-cc}"