-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathbuild
More file actions
executable file
·44 lines (34 loc) · 1.18 KB
/
Copy pathbuild
File metadata and controls
executable file
·44 lines (34 loc) · 1.18 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
#!/bin/bash -e
# Copyright © 2020-2026 Matt Robinson
#
# SPDX-License-Identifier: MIT
if [ -z "$ANDROID_NDK_HOME" ]; then
echo "ANDROID_NDK_HOME is not set" >&2
exit 1
fi
TARGET=${TARGET:-armv7a-linux-androideabi}
PLATFORM=21
toolchain=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64
version=$(cat dropbear-version)
patches=$(find . -maxdepth 1 -name "*.patch" | wc -l)
[ "$patches" -lt 1 ] && unset -v patches
[ -d buildinfo ] || mkdir buildinfo
echo $PLATFORM > buildinfo/minsdk
echo "$version${patches+p$patches}" > buildinfo/release
grep Pkg.Revision "$ANDROID_NDK_HOME/source.properties" | \
cut -d ' ' -f 3 >> buildinfo/ndkver
git clone --branch "$version" --depth 1 https://github.com/mkj/dropbear.git
cd dropbear
if [ "$patches" ]; then
for patch in ../*.patch; do
patch -p1 < "$patch"
done
fi
./configure --host="$TARGET" --disable-lastlog --disable-utmp --disable-wtmp \
AR="$toolchain/bin/llvm-ar" \
CC="$toolchain/bin/$TARGET$PLATFORM-clang" \
RANLIB="$toolchain/bin/llvm-ranlib" \
STRIP="$toolchain/bin/llvm-strip"
cp ../localoptions.h .
make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" \
SCPPROGRESS=1 strip