forked from ddrown/busybox-build
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build
31 lines (27 loc) · 1009 Bytes
/
build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
set -e
export HOME=/home/admin
export PATH=$PATH:/home/admin/droid/bin
cd ~/busybox
for ARCH_NAME in x86 arm mips; do
export ARCH_NAME
for bintype in pie nopie; do
if [ "$bintype" = "nopie" -a "$ARCH_NAME" = "x86" ]; then
# target Android 2.3/API version 9 for the x86 non-pie binaries, the oldest available in the NDK
export GOOGLE_PLATFORM=9
elif [ "$bintype" = "nopie" -a "$ARCH_NAME" = "arm" ]; then
# target Android 2.2/API version 8 for the arm non-pie binaries, the oldest commonly used
export GOOGLE_PLATFORM=8
# API version 8 does not have arpa/telnet.h header, use API version 9's
mkdir -p include/arpa
cp /home/admin/droid/android-ndk/platforms/android-9/arch-arm/usr/include/arpa/telnet.h include/arpa/
else
# use default target for pie binaries (currently 15/ICS)
unset GOOGLE_PLATFORM
fi
make clean
cp .config-$bintype .config
make
cp busybox /target/busybox-$ARCH_NAME-$bintype
done
done