-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
35 lines (32 loc) · 1.17 KB
/
build.sh
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
#!/bin/sh
if [ ! -z $CROSS_COMP ] && [ -z `command -v $CROSS_COMP-gcc` ]; then
unset CROSS_COMP
fi
wget http://zlib.net/zlib-1.2.11.tar.gz
tar xvzf zlib-1.2.11.tar.gz
mkdir zlib_compiled
cd zlib-1.2.11
./configure --prefix=../zlib_compiled
if [ ! -z $CROSS_COMP ]; then
sed -i 's/gcc/$(CROSS_COMP)-gcc/g' Makefile
sed -i 's/AR=ar/AR=$(CROSS_COMP)-ar/g' Makefile
fi
make && make install
cd ..
wget https://github.com/mkj/dropbear/archive/DROPBEAR_2019.78.tar.gz
tar xvzf DROPBEAR_2019.78.tar.gz
patch -p0 < patch.patch
cd dropbear-DROPBEAR_2019.78
autoconf && autoheader
if [ ! -z $CROSS_COMP ]; then
./configure --host="$CROSS_COMP" --disable-lastlog --disable-utmp --disable-utmpx --disable-wtmp --disable-wtmpx --disable-shadow --disable-syslog --enable-static --with-zlib=`realpath ../zlib_compiled`
else
./configure --disable-lastlog --disable-utmp --disable-utmpx --disable-wtmp --disable-wtmpx --disable-shadow --disable-syslog --enable-static --with-zlib=`realpath ../zlib_compiled`
fi
make STATIC=1 MULTI=1 PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp"
if [ ! -z $CROSS_COMP ]; then
$CROSS_COMP-strip -s dropbearmulti
else
strip -s dropbearmulti
fi
cp dropbearmulti ../