From f7f7491fc3e1e2e455b63ba65988141cba07f12b Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Wed, 30 Dec 2020 23:00:20 +0300 Subject: busybox: fix cross compilation --- core/busybox/build | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'core/busybox') diff --git a/core/busybox/build b/core/busybox/build index 766bc487..f8c919ec 100755 --- a/core/busybox/build +++ b/core/busybox/build @@ -10,13 +10,16 @@ for patch in *.patch; do patch -p1 < "$patch" done -[ "$CPT_CROSS_TRIPLET" ] && -sed -i "/^CONFIG_CROSS_COMPILER_PREFIX/s/=.*/=\"$CPT_CROSS_TRIPLET-\"/" .config .config-suid +if [ "$CPT_CROSS_TRIPLET" ]; then + mk() { make ARCH=${CPT_CROSS_TRIPLET%%-*} CROSS_COMPILE=$CPT_CROSS_TRIPLET- "$@" ;} +else + mk() { make "$@" ;} +fi # Build and install regular busybox. # This excludes utilities which require 'suid' to function. -make -make CONFIG_PREFIX="$1/usr" install +mk +mk CONFIG_PREFIX="$1/usr" install # Rename the binary temporarily. mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-nosuid" @@ -24,8 +27,8 @@ 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 -make CONFIG_PREFIX="$1/usr" install +mk +mk CONFIG_PREFIX="$1/usr" install # Aptly name the busybox binaries. mv "$1/usr/bin/busybox" "$1/usr/bin/busybox-suid" -- cgit v1.2.3