ladybird/Ports/.hosted_defs.sh
Daniel Bertalan 0be67ef12c Ports: Use the objcopy built as part of the toolchain
Relying on host tools working correctly is not a good idea, as they may
be outdated (and therefore not support features like RELR relocations)
or may not exist at all (like objcopy on macOS).
2022-02-20 23:07:31 +00:00

33 lines
1.4 KiB
Bash

#!/usr/bin/env bash
export SERENITY_SOURCE_DIR="$(realpath "${SCRIPT}/../")"
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}clang"
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 AR="llvm-ar"
export RANLIB="llvm-ranlib"
export READELF="llvm-readelf"
export OBJCOPY="llvm-objcopy"
export PATH="${SERENITY_SOURCE_DIR}/Toolchain/Local/clang/bin:${HOST_PATH}"
else
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}"
export CC="${SERENITY_ARCH}-pc-serenity-gcc"
export CXX="${SERENITY_ARCH}-pc-serenity-g++"
export AR="${SERENITY_ARCH}-pc-serenity-ar"
export RANLIB="${SERENITY_ARCH}-pc-serenity-ranlib"
export READELF="${SERENITY_ARCH}-pc-serenity-readelf"
export OBJCOPY="${SERENITY_ARCH}-pc-serenity-objcopy"
export PATH="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin:${HOST_PATH}"
fi
export PKG_CONFIG_DIR=""
export PKG_CONFIG_SYSROOT_DIR="${SERENITY_BUILD_DIR}/Root"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/usr/lib/pkgconfig/:${PKG_CONFIG_SYSROOT_DIR}/usr/local/lib/pkgconfig"
enable_ccache
DESTDIR="${SERENITY_BUILD_DIR}/Root"
export SERENITY_INSTALL_ROOT="$DESTDIR"