mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-09 07:06:47 +00:00
fix some script bugs (#304)
add arch linux prerequisited packages Co-authored-by: Yao Zhao <dragonlinux@gmail.com>
This commit is contained in:
parent
40fe15e095
commit
a30434f520
@ -74,7 +74,10 @@ fi
|
||||
# install prerequisited
|
||||
# 注意texinfo和binutils的版本是否匹配
|
||||
# 注意gmp/mpc/mpfr和gcc/g++的版本是否匹配
|
||||
sudo apt-get install -y \
|
||||
echo "Start installing prerequisited packages"
|
||||
case `cat /etc/os-release | grep '^NAME=' | cut -d'"' -f2` in
|
||||
"Debian"* | "Ubuntu"*)
|
||||
sudo apt-get install -y \
|
||||
g++ \
|
||||
gcc \
|
||||
make \
|
||||
@ -84,6 +87,13 @@ sudo apt-get install -y \
|
||||
libmpfr-dev \
|
||||
flex \
|
||||
wget
|
||||
;;
|
||||
"Arch"*)
|
||||
sudo pacman -S --needed --noconfirm gcc make flex wget texinfo libmpc gmp mpfr
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# build the workspace
|
||||
mkdir $HOME/opt
|
||||
@ -95,8 +105,8 @@ cd $INSTALL_POS
|
||||
# compile binutils
|
||||
BIN_UTILS="binutils-2.38"
|
||||
BIN_UTILS_TAR="${BIN_UTILS}.tar.gz"
|
||||
if [[ ! -n "$(find $PREFIX/bin/ -name ${TARGET_LD})" && ! -n "$(find $PREFIX/bin/ -name ${TARGET_AS})" ]] || [ KEEP_BINUTILS -ne 1 ]; then
|
||||
if [ KEEP_BINUTILS -eq 1 ]; then
|
||||
if [[ ! -n "$(find $PREFIX/bin/ -name ${TARGET_LD})" && ! -n "$(find $PREFIX/bin/ -name ${TARGET_AS})" ]] || [ ${KEEP_BINUTILS} -ne 1 ]; then
|
||||
if [ ${KEEP_BINUTILS} -eq 1 ]; then
|
||||
echo -e "\033[35m 没有检测到 ${TARGET_LD} 或 没有检测到 ${TARGET_AS}, -kb参数无效 \033[0m"
|
||||
echo -e "\033[35m 开始安装binutils \033[0m"
|
||||
sleep 1s
|
||||
@ -104,7 +114,7 @@ if [[ ! -n "$(find $PREFIX/bin/ -name ${TARGET_LD})" && ! -n "$(find $PREFIX/bin
|
||||
if [ ! -d "$BIN_UTILS" ]; then
|
||||
if [ ! -f "$BIN_UTILS_TAR" ]; then
|
||||
echo -e "\033[33m [提醒] 如果使用的是国外源, 下载时间可能偏久. 如果需要使用清华源, 请以输入参数-cs, 即: bash build_gcc_toolchain.sh -cs \033[0m "
|
||||
if [ CHANGE_SOURCE ]; then
|
||||
if [ ${CHANGE_SOURCE} -eq 1 ]; then
|
||||
# 国内源
|
||||
wget "https://mirrors.ustc.edu.cn/gnu/binutils/${BIN_UTILS_TAR}" -P "$INSTALL_POS"
|
||||
else
|
||||
@ -126,8 +136,8 @@ fi
|
||||
# compile GCC
|
||||
GCC_FILE="gcc-11.3.0"
|
||||
GCC_FILE_TAR="${GCC_FILE}.tar.gz"
|
||||
if [ ! -n "$(find $PREFIX/bin/* -name $TARGET_GCC)" ] || [ KEEP_GCC -ne 1 ]; then
|
||||
if [ KEEP_GCC -eq 1 ]; then
|
||||
if [ ! -n "$(find $PREFIX/bin/* -name $TARGET_GCC)" ] || [ ${KEEP_GCC} -ne 1 ]; then
|
||||
if [ $KEEP_GCC -eq 1 ]; then
|
||||
echo -e "\033[35m 没有检测到 $TARGET_GCC, -kg参数无效 \033[0m"
|
||||
echo -e "\033[35m 开始安装binutils \033[0m"
|
||||
sleep 1s
|
||||
@ -135,7 +145,7 @@ if [ ! -n "$(find $PREFIX/bin/* -name $TARGET_GCC)" ] || [ KEEP_GCC -ne 1 ]; the
|
||||
if [ ! -d "$GCC_FILE" ]; then
|
||||
if [ ! -f "$GCC_FILE_TAR" ]; then
|
||||
echo -e "\033[33m [提醒] 如果使用的是国外源, 下载时间可能偏久. 如果需要使用清华源, 请以输入参数-cs, 即: bash build_gcc_toolchain.sh -cs \033[0m "
|
||||
if [ CHANGE_SOURCE ]; then
|
||||
if [ ${CHANGE_SOURCE} -eq 1 ]; then
|
||||
# 国内源
|
||||
wget "https://mirrors.ustc.edu.cn/gnu/gcc/${GCC_FILE}/${GCC_FILE_TAR}" -P "$INSTALL_POS"
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user