#!/bin/bash
# 服务器版本 rttys-windows-amd64-3.5.0
# ./build.sh arm-hisiv300-linux
# arm-hisiv300-linux
complex_platform=$1
if [ ! -d "libev" ]; then
# sudo apt install -y libev-dev libssl-dev
git clone https://github.com/enki/libev.git
fi
if [ ! $complex_platform ]; then
echo "please set arm platform"
exit 0
fi
install_dir=$(readlink -f "$(dirname "$0")")/install
echo $install_dir
# complex platform
# eg. arm-linux-gnueabi
cd libev
if [ ! -d "libev/Makefile" ]; then
make distclean
fi
./configure --host=$complex_platform --prefix=$install_dir && make install
cd ..
echo "..................compiler rtty........................."
# cmake . -DCMAKE_C_COMPILER=$complex_platform-gcc -DCMAKE_FIND_ROOT_PATH=$install_dir && make install
make clean
make CROSS_COMPILER=$complex_platform-