2014-03-19 13:00:18 +11:00
|
|
|
# Description: LLVM
|
2020-07-23 08:55:27 +10:00
|
|
|
# URL: https://llvm.org
|
2013-05-14 12:36:56 +10:00
|
|
|
# Maintainer: CRUX compat-32 Team, compat-32-ports at crux dot nu
|
2021-08-20 17:03:34 -05:00
|
|
|
# Depends on: libffi-32 libxml2-32 llvm ncurses-32
|
2013-05-14 12:36:56 +10:00
|
|
|
|
|
|
|
name=llvm-32
|
2022-03-23 19:50:14 +01:00
|
|
|
version=14.0.0
|
2022-02-16 22:31:25 +01:00
|
|
|
release=1
|
2019-12-29 01:08:59 +11:00
|
|
|
source=(https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-$version.src.tar.xz)
|
2013-05-14 12:36:56 +10:00
|
|
|
|
|
|
|
build() {
|
2020-11-01 18:57:11 +11:00
|
|
|
mkdir -p $SRC/keep
|
2015-11-28 12:23:20 -06:00
|
|
|
|
2022-03-23 19:50:14 +01:00
|
|
|
prt-get isinst ccache && PKGMK_LLVM+=' -D LLVM_CCACHE_BUILD=ON'
|
|
|
|
|
|
|
|
cmake -S llvm-$version.src -B build -G Ninja $PKGMK_LLVM \
|
2021-05-08 13:32:51 +10:00
|
|
|
-D CMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-D LLVM_LIBDIR_SUFFIX=32 \
|
|
|
|
-D CMAKE_BUILD_TYPE=Release \
|
|
|
|
-D CMAKE_C_FLAGS_RELEASE="${CFLAGS}" \
|
|
|
|
-D CMAKE_CXX_FLAGS_RELEASE="${CXXFLAGS}" \
|
2022-03-23 19:50:14 +01:00
|
|
|
-D LLVM_TARGET_ARCH=i686 \
|
2021-12-12 16:57:31 +11:00
|
|
|
-D LLVM_TARGETS_TO_BUILD='X86;AMDGPU;BPF;NVPTX;WebAssembly' \
|
|
|
|
-D LLVM_BINUTILS_INCDIR=/usr/include \
|
2021-10-01 18:51:03 +10:00
|
|
|
-D LLVM_BUILD_LLVM_DYLIB=ON \
|
|
|
|
-D LLVM_LINK_LLVM_DYLIB=ON \
|
2021-01-07 22:23:33 +11:00
|
|
|
-D LLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
|
2021-10-01 18:51:03 +10:00
|
|
|
-D LLVM_INCLUDE_EXAMPLES=OFF \
|
|
|
|
-D LLVM_ENABLE_OCAMLDOC=OFF \
|
|
|
|
-D LLVM_INCLUDE_TESTS=OFF \
|
|
|
|
-D LLVM_ENABLE_FFI=ON \
|
|
|
|
-D LLVM_ENABLE_RTTI=ON \
|
|
|
|
-D LLVM_ENABLE_OCAMLDOC=OFF \
|
|
|
|
-D LLVM_INSTALL_UTILS=ON \
|
2021-12-12 16:57:31 +11:00
|
|
|
-D LLVM_ENABLE_LIBCXX=OFF \
|
|
|
|
-D LLVM_ENABLE_LLD="$(prt-get isinst lld >/dev/null && echo ON || echo OFF)" \
|
2021-01-07 22:23:33 +11:00
|
|
|
-D LLVM_DEFAULT_TARGET_TRIPLE="i686-pc-linux-gnu" \
|
2021-12-12 16:57:31 +11:00
|
|
|
-D LLVM_OPTIMIZED_TABLEGEN=ON \
|
2022-03-23 19:50:14 +01:00
|
|
|
-D LLVM_INCLUDE_BENCHMARKS=OFF \
|
2018-07-28 14:40:08 +10:00
|
|
|
-Wno-dev
|
2016-11-10 20:10:10 +11:00
|
|
|
|
2020-11-01 18:57:11 +11:00
|
|
|
cmake --build build
|
2020-11-13 18:22:41 -06:00
|
|
|
DESTDIR=$PKG cmake --install build
|
2013-05-14 12:36:56 +10:00
|
|
|
|
2016-11-10 20:10:10 +11:00
|
|
|
# keep 32bit header and config
|
|
|
|
install -t $SRC/keep $PKG/usr/bin/llvm-config $PKG/usr/include/llvm/Config/llvm-config.h
|
2013-05-14 12:36:56 +10:00
|
|
|
|
2016-11-10 20:10:10 +11:00
|
|
|
# remove unneeded files
|
2017-10-23 19:31:59 +11:00
|
|
|
rm -r $PKG/usr/{bin,include,share/opt-viewer}
|
2013-05-14 12:36:56 +10:00
|
|
|
|
2016-11-10 20:10:10 +11:00
|
|
|
# install 32bit header and config
|
|
|
|
install -m 0755 -D $SRC/keep/llvm-config $PKG/usr/bin/llvm-config-32
|
|
|
|
install -m 0644 -D $SRC/keep/llvm-config.h $PKG/usr/include/llvm/Config/llvm-config-32.h
|
2013-05-14 12:36:56 +10:00
|
|
|
}
|