From 99cd706b1ad7bdc41658139f04ff30bd87ea7f3e Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 21 Mar 2019 15:53:18 -0500 Subject: Test for compiler existence when sourcing portability.sh. --- scripts/genconfig.sh | 1 - scripts/make.sh | 4 ---- scripts/portability.sh | 8 ++++++++ 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh index c4940dfd..21e6c7b7 100755 --- a/scripts/genconfig.sh +++ b/scripts/genconfig.sh @@ -5,7 +5,6 @@ mkdir -p generated -source configure source scripts/portability.sh probecc() diff --git a/scripts/make.sh b/scripts/make.sh index 58456f6f..2fc94b4c 100755 --- a/scripts/make.sh +++ b/scripts/make.sh @@ -5,12 +5,8 @@ export LANG=c export LC_ALL=C set -o pipefail -source ./configure source scripts/portability.sh -[ ! -z "$CROSS_COMPILE" ] && [ ! -e "$CROSS_COMPILE"cc ] && - echo "missing ${CROSS_COMPILE}cc" && exit 1 - [ -z "$KCONFIG_CONFIG" ] && KCONFIG_CONFIG=.config [ -z "$OUTNAME" ] && OUTNAME=toybox UNSTRIPPED="generated/unstripped/$(basename "$OUTNAME")" diff --git a/scripts/portability.sh b/scripts/portability.sh index fddd84ec..abeb31f2 100644 --- a/scripts/portability.sh +++ b/scripts/portability.sh @@ -1,5 +1,13 @@ # sourced to find alternate names for things +source configure + +if [ -z "$(command -v "${CROSS_COMPILE}${CC}")" ] +then + echo "No ${CROSS_COMPILE}${CC} found" >&2 + exit 1 +fi + if [ -z "$SED" ] then [ ! -z "$(which gsed 2>/dev/null)" ] && SED=gsed || SED=sed -- cgit v1.2.3