summaryrefslogtreecommitdiff
path: root/Toolchain
diff options
context:
space:
mode:
authorDevashish <devashishjaiswal86@gmail.com>2020-04-27 13:33:27 +0530
committerAndreas Kling <kling@serenityos.org>2020-04-27 17:59:33 +0200
commitc4d05049c478980e3087c4043ec36ec315ee0f71 (patch)
treecb2b18617ee5e7029c3272a51d4cfa094a49a898 /Toolchain
parent80fecc615a632a5392e499563678de887e52f5df (diff)
downloadserenity-c4d05049c478980e3087c4043ec36ec315ee0f71.zip
Toolchain: Don't create repository for patches if not necessary
The toolchain builds just fine without the git repository (tested on windows and linux). We can skip setting up the repo and apply the patches directly when we aren't working on the toolchain itself. A flag `--dev` has been added for cases when git repo is needed. Without the flag, regular patch is applied. This significantly improves build times for first time builds.
Diffstat (limited to 'Toolchain')
-rwxr-xr-xToolchain/BuildIt.sh33
1 files changed, 25 insertions, 8 deletions
diff --git a/Toolchain/BuildIt.sh b/Toolchain/BuildIt.sh
index 8bccabfd0b..c54e1cd1b1 100755
--- a/Toolchain/BuildIt.sh
+++ b/Toolchain/BuildIt.sh
@@ -32,6 +32,15 @@ elif [ "$(uname -s)" = "FreeBSD" ]; then
NPROC="sysctl -n hw.ncpu"
fi
+git_patch=
+while [ "$1" != "" ]; do
+ case $1 in
+ --dev ) git_patch=1
+ ;;
+ esac
+ shift
+done
+
echo PREFIX is "$PREFIX"
echo SYSROOT is "$SYSROOT"
@@ -111,10 +120,14 @@ pushd "$DIR/Tarballs"
tar -xzf ${BINUTILS_PKG}
pushd ${BINUTILS_NAME}
- git init >/dev/null
- git add . >/dev/null
- git commit -am "BASE" >/dev/null
- git apply "$DIR"/Patches/binutils.patch >/dev/null
+ if [ "$git_patch" = "1" ]; then
+ git init > /dev/null
+ git add . > /dev/null
+ git commit -am "BASE" > /dev/null
+ git apply "$DIR"/Patches/binutils.patch > /dev/null
+ else
+ patch -p1 < "$DIR"/Patches/binutils.patch > /dev/null
+ fi
popd
else
echo "Skipped extracting binutils"
@@ -125,10 +138,14 @@ pushd "$DIR/Tarballs"
tar -xzf $GCC_PKG
pushd $GCC_NAME
- git init >/dev/null
- git add . >/dev/null
- git commit -am "BASE" >/dev/null
- git apply "$DIR"/Patches/gcc.patch >/dev/null
+ if [ "$git_patch" = "1" ]; then
+ git init > /dev/null
+ git add . > /dev/null
+ git commit -am "BASE" > /dev/null
+ git apply "$DIR"/Patches/gcc.patch > /dev/null
+ else
+ patch -p1 < "$DIR"/Patches/gcc.patch > /dev/null
+ fi
popd
else
echo "Skipped extracting gcc"