2021-04-02 21:53:41 -06:00
|
|
|
#!/usr/bin/env bash
|
2021-09-24 22:15:38 +02:00
|
|
|
|
2022-12-28 00:39:55 +01:00
|
|
|
SCRIPT="$(realpath $(dirname "${BASH_SOURCE[0]}"))"
|
2022-04-21 18:58:02 +02:00
|
|
|
|
2022-10-02 20:55:22 +03:00
|
|
|
export SERENITY_ARCH="${SERENITY_ARCH:-x86_64}"
|
2022-04-30 02:40:47 +02:00
|
|
|
export SERENITY_TOOLCHAIN="${SERENITY_TOOLCHAIN:-GNU}"
|
2022-04-21 18:58:02 +02:00
|
|
|
|
|
|
|
if [ -z "${HOST_CC:=}" ]; then
|
|
|
|
export HOST_CC="${CC:=cc}"
|
|
|
|
export HOST_CXX="${CXX:=c++}"
|
2022-12-31 19:40:19 +01:00
|
|
|
export HOST_LD="${LD:=ld}"
|
2022-04-21 18:58:02 +02:00
|
|
|
export HOST_AR="${AR:=ar}"
|
|
|
|
export HOST_RANLIB="${RANLIB:=ranlib}"
|
|
|
|
export HOST_PATH="${PATH:=}"
|
|
|
|
export HOST_READELF="${READELF:=readelf}"
|
|
|
|
export HOST_OBJCOPY="${OBJCOPY:=objcopy}"
|
2023-07-28 13:25:13 -04:00
|
|
|
export HOST_OBJDUMP="${OBJDUMP:=objdump}"
|
2022-05-07 18:29:03 +02:00
|
|
|
export HOST_STRIP="${STRIP:=strip}"
|
2022-06-11 16:32:24 -06:00
|
|
|
export HOST_CXXFILT="${CXXFILT:=c++filt}"
|
2022-04-21 18:58:02 +02:00
|
|
|
export HOST_PKG_CONFIG_DIR="${PKG_CONFIG_DIR:=}"
|
|
|
|
export HOST_PKG_CONFIG_SYSROOT_DIR="${PKG_CONFIG_SYSROOT_DIR:=}"
|
|
|
|
export HOST_PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:=}"
|
|
|
|
fi
|
|
|
|
|
2021-04-19 20:43:54 +00:00
|
|
|
export SERENITY_SOURCE_DIR="$(realpath "${SCRIPT}/../")"
|
2021-09-24 22:15:38 +02:00
|
|
|
|
|
|
|
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
|
|
|
|
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}clang"
|
2022-06-11 16:32:24 -06:00
|
|
|
export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/clang/bin"
|
2022-06-11 16:29:05 -06:00
|
|
|
export CC="${SERENITY_ARCH}-pc-serenity-clang"
|
|
|
|
export CXX="${SERENITY_ARCH}-pc-serenity-clang++"
|
2022-12-31 19:40:19 +01:00
|
|
|
export LD="${SERENITY_TOOLCHAIN_BINDIR}/ld.lld"
|
2021-09-24 22:15:38 +02:00
|
|
|
export AR="llvm-ar"
|
|
|
|
export RANLIB="llvm-ranlib"
|
2022-01-08 05:50:11 -07:00
|
|
|
export READELF="llvm-readelf"
|
2022-02-20 22:58:26 +01:00
|
|
|
export OBJCOPY="llvm-objcopy"
|
2023-07-28 13:25:13 -04:00
|
|
|
export OBJDUMP="llvm-objdump"
|
2022-05-07 18:29:03 +02:00
|
|
|
export STRIP="llvm-strip"
|
2022-06-11 16:32:24 -06:00
|
|
|
export CXXFILT="llvm-cxxfilt"
|
2021-09-24 22:15:38 +02:00
|
|
|
else
|
|
|
|
export SERENITY_BUILD_DIR="${SERENITY_SOURCE_DIR}/Build/${SERENITY_ARCH}"
|
2022-06-11 16:32:24 -06:00
|
|
|
export SERENITY_TOOLCHAIN_BINDIR="${SERENITY_SOURCE_DIR}/Toolchain/Local/${SERENITY_ARCH}/bin"
|
2021-09-24 22:15:38 +02:00
|
|
|
export CC="${SERENITY_ARCH}-pc-serenity-gcc"
|
|
|
|
export CXX="${SERENITY_ARCH}-pc-serenity-g++"
|
2022-12-31 19:40:19 +01:00
|
|
|
export LD="${SERENITY_TOOLCHAIN_BINDIR}/${SERENITY_ARCH}-pc-serenity-ld"
|
2021-09-24 22:15:38 +02:00
|
|
|
export AR="${SERENITY_ARCH}-pc-serenity-ar"
|
|
|
|
export RANLIB="${SERENITY_ARCH}-pc-serenity-ranlib"
|
2022-01-08 05:50:11 -07:00
|
|
|
export READELF="${SERENITY_ARCH}-pc-serenity-readelf"
|
2022-02-20 22:58:26 +01:00
|
|
|
export OBJCOPY="${SERENITY_ARCH}-pc-serenity-objcopy"
|
2023-07-28 13:25:13 -04:00
|
|
|
export OBJDUMP="${SERENITY_ARCH}-pc-serenity-objdump"
|
2022-05-07 18:29:03 +02:00
|
|
|
export STRIP="${SERENITY_ARCH}-pc-serenity-strip"
|
2022-06-11 16:32:24 -06:00
|
|
|
export CXXFILT="${SERENITY_ARCH}-pc-serenity-c++filt"
|
2021-09-24 22:15:38 +02:00
|
|
|
fi
|
|
|
|
|
2022-12-10 13:35:33 -07:00
|
|
|
export PATH="${SERENITY_TOOLCHAIN_BINDIR}:${SERENITY_SOURCE_DIR}/Toolchain/Local/cmake/bin:${HOST_PATH}"
|
2022-06-11 16:32:24 -06:00
|
|
|
|
2021-04-11 16:20:53 +02:00
|
|
|
export PKG_CONFIG_DIR=""
|
|
|
|
export PKG_CONFIG_SYSROOT_DIR="${SERENITY_BUILD_DIR}/Root"
|
2022-05-21 03:37:58 +02:00
|
|
|
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/usr/local/lib/pkgconfig"
|
2021-04-19 20:43:54 +00:00
|
|
|
|
2022-04-21 18:58:02 +02:00
|
|
|
export SERENITY_INSTALL_ROOT="${SERENITY_BUILD_DIR}/Root"
|
2023-01-05 18:51:32 +01:00
|
|
|
export SERENITY_PORT_DIRS="${SERENITY_PORT_DIRS:+${SERENITY_PORT_DIRS}:}${SERENITY_SOURCE_DIR}/Ports"
|