mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +00:00
Toolchain: Only reextract GCC-related tarballs if patches change
This brings the behaviour in line with Clang, which already does this since a few revisions.
This commit is contained in:
parent
1faca15193
commit
b52b6e8739
1 changed files with 53 additions and 43 deletions
|
@ -239,53 +239,63 @@ pushd "$DIR/Tarballs"
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d ${BINUTILS_NAME} ]; then
|
patch_md5="$(${MD5SUM} "${DIR}"/Patches/binutils/*.patch)"
|
||||||
rm -rf "${BINUTILS_NAME}"
|
|
||||||
rm -rf "$DIR/Build/$ARCH/$BINUTILS_NAME"
|
|
||||||
fi
|
|
||||||
echo "Extracting binutils..."
|
|
||||||
tar -xzf ${BINUTILS_PKG}
|
|
||||||
|
|
||||||
pushd ${BINUTILS_NAME}
|
if [ ! -d "${BINUTILS_NAME}" ] || [ "$(cat ${BINUTILS_NAME}/.patch.applied)" != "${patch_md5}" ]; then
|
||||||
if [ "$git_patch" = "1" ]; then
|
if [ -d ${BINUTILS_NAME} ]; then
|
||||||
git init > /dev/null
|
rm -rf "${BINUTILS_NAME}"
|
||||||
git add . > /dev/null
|
rm -rf "${DIR}/Build/${ARCH}/${BINUTILS_NAME}"
|
||||||
git commit -am "BASE" > /dev/null
|
|
||||||
git am "$DIR"/Patches/binutils/*.patch > /dev/null
|
|
||||||
else
|
|
||||||
for patch in "$DIR"/Patches/binutils/*.patch; do
|
|
||||||
patch -p1 < "$patch" > /dev/null
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
$MD5SUM "$DIR"/Patches/binutils/*.patch > .patch.applied
|
echo "Extracting binutils..."
|
||||||
popd
|
tar -xzf ${BINUTILS_PKG}
|
||||||
|
|
||||||
if [ -d ${GCC_NAME} ]; then
|
pushd ${BINUTILS_NAME}
|
||||||
# Drop the previously patched extracted dir
|
if [ "${git_patch}" = "1" ]; then
|
||||||
rm -rf "${GCC_NAME}"
|
git init > /dev/null
|
||||||
# Also drop the build dir
|
git add . > /dev/null
|
||||||
rm -rf "$DIR/Build/$ARCH/$GCC_NAME"
|
git commit -am "BASE" > /dev/null
|
||||||
fi
|
git am "${DIR}"/Patches/binutils/*.patch > /dev/null
|
||||||
echo "Extracting gcc..."
|
else
|
||||||
tar -xzf $GCC_PKG
|
for patch in "${DIR}"/Patches/binutils/*.patch; do
|
||||||
pushd $GCC_NAME
|
patch -p1 < "${patch}" > /dev/null
|
||||||
if [ "$git_patch" = "1" ]; then
|
done
|
||||||
git init > /dev/null
|
fi
|
||||||
git add . > /dev/null
|
${MD5SUM} "${DIR}"/Patches/binutils/*.patch > .patch.applied
|
||||||
git commit -am "BASE" > /dev/null
|
|
||||||
git am --keep-non-patch "$DIR"/Patches/gcc/*.patch > /dev/null
|
|
||||||
else
|
|
||||||
for patch in "$DIR"/Patches/gcc/*.patch; do
|
|
||||||
patch -p1 < "$patch" > /dev/null
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
$MD5SUM "$DIR"/Patches/gcc/*.patch > .patch.applied
|
|
||||||
popd
|
|
||||||
|
|
||||||
if [ "$SYSTEM_NAME" = "Darwin" ]; then
|
|
||||||
pushd "gcc-${GCC_VERSION}"
|
|
||||||
./contrib/download_prerequisites
|
|
||||||
popd
|
popd
|
||||||
|
else
|
||||||
|
echo "Using existing binutils source directory"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
patch_md5="$(${MD5SUM} "${DIR}"/Patches/gcc/*.patch)"
|
||||||
|
|
||||||
|
if [ ! -d "${GCC_NAME}" ] || [ "$(cat ${GCC_NAME}/.patch.applied)" != "${patch_md5}" ]; then
|
||||||
|
if [ -d ${GCC_NAME} ]; then
|
||||||
|
rm -rf "${GCC_NAME}"
|
||||||
|
rm -rf "${DIR}/Build/${ARCH}/${GCC_NAME}"
|
||||||
|
fi
|
||||||
|
echo "Extracting gcc..."
|
||||||
|
tar -xzf ${GCC_PKG}
|
||||||
|
|
||||||
|
pushd ${GCC_NAME}
|
||||||
|
if [ "${git_patch}" = "1" ]; then
|
||||||
|
git init > /dev/null
|
||||||
|
git add . > /dev/null
|
||||||
|
git commit -am "BASE" > /dev/null
|
||||||
|
git am --keep-non-patch "${DIR}"/Patches/gcc/*.patch > /dev/null
|
||||||
|
else
|
||||||
|
for patch in "${DIR}"/Patches/gcc/*.patch; do
|
||||||
|
patch -p1 < "${patch}" > /dev/null
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
${MD5SUM} "${DIR}"/Patches/gcc/*.patch > .patch.applied
|
||||||
|
|
||||||
|
if [ "${SYSTEM_NAME}" = "Darwin" ]; then
|
||||||
|
./contrib/download_prerequisites
|
||||||
|
fi
|
||||||
|
popd
|
||||||
|
else
|
||||||
|
echo "Using existing GCC source directory"
|
||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue