#!/bin/bash
# 通用交叉编译脚本
#
# build 编译环境
# host 编译出的程序的运行环境
# target 编译出的程序(编译器)编译出来的程序的运行环境
# 一般不需要
PATH_NAME="bash-5.0"
PATH_NAME_ZIP="bash-5.0.tar.gz"
PATH_NAME_ZIP_URL="http://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz"
PATH_NOW=`pwd`
PATH_INSTALL="/opt/$PATH_NAME"
PATH_CROSS_DIR=""
CROSS_COMPILE="$PATH_CROSS_DIRarm-hisiv400-linux-"
if [ -f $PATH_NAME_ZIP ] ;then
wget $PATH_NAME_ZIP_URL
fi
if [ -f $PATH_NAME ] ;then
tar -xf $PATH_NAME_ZIP
fi
cd $PATH_NAME
./configure \
--prefix=$PATH_INSTALL \
--host=arm-hisiv400-linux \
--build=x86_64-pc-linux-gnu \
CC=$CROSS_COMPILEgcc \
AR=$CROSS_COMPILEar
make -j12
make install
编译bash5.0,你只需要一个脚本。
标签:NAME,ZIP,交叉,bash5.0,CROSS,编译,PATH,bash From: https://blog.51cto.com/u_13316945/5832250