加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
setup.sh 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
小骨头 提交于 2022-05-10 02:39 . feat: add assert and ctype
#!/bin/bash
##
# Copyright (c) 2018-2022, NXOS Development Team
# SPDX-License-Identifier: Apache-2.0
#
# Contains: shell scripts for xbook lib for C lang environment
#
# Change Logs:
# Date Author Notes
# 2022-05-09 JasonHu Init
##
# usage:
# source setup.sh [arch]
# example: source setup.sh # x86
# example: source setup.sh riscv64 # riscv64
# supported targe list
supported_arch="x86 riscv64"
def_arch="unknown"
# find arch in arch list
if [ -z $1 ]
then
def_arch="x86" # default arch is x86
else
for arch in $supported_arch
do
if [ $arch = $1 ]
then
def_arch=$arch
break
fi
done
fi
# set env
case $def_arch in
"x86")
export CROSS_COMPILE=
export ARCH=x86
;;
"riscv64")
export CROSS_COMPILE=riscv64-unknown-elf-
export ARCH=riscv64
;;
*) echo "unknown arch! " $def_arch
return 1
esac
echo "Set environment for for xlibc."
echo [CROSS COMPILE ] $CROSS_COMPILE
echo [ARCH ] $def_arch
echo [NXBASE ARCH ] $ARCH
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化