代码拉取完成,页面将自动刷新
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# shellcheck disable=SC2154,SC2034
# env
export RISCV64=/opt/riscv_toolchain_linux
export LD_LIBRARY_PATH=$RISCV64/lib64
export PATH="$RISCV64/bin:$PATH"
export CC=$RISCV64/bin/riscv64-unknown-linux-gnu-gcc
export CXX=$RISCV64/bin/riscv64-unknown-linux-gnu-g++
# common config options
common_config="--openjdk-target=riscv64-unknown-linux-gnu"
common_config="${common_config} --disable-warnings-as-errors"
common_config="${common_config} --with-sysroot=/opt/fedora28_riscv_root"
common_config="${common_config} --with-jvm-features=shenandoahgc"
# common_config="${common_config} --with-boot-jdk=/usr/lib/jvm/jdk-16"
common_config="${common_config} --with-boot-jdk=/usr/lib/jvm/jre-1.8.0-openjdk"
common_config="${common_config} --with-version-pre=no"
common_config="${common_config} --with-vendor-version-string=Bisheng"
common_config="${common_config} --with-vendor-name=Bisheng"
# cd ${GIT_CHECKOUT_DIR}
build() {
if [ "$1" == "release" ]; then
debug_level=release
common_config="${common_config} --with-debug-level=release"
elif [ "$1" == "slowdebug" ]; then
debug_level=slowdebug
common_config="${common_config} --with-debug-level=slowdebug"
else
debug_level=fastdebug
common_config="${common_config} --with-debug-level=fastdebug"
fi
echo "building ${debug_level}"
if [ -d "${debug_level}" ]; then
rm -rf ${debug_level}
fi
mkdir ${debug_level} && cd ${debug_level}
common_config="${common_config} --prefix=$PWD/install-${debug_level}"
# configure && make
bash ../configure ${common_config}
[ $? -ne 0 ] && echo "${debug_level} configure failed" && exit 1
echo "${debug_level} configure success"
make install
[ $? -ne 0 ] && echo "[${debug_level}]make failed, exit" && exit 1
echo "[${debug_level}] make success"
cd ..
}
versiontest() {
if [ "$1" == "release" ]; then
find_path="release/install-release/jvm"
elif [ "$1" == "slowdebug" ]; then
find_path="slowdebug/install-slowdebug/jvm"
else
find_path="fastdebug/install-fastdebug/jvm"
fi
jdk_path=$(find $find_path -name java)
# java -version test
export LD_LIBRARY_PATH=/opt/fedora28_riscv_root/usr/lib:/opt/fedora28_riscv_root/usr/lib64:$LD_LIBRARY_PATH
qemu-riscv64 ${jdk_path} -version
[ $? -ne 0 ] && echo "version test failed, exit" && exit 1
echo "version test passed"
}
# configure and build
build release && versiontest release
#build slowdebug && versiontest slowdebug
#build fastdebug && versiontest fastdbeug
[ $? -ne 0 ] && echo "pipelien failed, exit" && exit 1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。