export CC=gcc
export CXX=g++

cd $isim-$surum.src

mkdir build
cd build

cmake .. -G Ninja \
-DLLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
-DLLVM_ENABLE_CXX1Y=1 \
-DLLVM_INCLUDE_EXAMPLES=0 \
-DLLVM_INCLUDE_TESTS=0 \
-DLLVM_ENABLE_FFI=1 \
-DLLVM_ENABLE_RTTI=1 \
-DLLVM_ENABLE_OCAMLDOC=0 \
-DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF' \
-DLLVM_BUILD_LLVM_DYLIB=1 \
-DLLVM_LINK_LLVM_DYLIB=1 \
-DLLVM_INSTALL_UTILS=1 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_APPEND_VC_REV=0 \
-DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-Wno-dev

ninja
