diff --git a/zcutil/build.sh b/zcutil/build.sh index c10be652f..c4823ed61 100755 --- a/zcutil/build.sh +++ b/zcutil/build.sh @@ -1,7 +1,30 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu -o pipefail +# 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=x86_64-unknown-linux-gnu +fi +if [[ -z "${HOST-}" ]]; then + HOST=x86_64-unknown-linux-gnu +fi + +# Allow override to $CC and $CXX for porters. Most users will not need it. +if [[ -z "${CC-}" ]]; then + CC=gcc +fi +if [[ -z "${CXX-}" ]]; then + CXX=g++ +fi + if [ "x$*" = 'x--help' ] then cat <