cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit edaab94419b857c441ed8025d0a28103e99e7d55
parent b00a5fd0a0b897ffd5a01906676b5d0814dd85de
Author: Michael Forney <mforney@mforney.org>
Date:   Wed,  8 May 2019 21:15:27 -0700

configure: Add tool prefix when building a cross-compiler

Diffstat:
Mconfigure | 14++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/configure b/configure @@ -27,10 +27,6 @@ for arg ; do done : ${CC:=cc} -: ${DEFAULT_PREPROCESSOR:=cpp} -: ${DEFAULT_QBE:=qbe} -: ${DEFAULT_ASSEMBLER:=as} -: ${DEFAULT_LINKER:=ld} printf 'checking host system type... ' test -n "$host" || host=$($CC -dumpmachine 2>/dev/null) || fail "could not determine host" @@ -40,6 +36,16 @@ printf 'checking target system type...' test -n "$target" || target=$host printf '%s\n' "$target" +toolprefix= +if [ "$host" != "$target" ] ; then + toolprefix=$target- +fi + +: ${DEFAULT_PREPROCESSOR:=${toolprefix}cpp} +: ${DEFAULT_QBE:=qbe} +: ${DEFAULT_ASSEMBLER:=${toolprefix}as} +: ${DEFAULT_LINKER:=${toolprefix}ld} + case "$target" in x86_64*|amd64*) qbetarget=amd64_sysv ;; aarch64*) qbetarget=arm64 ;;