mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Ports: Make .hosted_defs.sh usable outside of .port_include.sh
This commit moves some stuff around in order to isolate .hosted_defs.sh from .port_include.sh
This commit is contained in:
parent
452334ab6e
commit
2130a83640
Notes:
sideshowbarker
2024-07-17 11:31:12 +09:00
Author: https://github.com/circl-lastname Commit: https://github.com/SerenityOS/serenity/commit/2130a83640 Pull-request: https://github.com/SerenityOS/serenity/pull/13768 Reviewed-by: https://github.com/EWouters Reviewed-by: https://github.com/gmta ✅
@ -1,5 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT="$(dirname "${0}")"
|
||||
|
||||
export SERENITY_ARCH="${SERENITY_ARCH:-i686}"
|
||||
export SERENITY_TOOLCHAIN="${SERENITY_TOOLCHAIN:-GCC}"
|
||||
|
||||
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_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
|
||||
@ -26,7 +44,4 @@ 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"
|
||||
export SERENITY_INSTALL_ROOT="${SERENITY_BUILD_DIR}/Root"
|
||||
|
@ -2,23 +2,6 @@
|
||||
set -eu
|
||||
|
||||
SCRIPT="$(dirname "${0}")"
|
||||
export SERENITY_ARCH="${SERENITY_ARCH:-i686}"
|
||||
export SERENITY_TOOLCHAIN="${SERENITY_TOOLCHAIN:-GCC}"
|
||||
|
||||
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_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
|
||||
|
||||
DESTDIR="/"
|
||||
|
||||
maybe_source() {
|
||||
if [ -f "$1" ]; then
|
||||
@ -26,6 +9,14 @@ maybe_source() {
|
||||
fi
|
||||
}
|
||||
|
||||
target_env() {
|
||||
maybe_source "${SCRIPT}/.hosted_defs.sh"
|
||||
}
|
||||
|
||||
target_env
|
||||
|
||||
DESTDIR="${SERENITY_INSTALL_ROOT}"
|
||||
|
||||
enable_ccache() {
|
||||
if command -v ccache &>/dev/null; then
|
||||
ccache_tooldir="${SERENITY_BUILD_DIR}/ccache"
|
||||
@ -37,11 +28,7 @@ enable_ccache() {
|
||||
fi
|
||||
}
|
||||
|
||||
target_env() {
|
||||
maybe_source "${SCRIPT}/.hosted_defs.sh"
|
||||
}
|
||||
|
||||
target_env
|
||||
enable_ccache
|
||||
|
||||
host_env() {
|
||||
export CC="${HOST_CC}"
|
||||
|
Loading…
Reference in New Issue
Block a user