mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-16 06:30:41 +00:00
Toolchain: Cache the output of uname -s
This commit is contained in:
parent
c60f02fbc2
commit
8a50c8431b
|
@ -26,7 +26,9 @@ else
|
||||||
INSTALL=install
|
INSTALL=install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(uname -s)" = "OpenBSD" ]; then
|
SYSTEM_NAME="$(uname -s)"
|
||||||
|
|
||||||
|
if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
|
||||||
MAKE=gmake
|
MAKE=gmake
|
||||||
MD5SUM="md5 -q"
|
MD5SUM="md5 -q"
|
||||||
NPROC="sysctl -n hw.ncpuonline"
|
NPROC="sysctl -n hw.ncpuonline"
|
||||||
|
@ -35,7 +37,7 @@ if [ "$(uname -s)" = "OpenBSD" ]; then
|
||||||
export CXX=eg++
|
export CXX=eg++
|
||||||
export with_gmp=/usr/local
|
export with_gmp=/usr/local
|
||||||
export LDFLAGS=-Wl,-z,notext
|
export LDFLAGS=-Wl,-z,notext
|
||||||
elif [ "$(uname -s)" = "FreeBSD" ]; then
|
elif [ "$SYSTEM_NAME" = "FreeBSD" ]; then
|
||||||
MAKE=gmake
|
MAKE=gmake
|
||||||
MD5SUM="md5 -q"
|
MD5SUM="md5 -q"
|
||||||
NPROC="sysctl -n hw.ncpu"
|
NPROC="sysctl -n hw.ncpu"
|
||||||
|
@ -78,7 +80,7 @@ GCC_BASE_URL="http://ftp.gnu.org/gnu/gcc"
|
||||||
buildstep() {
|
buildstep() {
|
||||||
NAME=$1
|
NAME=$1
|
||||||
shift
|
shift
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
if [ "$SYSTEM_NAME" = "Darwin" ]; then
|
||||||
"$@" 2>&1 | sed 's|^|['"${NAME}"'] |'
|
"$@" 2>&1 | sed 's|^|['"${NAME}"'] |'
|
||||||
else
|
else
|
||||||
"$@" 2>&1 | sed 's|^|\x1b[34m['"${NAME}"']\x1b[39m |'
|
"$@" 2>&1 | sed 's|^|\x1b[34m['"${NAME}"']\x1b[39m |'
|
||||||
|
@ -188,7 +190,7 @@ pushd "$DIR/Tarballs"
|
||||||
$MD5SUM "$DIR/Patches/gcc.patch" > .patch.applied
|
$MD5SUM "$DIR/Patches/gcc.patch" > .patch.applied
|
||||||
popd
|
popd
|
||||||
|
|
||||||
if [ "$(uname)" = "Darwin" ]; then
|
if [ "$SYSTEM_NAME" = "Darwin" ]; then
|
||||||
pushd "gcc-${GCC_VERSION}"
|
pushd "gcc-${GCC_VERSION}"
|
||||||
./contrib/download_prerequisites
|
./contrib/download_prerequisites
|
||||||
popd
|
popd
|
||||||
|
@ -221,7 +223,7 @@ pushd "$DIR/Build/$ARCH"
|
||||||
--enable-shared \
|
--enable-shared \
|
||||||
--disable-nls \
|
--disable-nls \
|
||||||
${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1
|
${TRY_USE_LOCAL_TOOLCHAIN:+"--quiet"} || exit 1
|
||||||
if [ "$(uname)" = "Darwin" ]; then
|
if [ "$SYSTEM_NAME" = "Darwin" ]; then
|
||||||
# under macOS generated makefiles are not resolving the "intl"
|
# under macOS generated makefiles are not resolving the "intl"
|
||||||
# dependency properly to allow linking its own copy of
|
# dependency properly to allow linking its own copy of
|
||||||
# libintl when building with --enable-shared.
|
# libintl when building with --enable-shared.
|
||||||
|
@ -248,7 +250,7 @@ pushd "$DIR/Build/$ARCH"
|
||||||
unset SRC_ROOT
|
unset SRC_ROOT
|
||||||
popd
|
popd
|
||||||
|
|
||||||
if [ "$(uname -s)" = "OpenBSD" ]; then
|
if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
|
||||||
perl -pi -e 's/-no-pie/-nopie/g' "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/configure"
|
perl -pi -e 's/-no-pie/-nopie/g' "$DIR/Tarballs/gcc-$GCC_VERSION/gcc/configure"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -290,7 +292,7 @@ pushd "$DIR/Build/$ARCH"
|
||||||
if [ "$STAGE" = "Userland" ]; then
|
if [ "$STAGE" = "Userland" ]; then
|
||||||
echo "XXX build gcc and libgcc"
|
echo "XXX build gcc and libgcc"
|
||||||
buildstep "gcc/build" "$MAKE" -j "$MAKEJOBS" all-gcc || exit 1
|
buildstep "gcc/build" "$MAKE" -j "$MAKEJOBS" all-gcc || exit 1
|
||||||
if [ "$(uname -s)" = "OpenBSD" ]; then
|
if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
|
||||||
ln -sf liblto_plugin.so.0.0 gcc/liblto_plugin.so
|
ln -sf liblto_plugin.so.0.0 gcc/liblto_plugin.so
|
||||||
fi
|
fi
|
||||||
buildstep "libgcc/build" "$MAKE" -j "$MAKEJOBS" all-target-libgcc || exit 1
|
buildstep "libgcc/build" "$MAKE" -j "$MAKEJOBS" all-target-libgcc || exit 1
|
||||||
|
@ -309,7 +311,7 @@ pushd "$DIR/Build/$ARCH"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
if [ "$STAGE" = "Userland" ]; then
|
if [ "$STAGE" = "Userland" ]; then
|
||||||
if [ "$(uname -s)" = "OpenBSD" ]; then
|
if [ "$SYSTEM_NAME" = "OpenBSD" ]; then
|
||||||
cd "$DIR/Local/${ARCH}/libexec/gcc/$TARGET/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so
|
cd "$DIR/Local/${ARCH}/libexec/gcc/$TARGET/$GCC_VERSION" && ln -sf liblto_plugin.so.0.0 liblto_plugin.so
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -321,7 +323,7 @@ popd
|
||||||
|
|
||||||
pushd "$DIR"
|
pushd "$DIR"
|
||||||
# Stripping doesn't seem to work on macOS.
|
# Stripping doesn't seem to work on macOS.
|
||||||
if [ "$(uname)" != "Darwin" ]; then
|
if [ "$SYSTEM_NAME" != "Darwin" ]; then
|
||||||
# We *most definitely* don't need debug symbols in the linker/compiler.
|
# We *most definitely* don't need debug symbols in the linker/compiler.
|
||||||
# This cuts the uncompressed size from 1.2 GiB per Toolchain down to about 120 MiB.
|
# This cuts the uncompressed size from 1.2 GiB per Toolchain down to about 120 MiB.
|
||||||
# Hence, this might actually cause marginal speedups, although the point is to not waste space as blatantly.
|
# Hence, this might actually cause marginal speedups, although the point is to not waste space as blatantly.
|
||||||
|
|
Loading…
Reference in a new issue