/
recipe.sh
79 lines (69 loc) · 1.61 KB
/
recipe.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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
VERSION=7.6p1
TAR=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-$VERSION.tar.gz
BUILD_DEPENDS=(zlib openssl)
export AR="${HOST}-ar"
export AS="${HOST}-as"
export CC="${HOST}-gcc"
export CXX="${HOST}-g++"
export LD="${HOST}-gcc"
export NM="${HOST}-nm"
export OBJCOPY="${HOST}-objcopy"
export OBJDUMP="${HOST}-objdump"
export RANLIB="${HOST}-ranlib"
export READELF="${HOST}-readelf"
export STRIP="${HOST}-strip"
function recipe_version {
echo "$VERSION"
skip=1
}
function recipe_update {
echo "skipping update"
skip=1
}
function newlib_build {
rm -rf ../newlib
sysroot="${PWD}/../sysroot"
cd ..
git clone --recursive https://github.com/sajattack/newlib -b ssh-deps
cd newlib
pushd newlib/libc/sys
aclocal-1.11 -I ../..
autoconf
automake-1.11 --cygnus Makefile
popd
pushd newlib/libc/sys/redox
aclocal-1.11 -I ../../..
autoconf
automake-1.11 --cygnus Makefile
popd
CC= ./configure --target="${HOST}" --prefix=/
make all
make DESTDIR="$sysroot" install
cd ..
cp -r $sysroot/x86_64-unknown-redox/* $sysroot
rm -rf $sysroot/x86_64-unknown-redox
rm -rf newlib
cd build
}
function recipe_build {
newlib_build
sysroot="${PWD}/../sysroot"
export LDFLAGS="-L$sysroot/lib"
export CPPFLAGS="-I$sysroot/include"
./configure --host=${HOST} --prefix=/
make
skip=1
}
function recipe_test {
echo "skipping test"
skip=1
}
function recipe_clean {
make clean
skip=1
}
function recipe_stage {
dest="$(realpath $1)"
make DESTDIR="$dest" install
skip=1
}