39 lines
1.0 KiB
Plaintext
39 lines
1.0 KiB
Plaintext
# Description: LLVM compiler backend
|
|
# URL: https://llvm.org/
|
|
# Maintainer: CRUX System Team, core-ports at crux dot nu
|
|
# Depends on: cmake libxml2 ninja
|
|
|
|
name=llvm
|
|
version=11.0.0
|
|
release=1
|
|
source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz
|
|
llvm-config.h)
|
|
|
|
build() {
|
|
export CC=gcc
|
|
export CXX=g++
|
|
|
|
cmake -S $name-$version.src -B build -G Ninja \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DLLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF' \
|
|
-DLLVM_BUILD_LLVM_DYLIB=1 \
|
|
-DLLVM_LINK_LLVM_DYLIB=1 \
|
|
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
|
|
-DLLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
|
|
-DLLVM_INCLUDE_EXAMPLES=0 \
|
|
-DLLVM_INCLUDE_TESTS=0 \
|
|
-DLLVM_ENABLE_FFI=1 \
|
|
-DLLVM_ENABLE_RTTI=1 \
|
|
-DLLVM_ENABLE_OCAMLDOC=0 \
|
|
-DLLVM_INSTALL_UTILS=1 \
|
|
-Wno-dev
|
|
|
|
ninja -C build
|
|
DESTDIR=$PKG ninja -C build install
|
|
|
|
# multilib stub
|
|
mv $PKG/usr/include/llvm/Config/llvm-config{,-64}.h
|
|
install -m 0644 $SRC/llvm-config.h $PKG/usr/include/llvm/Config/
|
|
}
|