aboutsummaryrefslogtreecommitdiff
path: root/core/busybox
diff options
context:
space:
mode:
Diffstat (limited to 'core/busybox')
-rwxr-xr-xcore/busybox/build14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/busybox/build b/core/busybox/build
index df00282d..a34e5e3c 100755
--- a/core/busybox/build
+++ b/core/busybox/build
@@ -10,10 +10,16 @@ for patch in *.patch; do
patch -p1 < "$patch"
done
+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 CC="${CC:-gcc}"
-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"
@@ -21,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 CC="${CC:-gcc}"
-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"