2014-05-14 13:10:14 +02:00
|
|
|
# Description: LLVM compiler backend
|
2020-07-06 16:13:33 +02:00
|
|
|
# URL: https://llvm.org/
|
2020-10-13 11:22:42 +00:00
|
|
|
# Maintainer: CRUX System Team, core-ports at crux dot nu
|
2020-07-06 16:13:33 +02:00
|
|
|
# Depends on: cmake libxml2 ninja
|
2010-04-27 20:03:12 +02:00
|
|
|
|
|
|
|
name=llvm
|
2021-05-08 13:31:37 +10:00
|
|
|
version=12.0.0
|
2021-01-07 22:31:15 +11:00
|
|
|
release=1
|
2020-07-06 16:13:33 +02:00
|
|
|
source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz
|
2021-01-07 22:31:15 +11:00
|
|
|
llvm-config.h)
|
2010-04-27 20:03:12 +02:00
|
|
|
|
|
|
|
build() {
|
2020-10-13 11:22:42 +00:00
|
|
|
export CC=gcc
|
|
|
|
export CXX=g++
|
2016-05-15 20:00:18 +02:00
|
|
|
|
2020-10-13 11:22:42 +00:00
|
|
|
cmake -S $name-$version.src -B build -G Ninja \
|
2020-11-21 14:26:49 +00:00
|
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-D CMAKE_BUILD_TYPE=Release \
|
2020-11-22 16:38:01 +00:00
|
|
|
-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
|
|
|
|
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
|
2020-12-27 14:43:17 +11:00
|
|
|
-D LLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF;NVPTX' \
|
2020-11-21 14:26:49 +00:00
|
|
|
-D LLVM_BUILD_LLVM_DYLIB=1 \
|
|
|
|
-D LLVM_LINK_LLVM_DYLIB=1 \
|
|
|
|
-D LLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
|
|
|
|
-D LLVM_INCLUDE_EXAMPLES=0 \
|
|
|
|
-D LLVM_INCLUDE_TESTS=0 \
|
|
|
|
-D LLVM_ENABLE_FFI=1 \
|
|
|
|
-D LLVM_ENABLE_RTTI=1 \
|
|
|
|
-D LLVM_ENABLE_OCAMLDOC=0 \
|
|
|
|
-D LLVM_INSTALL_UTILS=1 \
|
2020-10-13 11:22:42 +00:00
|
|
|
-Wno-dev
|
2010-04-27 20:03:12 +02:00
|
|
|
|
2020-11-21 14:26:49 +00:00
|
|
|
cmake --build build
|
|
|
|
DESTDIR=$PKG cmake --install build
|
2010-04-27 20:03:12 +02:00
|
|
|
|
2020-10-13 11:22:42 +00:00
|
|
|
# multilib stub
|
|
|
|
mv $PKG/usr/include/llvm/Config/llvm-config{,-64}.h
|
|
|
|
install -m 0644 $SRC/llvm-config.h $PKG/usr/include/llvm/Config/
|
2010-04-27 20:03:12 +02:00
|
|
|
}
|