aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksa Vučković <aleksav013@gmail.com>2022-01-16 14:50:40 +0100
committerAleksa Vučković <aleksav013@gmail.com>2022-01-16 15:42:51 +0100
commitf1cbe59ab86f6832e5c36b19ada7967bda9c7cd7 (patch)
tree5b0ed86eade4aa6ddf40038f305a7b31836a96e6
parent8e377d9241ed4098b58d3531c80aa2c0cb285077 (diff)
Moved install_headers.sh to aleksav013/mykernel
-rwxr-xr-xscripts/install_headers.sh12
-rwxr-xr-xscripts/setup.sh66
2 files changed, 41 insertions, 37 deletions
diff --git a/scripts/install_headers.sh b/scripts/install_headers.sh
deleted file mode 100755
index 99e7266..0000000
--- a/scripts/install_headers.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-SYSROOT="/opt/aleksa"
-SYSROOT_INCLUDE=$SYSROOT/usr/include
-
-if [ ! -d mykernel ]; then
- git clone "https://github.com/aleksav013/mykernel"
-fi
-
-rm -rf "$SYSROOT_INCLUDE"
-mkdir -p "$SYSROOT_INCLUDE"
-cp -r mykernel/src/include/* "$SYSROOT_INCLUDE"
diff --git a/scripts/setup.sh b/scripts/setup.sh
index 1340090..c4c0a53 100755
--- a/scripts/setup.sh
+++ b/scripts/setup.sh
@@ -2,25 +2,29 @@
SYSROOT=/opt/aleksa
+BINUTILS=binutils-2.37
+GCC=gcc-11.2.0
+
+
download()
{
- if [ ! -f "./binutils-2.37.tar.gz" ]; then
- wget "https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.gz"
+ if [ ! -f "./$BINUTILS.tar.gz" ]; then
+ wget "https://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.gz"
fi
- if [ ! -f "./gcc-11.2.0.tar.gz" ]; then
- wget "https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz"
+ if [ ! -f "./$GCC.tar.gz" ]; then
+ wget "https://ftp.gnu.org/gnu/gcc/$GCC/$GCC.tar.gz"
fi
}
extract()
{
- if [ ! -d "./binutils-2.37" ]; then
- tar xzvf "./binutils-2.37.tar.gz"
+ if [ ! -d "./$BINUTILS" ]; then
+ tar xzvf "./$BINUTILS.tar.gz"
fi
- if [ ! -d "./gcc-11.2.0" ]; then
- tar xzvf "./gcc-11.2.0.tar.gz"
+ if [ ! -d "./$GCC" ]; then
+ tar xzvf "./$GCC.tar.gz"
fi
}
@@ -29,35 +33,42 @@ patch_gnu()
mkdir -p "./mine"
cd "./mine" || exit
- if [ ! -d "./binutils-2.37" ]; then
- cp -r "../binutils-2.37" .
- patch -p0 < "../files/aleksa-binutils-2.37.diff"
- cd "./binutils-2.37/ld" || exit
+ if [ ! -d "./$BINUTILS" ]; then
+ cp -r "../$BINUTILS" .
+ patch -p0 < "../files/aleksa-$BINUTILS.diff"
+ cd "./$BINUTILS/ld" || exit
sed -i "s/2.69/2.71/" "Makefile.am"
aclocal
automake
- cd "../.." || exit
+ cd "../.."
fi
- if [ ! -d "./gcc-11.2.0" ]; then
- cp -r "../gcc-11.2.0" .
- patch -p0 < "../files/aleksa-gcc-11.2.0.diff"
- cd "./gcc-11.2.0/libstdc++-v3" || exit
+ if [ ! -d "./$GCC" ]; then
+ cp -r "../$GCC" .
+ patch -p0 < "../files/aleksa-$GCC.diff"
+ cd "./$GCC/libstdc++-v3" || exit
sed -i "s/2.69/2.71/" "../config/override.m4"
autoreconf
- cd "../.." || exit
+ cd "../.."
fi
- cd ".." || exit
+
+ cd ".."
}
install_headers()
{
+ if [ ! -d "mykernel" ]; then
+ git clone https://github.com/aleksav013/mykernel
+ fi
+
+ cd "mykernel" || exit
./scripts/install_headers.sh
+ cd ".."
}
build_binutils()
{
- cd "./mine/binutils-2.37" || exit
+ cd "./mine/$BINUTILS" || exit
mkdir -p build
cd build || exit
@@ -72,12 +83,12 @@ build_binutils()
make -j4
make install
- cd "../../.." || exit
+ cd "../../.."
}
build_gcc()
{
- cd "./mine/gcc-11.2.0" || exit
+ cd "./mine/$GCC" || exit
mkdir -p build
cd build || exit
@@ -91,10 +102,15 @@ build_gcc()
--enable-languages=c,c++
fi
- make -j4 all-gcc all-target-libgcc
- make install-gcc install-target-libgcc
+ make -j4 all-gcc
+ make -j4 all-target-libgcc
+
+ make -k check || true
+
+ make install-gcc
+ make install-target-libgcc
- cd "../../.." || exit
+ cd "../../.."
}
additions()