From 12f746b391432b2c95a2f9e7f7c6e98a4ed2bec0 Mon Sep 17 00:00:00 2001 From: jahway603 Date: Thu, 27 Apr 2023 21:06:10 -0400 Subject: [PATCH] build script to xcompile ARM64 (aarch64) --- util/README.md | 5 ++ util/build-arm-xcompile.sh | 139 +++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100755 util/build-arm-xcompile.sh diff --git a/util/README.md b/util/README.md index 0c7408f4d..d11b0e02f 100644 --- a/util/README.md +++ b/util/README.md @@ -12,6 +12,11 @@ Compile Hush full node code. ## build-arm.sh Compile Hush full node code for ARM architecture. +**has not worked for some time** + +## build-arm-xcompile.sh + +Cross-Compile Hush full node code for ARM architecture on an x86 build server. ## build-debian-package.sh diff --git a/util/build-arm-xcompile.sh b/util/build-arm-xcompile.sh new file mode 100755 index 000000000..6be684464 --- /dev/null +++ b/util/build-arm-xcompile.sh @@ -0,0 +1,139 @@ +#!/usr/bin/env bash +# Copyright (c) 2016-2023 The Hush developers +# Distributed under the GPLv3 software license, see the accompanying +# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html + +# For use with https://git.hush.is/jahway603/hush-docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md, +# Please follow that +set -eu -o pipefail + +# Check if cmake, a new dependency for randomx support, is installed on system and exits if it is not +if ! [ -x "$(command -v cmake)" ]; then + echo 'Error: cmake is not installed. Install cmake and try again.' >&2 + exit 1 +fi + +function cmd_pref() { + if type -p "$2" > /dev/null; then + eval "$1=$2" + else + eval "$1=$3" + fi +} +cat <<'EOF' + .~~~~~~~~~~~~~~~~. +{{ Building Hush!! }} + `~~~~~~~~~~~~~~~~` + \ ^__^ + \ (@@)\_______ + (__)\ HUSH )\/\ $ + z zz ||----w | z | +zz zz z || z ||xxx z z|z zz +zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz +EOF + +# If a g-prefixed version of the command exists, use it preferentially. +function gprefix() { + cmd_pref "$1" "g$2" "$2" +} + +gprefix READLINK readlink +cd "$(dirname "$("$READLINK" -f "$0")")/.." + +# Allow user overrides to $MAKE. Typical usage for users who need it: +# MAKE=gmake ./util/build.sh -j$(nproc) +if [[ -z "${MAKE-}" ]]; then + MAKE=make +fi + +# Allow overrides to $BUILD and $HOST for porters. Most users will not need it. +# BUILD=i686-pc-linux-gnu ./util/build.sh +if [[ -z "${BUILD-}" ]]; then + BUILD="$(./depends/config.guess)" +fi +if [[ -z "${HOST-}" ]]; then + HOST="$BUILD" +fi + +# Allow users to set arbitrary compile flags. Most users will not need this. +if [[ -z "${CONFIGURE_FLAGS-}" ]]; then + CONFIGURE_FLAGS="" +fi + +if [ "x$*" = 'x--help' ] +then + cat ./util/dragon.txt + cat <