fix script for builder.

pull/111/head v3.1.0
Apex Lu 2018-09-24 04:46:12 +08:00
parent a6f03f3a66
commit 051b1fee28
3 changed files with 13 additions and 36 deletions

View File

@ -1,22 +1,5 @@
#!/bin/bash #!/bin/bash
#---------------------------------------------------------------
# README
#
# pleas copy build.sh.in to build.sh and change the following
# two lines to fit your env.
#
# Recommend to download miniconda from
# https://conda.io/miniconda.html
# and install it, root priviledge is not necessary.
#---------------------------------------------------------------
PATH_PYTHON_LINUX=/path/of/your/miniconda/installation
PATH_PYTHON_MACOS=/path/of/your/miniconda/installation
################################################################
# DO NOT TOUCH FOLLOWING CODE
################################################################
PATH_ROOT=$(cd "$(dirname "$0")"; pwd) PATH_ROOT=$(cd "$(dirname "$0")"; pwd)
function on_error() function on_error()
@ -31,33 +14,27 @@ function on_error()
exit 1 exit 1
} }
function check_python
{
if [ ! -f "${PYSTATIC}" ]; then
on_error "python not found."
fi
}
function build_linux function build_linux
{ {
PATH_PYTHON=${PATH_PYTHON_LINUX} PYEXEC=${PATH_ROOT}/external/linux/release/bin/python3.7
PYEXEC=${PATH_PYTHON}/bin/python3.7 PYSTATIC=${PATH_ROOT}/external/linux/release/lib/libpython3.7m.a
PYSTATIC=${PATH_PYTHON}/lib/libpython3.7m.a
if [ ! -f "${PYSTATIC}" ]; then
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
fi
check_python
${PYEXEC} -B "${PATH_ROOT}/build/build.py" $@ ${PYEXEC} -B "${PATH_ROOT}/build/build.py" $@
} }
function build_macos function build_macos
{ {
PATH_PYTHON=${PATH_PYTHON_LINUX} python3 -B "${PATH_ROOT}/build/build.py" $@
PYEXEC=${PATH_PYTHON}/bin/python3.7
PYSTATIC=${PATH_PYTHON}/lib/libpython3.7m.a
check_python
${PYEXEC} -B "${PATH_ROOT}/build/build.py" $@
} }
SYSTEM=`uname -s` SYSTEM=`uname -s`

Binary file not shown.