mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 13:11:31 +00:00
hack: rename scripts to hack
This commit is contained in:
22
hack/build/arch.sh
Executable file
22
hack/build/arch.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
TOOLS_DIR="$(dirname "${0}")"
|
||||
|
||||
RUST_TARGET="$("${TOOLS_DIR}/target.sh")"
|
||||
TARGET_ARCH="$(echo "${RUST_TARGET}" | awk -F '-' '{print $1}')"
|
||||
|
||||
if [ "${KRATA_ARCH_ALT_NAME}" = "1" ] || [ "${KRATA_ARCH_KERNEL_NAME}" = "1" ]
|
||||
then
|
||||
if [ "${TARGET_ARCH}" = "x86_64" ] && [ "${KRATA_ARCH_KERNEL_NAME}" != "1" ]
|
||||
then
|
||||
TARGET_ARCH="amd64"
|
||||
fi
|
||||
|
||||
if [ "${TARGET_ARCH}" = "aarch64" ]
|
||||
then
|
||||
TARGET_ARCH="arm64"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${TARGET_ARCH}"
|
8
hack/build/cargo.sh
Executable file
8
hack/build/cargo.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
TOOLS_DIR="$(dirname "${0}")"
|
||||
RUST_TARGET="$("${TOOLS_DIR}/target.sh")"
|
||||
|
||||
export CARGO_BUILD_TARGET="${RUST_TARGET}"
|
||||
exec cargo "${@}"
|
29
hack/build/target.sh
Executable file
29
hack/build/target.sh
Executable file
@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -z "${RUST_LIBC}" ]
|
||||
then
|
||||
RUST_LIBC="gnu"
|
||||
fi
|
||||
|
||||
if [ -z "${RUST_TARGET}" ]
|
||||
then
|
||||
HOST_ARCH="$(uname -m)"
|
||||
if [ "${HOST_ARCH}" = "x86_64" ]
|
||||
then
|
||||
RUST_TARGET="x86_64-unknown-linux-${RUST_LIBC}"
|
||||
fi
|
||||
|
||||
if [ "${HOST_ARCH}" = "aarch64" ]
|
||||
then
|
||||
RUST_TARGET="aarch64-unknown-linux-${RUST_LIBC}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "${RUST_TARGET}" ]
|
||||
then
|
||||
echo "ERROR: Unable to determine RUST_TARGET, your architecture may not be supported by krata." > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "${RUST_TARGET}"
|
Reference in New Issue
Block a user