1# Licensed to the Apache Software Foundation (ASF) under one
2# or more contributor license agreements.  See the NOTICE file
3# distributed with this work for additional information
4# regarding copyright ownership.  The ASF licenses this file
5# to you under the Apache License, Version 2.0 (the
6# "License"); you may not use this file except in compliance
7# with the License.  You may obtain a copy of the License at
8#
9#   http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing,
12# software distributed under the License is distributed on an
13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14# KIND, either express or implied.  See the License for the
15# specific language governing permissions and limitations
16# under the License.
17
18export RUST_TARGET_PATH="$(pwd)"
19export RUST_COMPILER_RT_ROOT=$RUST_TARGET_PATH/rust/rust/src/llvm-project/compiler-rt
20if [ -z "$OPTEE_DIR" ]
21then
22  export OPTEE_DIR="$(pwd)/optee"
23fi
24export OPTEE_OS_DIR="$OPTEE_DIR/optee_os"
25export OPTEE_CLIENT_DIR="$OPTEE_DIR/optee_client/out"
26export OPTEE_CLIENT_INCLUDE="$OPTEE_DIR/optee_client/out/export/usr/include"
27if [ "$ARCH" = "arm" ]
28then
29  export ARCH="arm"
30  export PATH=$PATH:$OPTEE_DIR/toolchains/aarch32/bin
31  export VENDOR="qemu.mk"
32  export OPTEE_OS_INCLUDE="$OPTEE_DIR/optee_os/out/arm/export-ta_arm32/include"
33  export CC=$OPTEE_DIR/toolchains/aarch32/bin/arm-linux-gnueabihf-gcc
34else
35  # export ARCH="aarch64" # comment this because currently optee_os cannot be compiled in the aarch64 target
36  unset ARCH
37  export PATH=$PATH:$OPTEE_DIR/toolchains/aarch64/bin
38  export VENDOR="qemu_v8.mk"
39  export OPTEE_OS_INCLUDE="$OPTEE_DIR/optee_os/out/arm/export-ta_arm64/include"
40  export CC=$OPTEE_DIR/toolchains/aarch64/bin/aarch64-linux-gnu-gcc
41fi
42