diff options
author | Leif Lindholm <leif.lindholm@linaro.org> | 2017-06-15 17:32:13 +0100 |
---|---|---|
committer | Leif Lindholm <leif.lindholm@linaro.org> | 2017-06-15 17:46:04 +0100 |
commit | 65e8e8df04f34fc2a87ae9d34f5ef5b6fee5a396 (patch) | |
tree | 7727f90b0ef511bdfff272c79f8b4b29865304c3 /common-functions | |
parent | e19a314ebc33fe476aa72477dc4ffe644bcdb8a5 (diff) |
common-functions: update set_cross_compile to support x86/ix86
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'common-functions')
-rw-r--r-- | common-functions | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/common-functions b/common-functions index 821cbdb..0f882f5 100644 --- a/common-functions +++ b/common-functions @@ -34,6 +34,10 @@ function get_build_arch BUILD_ARCH=ARM;; aarch64*) BUILD_ARCH=AARCH64;; + i?86*) + BUILD_ARCH=IA32;; + x86_64*) + BUILD_ARCH=X64;; *) BUILD_ARCH=other;; esac @@ -47,20 +51,27 @@ function set_cross_compile echo "Build: $BUILD_ARCH" if [ "$PLATFORM_ARCH" = "$BUILD_ARCH" ]; then TEMP_CROSS_COMPILE= - elif [ "$PLATFORM_ARCH" == "AARCH64" ]; then - if [ X"$CROSS_COMPILE_64" != X"" ]; then - TEMP_CROSS_COMPILE="$CROSS_COMPILE_64" - else - TEMP_CROSS_COMPILE=aarch64-linux-gnu- - fi - elif [ "$PLATFORM_ARCH" == "ARM" ]; then - if [ X"$CROSS_COMPILE_32" != X"" ]; then - TEMP_CROSS_COMPILE="$CROSS_COMPILE_32" - else - TEMP_CROSS_COMPILE=arm-linux-gnueabihf- - fi else - echo "Unsupported target architecture '$PLATFORM_ARCH'!" >&2 + case "$PLATFORM_ARCH" in + AARCH64) + TEMP_CROSS_COMPILE=aarch64-linux-gnu- ;; + ARM) + TEMP_CROSS_COMPILE=arm-linux-gnueabihf- ;; + IA32) + TEMP_CROSS_COMPILE=x86_64-linux-gnu- + for family in 6 5 4 3; do + if i$family86-linux-gnu-as -version >/dev/null 2>&1;then + TEMP_CROSS_COMPILE=i$family86-linux-gnu- + break + fi + done + ;; + X64) + TEMP_CROSS_COMPILE=x86_64-linux-gnu- ;; + *) + echo "Unsupported target architecture '$PLATFORM_ARCH'!" >&2 + ;; + esac fi } |