diff options
author | Michael Forney <mforney@mforney.org> | 2019-05-08 21:15:27 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-05-08 21:15:27 -0700 |
commit | edaab94419b857c441ed8025d0a28103e99e7d55 (patch) | |
tree | c995f6ad663b22d97f5425d730131a33402697f6 /configure | |
parent | b00a5fd0a0b897ffd5a01906676b5d0814dd85de (diff) |
configure: Add tool prefix when building a cross-compiler
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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 ;; |