-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-toolchain
executable file
·103 lines (91 loc) · 1.71 KB
/
setup-toolchain
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
DEPS=" \
libgmp3-dev \
libmpfr-dev \
libmpc-dev \
texinfo \
bison \
flex \
libfuse-dev \
xorriso \
mtools \
qemu \
grub-pc-bin
"
function print() {
echo -e $1
}
function print_error() {
echo -e "ERROR: " $1
}
function install_dependencies() {
sudo apt install -y $DEPS
}
function install_gcc() {
cd $PREFIX
git clone -b gcc-5_4_0-release --depth 1 https://github.com/gcc-mirror/gcc.git
mkdir tmp
cd tmp
../gcc/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
make all-gcc -j$(nproc)
make all-target-libgcc -j$(nproc)
make install-gcc
make install-target-libgcc
cd ../
rm -rf tmp
rm -rf gcc
cd $BUILD_ROOT
}
function install_binutils() {
cd $PREFIX
git clone git://sourceware.org/git/binutils-gdb.git
mkdir tmp
cd tmp
../binutils-gdb/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make -j$(nproc)
make install
cd ../
rm -rf binutils-gdb
rm -rf tmp
cd $BUILD_ROOT
}
function install_tup() {
cd $PREFIX
git clone git://github.com/gittup/tup.git
cd tup
./bootstrap.sh
mv tup $PREFIX/bin/
cd ../
rm -rf tup
cd $BUILD_ROOT
tup init
}
function install_nasm() {
cd $PREFIX
mkdir nasm
cd nasm
wget http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.gz
tar xf nasm-2.13.02.tar.gz
cd nasm-2.13.02
./configure --target=$TARGET --prefix="$PREFIX"
make
make install
cd ../../
rm -rf nasm
cd $BUILD_ROOT
}
function setup_toolchain_folder() {
mkdir -p toolchain
}
if [ -z "$reyOS" ]; then
print_error "Did you source the env file?"
exit 1
fi;
sudo -v
#install_dependencies
#setup_toolchain_folder
#install_binutils
#install_gcc
#install_tup
# install_nasm
exit