2021-12-31 12:12:40 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# exit this script if any commmand fails
|
|
|
|
set -e
|
|
|
|
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
2022-08-29 20:51:22 +08:00
|
|
|
AX_ROOT="$DIR"/../..
|
2021-12-31 12:12:40 +08:00
|
|
|
HOST_NAME=""
|
|
|
|
CURL="curl --retry 999 --retry-max-time 0"
|
|
|
|
|
|
|
|
function install_linux_environment()
|
|
|
|
{
|
|
|
|
echo "Installing linux dependence packages ..."
|
2022-08-29 20:51:22 +08:00
|
|
|
echo -e "y" | bash $AX_ROOT/install-deps-linux.sh
|
2021-12-31 12:12:40 +08:00
|
|
|
echo "Installing linux dependence packages finished!"
|
|
|
|
}
|
|
|
|
|
|
|
|
# set up environment according os and target
|
|
|
|
function install_environement()
|
|
|
|
{
|
|
|
|
echo "Installing environement ..."
|
|
|
|
|
|
|
|
if [ "$GH_OS_NAME" == "linux" ]; then
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install ninja-build
|
|
|
|
ninja --version
|
|
|
|
|
|
|
|
sudo apt-get install nasm
|
|
|
|
nasm -v
|
2022-09-05 14:13:52 +08:00
|
|
|
|
2021-12-31 12:12:40 +08:00
|
|
|
if [ "$BUILD_TARGET" == "linux" ]; then
|
|
|
|
install_linux_environment
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$GH_OS_NAME" == "osx" ]; then
|
|
|
|
brew install nasm
|
|
|
|
nasm -v
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
python -V
|
|
|
|
cmake --version
|
|
|
|
|
|
|
|
install_environement
|
|
|
|
|
|
|
|
echo "before-install.sh execution finished!"
|