diff options
author | Rob Landley <rob@landley.net> | 2019-03-21 15:53:18 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-03-21 15:53:18 -0500 |
commit | 99cd706b1ad7bdc41658139f04ff30bd87ea7f3e (patch) | |
tree | 911871d854f1e3169c38570e6efaded7761a777c | |
parent | 14eee98d9dbe81729437bf333ea413b43e37969a (diff) | |
download | toybox-99cd706b1ad7bdc41658139f04ff30bd87ea7f3e.tar.gz |
Test for compiler existence when sourcing portability.sh.
-rwxr-xr-x | scripts/genconfig.sh | 1 | ||||
-rwxr-xr-x | scripts/make.sh | 4 | ||||
-rw-r--r-- | scripts/portability.sh | 8 |
3 files changed, 8 insertions, 5 deletions
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 |