-
Notifications
You must be signed in to change notification settings - Fork 27
/
envsetup.sh
executable file
·33 lines (29 loc) · 1.23 KB
/
envsetup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /bin/bash
#
# Before build your RK3399 SDK, you must execute "source envsetup.sh" at
# SDK root to setup the build environment first.
#
# Adding your own useful commands and enviornment variables here is very welcome.
#
# If you have any question about build system of RK3399, please send a email to
# lby@rock-chips.com for help.
#
# Setup toolchain
toolschain_path=$(pwd)/buildroot/output/host/
version=$(aarch64-linux-gcc --version 2>/dev/null)
result=$(echo $version | grep -Eo '*Buildroot 2016.08.1*')
if [ ! "$version" = "" ] && [ "$result" = "" ] ;then
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$toolschain_path/usr/bin:$PATH"
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$toolschain_path/usr/aarch64-rockchip-linux-gnu/bin:$PATH"
echo "Another gcc found, will be replaced by 3399-linux SDK toolchain"
elif [ "$version" = "" ] ;then
export PATH="$PATH:$toolschain_path/usr/bin"
export PATH="$PATH:$toolschain_path/usr/aarch64-rockchip-linux-gnu/bin"
version=$(aarch64-linux-gcc --version)
echo "Set toolchain path to: <SdkRoot>/buildroot/output/host/usr"
# echo $version
fi
# Export 3399 sdk root directory
export RK3399_SDK_ROOT="$(pwd)"
# Set croot alias
alias croot="cd $(pwd)"