2019-10-28 23:10:24 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-11-26 10:21:27 +08:00
|
|
|
# Exit on error:
|
|
|
|
set -e
|
|
|
|
|
2019-10-28 23:10:24 +08:00
|
|
|
# Check for required env variables JAVA_HOME
|
|
|
|
if [[ -z "${JAVA_HOME}" ]]; then
|
|
|
|
echo "JAVA_HOME env var is missing."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-11-26 10:21:27 +08:00
|
|
|
if [[ -z "${LLVM_PROJECT_ROOT}" ]]; then
|
|
|
|
echo "LLVM_PROJECT_ROOT env var is missing."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-10-28 23:10:24 +08:00
|
|
|
# Set up mock installation path:
|
|
|
|
export INSTALL_PATH=$WORKSPACE/INSTALL_PATH
|
|
|
|
mkdir -p $INSTALL_PATH
|
|
|
|
export PATH=$INSTALL_PATH/bin:$PATH
|
|
|
|
export LD_LIBRARY_PATH=$INSTALL_PATH/lib:$INSTALL_PATH/lib64:$LD_LIBRARY_PATH
|
|
|
|
export CPATH=$INSTALL_PATH/include:$CPATH
|
|
|
|
|
|
|
|
# Set up project specific environment variables:
|
|
|
|
export PATH=$JAVA_HOME/bin:$PATH
|
|
|
|
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar:$CLASSPATH
|
|
|
|
export CC=/usr/bin/gcc
|
|
|
|
export CXX=/usr/bin/g++
|
|
|
|
export BUILD_PATH=$(pwd)
|
|
|
|
export CPATH=$(pwd)/../runtime/
|
|
|
|
|
|
|
|
mkdir build && cd build
|
2019-11-26 10:21:27 +08:00
|
|
|
cmake -DCMAKE_C_COMPILER=$CC \
|
|
|
|
-DCMAKE_CXX_COMPILER=$CXX \
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=$INSTALL_PATH \
|
|
|
|
-DONNF_ENABLE_NODE_TEST_JAVA=ON \
|
|
|
|
-DONNF_ENABLE_NODE_TEST_JNI=ON \
|
|
|
|
-DONNF_ENABLE_NODE_TEST_CPP=OFF \
|
2019-12-20 05:28:53 +08:00
|
|
|
-DONNF_TARGET_ARCH=z13 ..
|
2019-10-28 23:10:24 +08:00
|
|
|
|
|
|
|
make -j "$(nproc)" install
|
|
|
|
ctest -j "$(nproc)"
|