diff options
author | Cem Keylan <cem@ckyln.com> | 2020-12-30 23:00:20 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2020-12-30 23:00:20 +0300 |
commit | f7f7491fc3e1e2e455b63ba65988141cba07f12b (patch) | |
tree | 42a1b21693dc893d735be09895a7d594e5bd7fe3 /core/busybox/build | |
parent | 217e152268e7895a8a78693621305b9412e255d1 (diff) | |
download | repository-f7f7491fc3e1e2e455b63ba65988141cba07f12b.tar.gz |
busybox: fix cross compilation
Diffstat (limited to 'core/busybox/build')
-rwxr-xr-x | core/busybox/build | 15 |
1 files changed, 9 insertions, 6 deletions
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" |