代码拉取完成,页面将自动刷新
#!/bin/bash
RootPath=$(cd $(dirname $0); pwd)
build_linux_x86_64() {
make
}
# build arm64 with amd64 docker ubuntu:focal, apt-get install -y gcc-9-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-9-aarch64-linux-gnu g++-aarch64-linux-gnu
# Support Ubuntu focal, not support CentOS7
build_linux_arm64_gcc9() {
echo "build linux arm64 gcc9"
get_rocksdb_compress_dep
export PORTABLE=1
export ARCH=arm64
# export CC=aarch64-linux-gnu-gcc
export EXTRA_CFLAGS="-Wno-error=deprecated-copy -fno-strict-aliasing -Wclass-memaccess -Wno-error=class-memaccess -Wpessimizing-move -Wno-error=pessimizing-move"
export EXTRA_CXXFLAGS=$EXTRA_CFLAGS
CGO_ENABLED=1 GOOS=linux GOARCH=arm64 make
}
# build arm64 with amd64 docker buntu:xenial , apt-get install -y gcc-4.9-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-4.9-aarch64-linux-gnu g++-aarch64-linux-gnu
# support CentOS7
#
build_linux_arm64_gcc4() {
echo "build linux arm64 gcc4.9"
get_rocksdb_compress_dep
export PORTABLE=1
export ARCH=arm64
# export CC=aarch64-linux-gnu-gcc
export EXTRA_CFLAGS=" -fno-strict-aliasing "
export EXTRA_CXXFLAGS=$EXTRA_CFLAGS
CGO_ENABLED=1 GOOS=linux GOARCH=arm64 make
}
# wget compress dep
get_rocksdb_compress_dep() {
#################################################################
## Might check the dep files each in individual if wget failed ##
#################################################################
if [ ! -d "${RootPath}/vendor/dep" ]; then
mkdir -p ${RootPath}/vendor/dep
fi
cd ${RootPath}/vendor/dep
if [ ! -d "${RootPath}/vendor/dep/zlib-1.2.11" ]; then
wget https://zlib.net/fossils/zlib-1.2.11.tar.gz
tar zxf zlib-1.2.11.tar.gz
fi
if [ ! -d "${RootPath}/vendor/dep/bzip2-1.0.6" ]; then
wget https://sourceforge.net/projects/bzip2/files/bzip2-1.0.6.tar.gz
tar zxf bzip2-1.0.6.tar.gz
fi
if [ ! -d "${RootPath}/vendor/dep/zstd-1.4.8" ]; then
wget https://codeload.github.com/facebook/zstd/zip/v1.4.8
unzip v1.4.8
fi
if [ ! -d "${RootPath}/vendor/dep/lz4-1.9.3" ]; then
wget https://codeload.github.com/lz4/lz4/tar.gz/v1.9.3
tar zxf v1.9.3
fi
#rm -rf zlib-1.2.11.tar.gz bzip2-1.0.6.tar.gz v1.4.8 v1.9.3
cd ${RootPath}
}
CPUTYPE=${CPUTYPE} | tr 'A-Z' 'a-z'
echo ${CPUTYPE}
case ${CPUTYPE} in
"arm64_gcc9")
build_linux_arm64_gcc9
;;
"arm64_gcc4")
build_linux_arm64_gcc4
;;
"arm64")
build_linux_arm64_gcc4
;;
*)
build_linux_x86_64
;;
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。