blob: 13cc410062f1e4c02536ab41b4475ff2bff543ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/usr/bin/env bash
SCRIPT="$(dirname "${0}")"
export SERENITY_ARCH="${SERENITY_ARCH:-i686}"
export SERENITY_TOOLCHAIN="${SERENITY_TOOLCHAIN:-GNU}"
if [ -z "${HOST_CC:=}" ]; then
export HOST_CC="${CC:=cc}"
export HOST_CXX="${CXX:=c++}"
export HOST_AR="${AR:=ar}"
export HOST_RANLIB="${RANLIB:=ranlib}"
export HOST_PATH="${PATH:=}"
export HOST_READELF="${READELF:=readelf}"
export HOST_OBJCOPY="${OBJCOPY:=objcopy}"
export HOST_STRIP="${STRIP:=strip}"
export HOST_CXXFILT="${CXXFILT:=c++filt}"
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
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="${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"
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 STRIP="${SERENITY_ARCH}-pc-serenity-strip"
export CXXFILT="${SERENITY_ARCH}-pc-serenity-c++filt"
fi
export PATH="${SERENITY_TOOLCHAIN_BINDIR}:${HOST_PATH}"
export PKG_CONFIG_DIR=""
export PKG_CONFIG_SYSROOT_DIR="${SERENITY_BUILD_DIR}/Root"
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/usr/local/lib/pkgconfig"
export SERENITY_INSTALL_ROOT="${SERENITY_BUILD_DIR}/Root"
|