teleport/build.sh

47 lines
902 B
Bash
Raw Normal View History

2017-01-11 12:04:11 +00:00
#!/bin/bash
2017-06-05 18:22:52 +00:00
2017-01-11 12:04:11 +00:00
PATH_ROOT=$(cd "$(dirname "$0")"; pwd)
function on_error()
{
echo -e "\033[01m\033[31m"
echo "==================[ !! ERROR !! ]=================="
echo -e $1
echo "==================================================="
echo -e "\033[0m"
exit 1
}
2017-06-05 18:22:52 +00:00
function build_linux
{
PYEXEC=${PATH_ROOT}/external/linux/release/bin/python3.4
PYSTATIC=${PATH_ROOT}/external/linux/release/lib/libpython3.4m.a
2017-01-11 12:04:11 +00:00
if [ ! -f "${PYSTATIC}" ]; then
2017-06-05 18:22:52 +00:00
echo "python static not found, now build it..."
"${PATH_ROOT}/build/build-py-static.sh"
if [ ! -f "${PYSTATIC}" ]; then
on_error "can not build python static."
fi
2017-01-11 12:04:11 +00:00
fi
2017-06-05 18:22:52 +00:00
${PYEXEC} -B "${PATH_ROOT}/build/build.py" $@
}
function build_macos
{
python3 -B "${PATH_ROOT}/build/build.py" $@
}
SYSTEM=`uname -s`
if [ $SYSTEM = "Linux" ] ; then
build_linux
elif [ $SYSTEM = "Darwin" ] ; then
build_macos
else
echo "Unsupported platform."
fi