forked from MalcolmLorber/kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcross.sh
More file actions
executable file
·44 lines (31 loc) · 1.08 KB
/
cross.sh
File metadata and controls
executable file
·44 lines (31 loc) · 1.08 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
if [[ "$1" == "" ]]
then
echo "Usage: $0 /path/to/install/dir"
exit
fi
echo "Ensure you have libgmp3-dev libmpfr-dev libisl-dev libcloog-isl-dev libmpc-dev texinfo installed, as well as build-essential"
export PREFIX="$1"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"
mkdir -p $PREFIX/build/tarballs
cd $PREFIX/build/tarballs
wget "ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.4/gcc-4.8.4.tar.gz"
wget "ftp://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.gz"
mkdir -p $PREFIX/build
cd $PREFIX/build
tar -zxf "tarballs/binutils-2.25.tar.gz"
tar -zxf "tarballs/gcc-4.8.4.tar.gz"
mkdir $PREFIX/build/binutils-build
cd $PREFIX/build/binutils-build
../binutils-2.25/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make
make install
mkdir -p $PREFIX/build/gcc
cd $PREFIX/build/gcc
which -- $TARGET-as || echo "$TARGET-as is not in the PATH"
../gcc-4.8.4/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc