occlum/tools/toolchains/bash/build.sh
Zheng, Qi 6a8815706d Add bash build script for both occlum-gcc and gcc
Signed-off-by: Zheng, Qi <huaiqing.zq@antgroup.com>
2021-09-23 19:33:36 +08:00

35 lines
695 B
Bash
Executable File

#! /bin/bash
set -e
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
INSTALL_DIR=/opt/occlum/toolchains/bash
bash_source="https://github.com/occlum/bash.git"
bash_branch="bash_5.1_for_occlum"
rm -rf ${INSTALL_DIR}
# Download bash source
git clone -b ${bash_branch} ${bash_source}
echo "Building bash with musl-gcc (occlum-gcc) ..."
cd bash
CC=occlum-gcc CXX=occlum-g++ ./configure --without-bash-malloc
make clean
make -j
mkdir -p ${INSTALL_DIR}/musl
cp bash ${INSTALL_DIR}/musl/
# Restore code
make clean
git clean -dxf
git reset HEAD --hard
echo "Building bash with gcc ..."
./configure
make -j
mkdir -p ${INSTALL_DIR}/glibc
cp bash ${INSTALL_DIR}/glibc/