mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
Port: Support running some configure/build commands with the host toolchain
This is useful for ports which depend on running tools on the host system. In this case we can build the port twice - once for the host and once for the target system.
This commit is contained in:
parent
9e9b508390
commit
28b3c8bc1d
1 changed files with 28 additions and 11 deletions
|
@ -3,23 +3,40 @@ set -eu
|
||||||
|
|
||||||
SCRIPT="$(dirname "${0}")"
|
SCRIPT="$(dirname "${0}")"
|
||||||
export SERENITY_ARCH="${SERENITY_ARCH:-i686}"
|
export SERENITY_ARCH="${SERENITY_ARCH:-i686}"
|
||||||
export SERENITY_BUILD_DIR="${SERENITY_ROOT}/Build/${SERENITY_ARCH}"
|
|
||||||
export CC="${SERENITY_ARCH}-pc-serenity-gcc"
|
HOST_CC="${CC:=cc}"
|
||||||
export CXX="${SERENITY_ARCH}-pc-serenity-g++"
|
HOST_CXX="${CXX:=c++}"
|
||||||
export AR="${SERENITY_ARCH}-pc-serenity-ar"
|
HOST_AR="${AR:=ar}"
|
||||||
export RANLIB="${SERENITY_ARCH}-pc-serenity-ranlib"
|
HOST_RANLIB="${RANLIB:=ranlib}"
|
||||||
export PATH="${SERENITY_ROOT}/Toolchain/Local/${SERENITY_ARCH}/bin:${PATH}"
|
HOST_PATH="${PATH:=}"
|
||||||
export PKG_CONFIG_DIR=""
|
HOST_PKG_CONFIG_DIR="${PKG_CONFIG_DIR:=}"
|
||||||
export PKG_CONFIG_SYSROOT_DIR="${SERENITY_BUILD_DIR}/Root"
|
HOST_PKG_CONFIG_SYSROOT_DIR="${PKG_CONFIG_SYSROOT_DIR:=}"
|
||||||
export PKG_CONFIG_LIBDIR="${PKG_CONFIG_SYSROOT_DIR}/usr/lib/pkgconfig/:${PKG_CONFIG_SYSROOT_DIR}/usr/local/lib/pkgconfig/"
|
HOST_PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:=}"
|
||||||
|
|
||||||
|
DESTDIR="/"
|
||||||
|
|
||||||
maybe_source() {
|
maybe_source() {
|
||||||
if [ -f "$1" ]; then
|
if [ -f "$1" ]; then
|
||||||
. "$1"
|
. "$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
DESTDIR="/"
|
|
||||||
maybe_source "${SCRIPT}/.hosted_defs.sh"
|
target_env() {
|
||||||
|
maybe_source "${SCRIPT}/.hosted_defs.sh"
|
||||||
|
}
|
||||||
|
|
||||||
|
target_env
|
||||||
|
|
||||||
|
host_env() {
|
||||||
|
export CC="${HOST_CC}"
|
||||||
|
export CXX="${HOST_CXX}"
|
||||||
|
export AR="${HOST_AR}"
|
||||||
|
export RANLIB="${HOST_RANLIB}"
|
||||||
|
export PATH="${HOST_PATH}"
|
||||||
|
export PKG_CONFIG_DIR="${HOST_PKG_CONFIG_DIR}"
|
||||||
|
export PKG_CONFIG_SYSROOT_DIR="${HOST_PKG_CONFIG_SYSROOT_DIR}"
|
||||||
|
export PKG_CONFIG_LIBDIR="${HOST_PKG_CONFIG_LIBDIR}"
|
||||||
|
}
|
||||||
|
|
||||||
packagesdb="${DESTDIR}/usr/Ports/packages.db"
|
packagesdb="${DESTDIR}/usr/Ports/packages.db"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue