Ports: Use $arch-serenity-pc-clang{++} for CC and CXX

This lets us eliminate the extra arguments on CC and CXX for ports that
care about CC and CXX pointing to actual filenames they can invoke
realpath or basename on.
This commit is contained in:
Andrew Kaster 2022-06-11 16:29:05 -06:00 committed by Andreas Kling
parent 8c877664f7
commit ad0a001f0a
Notes: sideshowbarker 2024-07-17 10:05:10 +09:00
2 changed files with 11 additions and 11 deletions

View file

@ -25,14 +25,20 @@ export SERENITY_SOURCE_DIR="$(realpath "${SCRIPT}/../")"
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}clang"
export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/clang/bin"
export CC="clang --target=${SERENITY_ARCH}-pc-serenity --sysroot=${SERENITY_BUILD_DIR}/Root"
export CXX="clang++ --target=${SERENITY_ARCH}-pc-serenity --sysroot=${SERENITY_BUILD_DIR}/Root"
export CC="${SERENITY_ARCH}-pc-serenity-clang"
export CXX="${SERENITY_ARCH}-pc-serenity-clang++"
export AR="llvm-ar"
export RANLIB="llvm-ranlib"
export READELF="llvm-readelf"
export OBJCOPY="llvm-objcopy"
export STRIP="llvm-strip"
export CXXFILT="llvm-cxxfilt"
# FIXME: Remove after next toolchain update (symlinks already in BuildClang.sh)
if [ ! -f "${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-clang" ]; then
ln -s clang "${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-clang"
ln -s clang++ "${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-clang++"
echo "--sysroot=${SERENITY_BUILD_DIR}/Root" > "${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity.cfg"
fi
else
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}"
export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin"

View file

@ -28,15 +28,9 @@ enable_ccache() {
if [ "${USE_CCACHE:-true}" = "true" ] && command -v ccache &>/dev/null; then
ccache_tooldir="${SERENITY_BUILD_DIR}/ccache"
mkdir -p "$ccache_tooldir"
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
for tool in clang clang++; do
ln -sf "$(command -v ccache)" "${ccache_tooldir}/$tool"
done
else
for tool in gcc g++ c++; do
ln -sf "$(command -v ccache)" "${ccache_tooldir}/${SERENITY_ARCH}-pc-serenity-${tool}"
done
fi
for tool in cc clang gcc c++ clang++ g++; do
ln -sf "$(command -v ccache)" "${ccache_tooldir}/${SERENITY_ARCH}-pc-serenity-${tool}"
done
export PATH="${ccache_tooldir}:$PATH"
fi
}