-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi686-elf-build.sh
More file actions
64 lines (50 loc) · 1.48 KB
/
Copy pathi686-elf-build.sh
File metadata and controls
64 lines (50 loc) · 1.48 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
# Default args
jobs="${1:-4}"
export GCC_VER=15.2.0
export BINUTILS_VER=2.45.1
# export GDB_VER=15.2
# Exports
export PREFIX="/opt/i686-elf"
export TARGET=i686-elf
#export PREFIX="/opt/x86_64-elf"
#export TARGET=x86_64-elf
export PATH="$PREFIX/bin:$PATH"
#sudo mkdir -p $PREFIX
mkdir -p $HOME/build-$(TARGET)
cd $HOME/build-$(TARGET)
# Downloads
wget https://ftp.gnu.org/gnu/gcc/gcc-$GCC_VER/gcc-$GCC_VER.tar.xz
wget https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS_VER.tar.xz
# wget ftp://ftp.gnu.org/gnu/gdb/gdb-$GDB_VER/gdb-$GDB_VER.tar.xz
tar -xvf binutils-$BINUTILS_VER.tar.xz
tar -xvf gcc-$GCC_VER.tar.gz
# tar -xvf gdb-$GDB_VER.tar.xz
# Binutils
mkdir build-binutils
cd build-binutils
../binutils-$BINUTILS_VER/configure --target=$TARGET --prefix="$PREFIX" --disable-multilib --disable-nls --disable-werror
make -j$jobs
sudo make -j$jobs install
cd ..
# GCC
cd gcc-$GCC_VER
./contrib/download_prerequisites
cd ..
mkdir build-gcc
cd build-gcc
../gcc-$GCC_VER/configure --target=$TARGET --prefix="$PREFIX" --disable-multilib --disable-nls --disable-werror --enable-languages=c,c++ --without-headers --without-isl
make -j$jobs all-gcc
make -j$jobs all-target-libgcc
sudo make -j$jobs install-gcc
sudo make -j$jobs install-target-libgcc
cd ..
# GDB
# mkdir build-gdb
# cd build-gdb
# ../gdb-$GDB_VER/configure --target="$TARGET" --prefix="$PREFIX"
# make -j$jobs
# sudo make -j$jobs install
# cd ..
cd $HOME
# rm -rf $HOME/build-$(TARGET)