From b8e72ced23a3ec7c7e3676b8ba95852a3afa6098 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 11 Nov 2016 01:10:53 -0500 Subject: [PATCH] Add porter dev overrides for CC, CXX, MAKE, BUILD, HOST --- zcutil/build.sh | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) 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 <