#!/usr/bin/env bash # Copyright (c) 2016-2020 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 set -eu -o pipefail 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 ./zcutil/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 ./zcutil/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 ./zcutil/dragon.txt cat <