-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild
More file actions
64 lines (48 loc) · 1.82 KB
/
Copy pathbuild
File metadata and controls
64 lines (48 loc) · 1.82 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Bomb out on any errors
set -e
# Setup the environment
export HOME=/home/admin
export PATH=$PATH:$HOME/droid/bin
export ANDROID_NDK=~/droid/android-ndk
export TARGET=/target
# Download the latest version of inetutils
if [ ! -f ~/inetutils-1.9.tar.gz ]; then
wget -O ~/inetutils-1.9.tar.gz http://ftp.gnu.org/gnu/inetutils/inetutils-1.9.tar.gz
fi
for ARCH_NAME in mips arm x86; do
export ARCH_NAME
for BIN_TYPE in nopie pie; do
# Start each build with a fresh source copy
cd ~
rm -rf ~/inetutils-1.9
tar xvzf ~/inetutils-1.9.tar.gz
cd ~/inetutils-1.9
patch -p0 < ~/telnet-android.patch
case "$ARCH_NAME" in
x86)
echo "Compiling for x86"
HOST=i686-linux-android
;;
arm)
echo "Compiling for ARM"
HOST=arm-linux
;;
mips)
echo "Compiling for MIPS"
HOST=mipsel-linux-android
;;
esac
export CC=~/droid/bin/agcc
if [ $BIN_TYPE == "pie" ]; then
export CFLAGS="-g -O2 -pie -fPIE"
else
export CFLAGS="-g -O2"
fi
./configure --host=$HOST --disable-ftp --disable-ftpd --disable-telnetd --disable-talk --disable-talkd --disable-rlogin --disable-rlogind --disable-rsh --disable-rshd --disable-rexec --disable-rexecd --disable-rcp --disable-hostname --disable-tftp --disable-tftpd --disable-ping --disable-ping6 --disable-logger --disable-syslogd --disable-inetd --disable-whois --disable-uucpd --disable-ifconfig --disable-traceroute
echo "#undef HAVE_STRUCT_UTMP_UT_TYPE" >> config.h
make
astrip telnet/telnet
cp telnet/telnet $TARGET/telnet-$ARCH_NAME-$BIN_TYPE
done
done