tizen: build scripts: use cross compiler from env if provided
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 12 Nov 2020 14:17:53 +0000 (15:17 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 16 Nov 2021 10:04:04 +0000 (11:04 +0100)
If user set CROSS_COMPILE env in his shell, use it instead of the
hard-coded path ("/usr/bin/aarch64-linux-gnu-") from the scripts.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: Ibd005fd32349c7af091ff0c60def8ba63e4d2fc0

tizen/build-kvim3.sh
tizen/build-odroid-c4.sh
tizen/build-odroid-n2.sh

index d696250..dc7f938 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-CROSS_COMPILER=/usr/bin/aarch64-linux-gnu-
+CROSS_COMPILE=${CROSS_COMPILE:-/usr/bin/aarch64-linux-gnu-}
 JOBS="-j 5"
 
 # Check this system has ccache
@@ -24,14 +24,14 @@ build_uboot()
        if ! [ -e .config ] ; then
                make ARCH=arm64 khadas-vim3_defconfig
        fi
-       make CROSS_COMPILE="$CCACHE $CROSS_COMPILER" $JOBS
+       make CROSS_COMPILE="$CCACHE $CROSS_COMPILE" $JOBS
        ./tools/mkimage -A arm64 -T script -C none -n "Tizen KVIM3 u-boot helper" -d ./board/amlogic/w400/tizen-boot-khadas-vim3-64b.scr ./output/vim3/boot.scr.uimg
 
 }
 
 generate_param() {
        cp `find ./env  -name "built-in.o"` copy_env_common.o
-       ${CROSS_COMPILER}objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"`
+       ${CROSS_COMPILE}objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"`
        tr '\0' '\n' < copy_env_common.o > default_envs.txt
        ./tools/mkenvimage -s 16384 -o params.bin default_envs.txt
        rm copy_env_common.o default_envs.txt
index ab10bf9..2afaa6f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-CROSS_COMPILER=/usr/bin/aarch64-linux-gnu-
+CROSS_COMPILE=${CROSS_COMPILE:-/usr/bin/aarch64-linux-gnu-}
 JOBS="-j 5"
 
 # Check this system has ccache
@@ -24,14 +24,14 @@ build_uboot()
        if ! [ -e .config ] ; then
                make ARCH=arm64 odroid-c4_defconfig
        fi
-       make CROSS_COMPILE="$CCACHE $CROSS_COMPILER" $JOBS
+       make CROSS_COMPILE="$CCACHE $CROSS_COMPILE" $JOBS
        ./tools/mkimage -A arm64 -T script -C none -n "Tizen ODROID-C4 u-boot helper" -d ./board/amlogic/odroid-n2/tizen-boot-odroid-c4-64b.scr ./output/odroid-c4/boot.scr.uimg
 
 }
 
 generate_param() {
        cp `find ./env  -name "built-in.o"` copy_env_common.o
-       ${CROSS_COMPILER}objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"`
+       ${CROSS_COMPILE}objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"`
        tr '\0' '\n' < copy_env_common.o > default_envs.txt
        ./tools/mkenvimage -s 16384 -o params.bin default_envs.txt
        rm copy_env_common.o default_envs.txt
index bf971b6..fce4a59 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-CROSS_COMPILER=/usr/bin/aarch64-linux-gnu-
+CROSS_COMPILE=${CROSS_COMPILE:-/usr/bin/aarch64-linux-gnu-}
 JOBS="-j 5"
 
 # Check this system has ccache
@@ -24,14 +24,14 @@ build_uboot()
        if ! [ -e .config ] ; then
                make ARCH=arm64 odroid-n2_defconfig
        fi
-       make CROSS_COMPILE="$CCACHE $CROSS_COMPILER" $JOBS
+       make CROSS_COMPILE="$CCACHE $CROSS_COMPILE" $JOBS
        ./tools/mkimage -A arm64 -T script -C none -n "Tizen ODROID-N2 u-boot helper" -d ./board/amlogic/w400/tizen-boot-odroid-n2-64b.scr ./output/odroid-n2/boot.scr.uimg
 
 }
 
 generate_param() {
        cp `find ./env  -name "built-in.o"` copy_env_common.o
-       ${CROSS_COMPILER}objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"`
+       ${CROSS_COMPILE}objcopy -O binary --only-section=.rodata.default_environment `find . -name "copy_env_common.o"`
        tr '\0' '\n' < copy_env_common.o > default_envs.txt
        ./tools/mkenvimage -s 16384 -o params.bin default_envs.txt
        rm copy_env_common.o default_envs.txt