tizen: build scripts: use cross compiler from env if provided 05/247605/5
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 12 Nov 2020 14:17:53 +0000 (15:17 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 16 Nov 2020 07:20:32 +0000 (08:20 +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 d6962508b475c2d71a28e7cd69e3d55c04aaf348..dc7f938cc39582ac3760cbd090873ba840e275bb 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 ab10bf9cbbc141e702eb298a920ff52baff17d5e..2afaa6fcc894d5fd9208792b9139d36c8f8680d9 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 bf971b6ee0afcb26df4788e11f9adc80e211ea2a..fce4a5978f33f1bb8b69a5112f52d02cf220ac9b 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