2019-06-27 06:45:20 -06:00
|
|
|
#!/bin/sh -e
|
2019-06-27 06:54:19 -06:00
|
|
|
|
2022-04-04 21:40:52 -06:00
|
|
|
mv Modules/* cmake/modules/
|
|
|
|
|
2019-11-13 17:28:28 -07:00
|
|
|
cmake -B build \
|
2019-06-27 06:54:19 -06:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DLLVM_BUILD_LLVM_DYLIB=ON \
|
|
|
|
-DLLVM_LINK_LLVM_DYLIB=ON \
|
2019-11-13 17:28:28 -07:00
|
|
|
-DLLVM_TARGETS_TO_BUILD="host;AMDGPU" \
|
2019-06-27 06:54:19 -06:00
|
|
|
-DLLVM_ENABLE_RTTI=ON \
|
2019-07-31 16:56:58 -06:00
|
|
|
-DLLVM_HOST_TRIPLE="$(cc -dumpmachine)" \
|
2021-07-06 04:31:42 -06:00
|
|
|
-DLLVM_INCLUDE_BENCHMARKS=OFF \
|
|
|
|
-DLLVM_INCLUDE_EXAMPLES=OFF \
|
|
|
|
-DLLVM_INCLUDE_DOCS=OFF \
|
|
|
|
-DLLVM_INCLUDE_TESTS=OFF \
|
2021-07-17 20:47:20 -06:00
|
|
|
-DLLVM_ENABLE_TERMINFO=OFF \
|
2020-09-16 23:43:35 -06:00
|
|
|
-DLLVM_ENABLE_LIBXML2=OFF \
|
2019-11-13 17:28:28 -07:00
|
|
|
-Wno-dev
|
2019-06-27 06:54:19 -06:00
|
|
|
|
2019-11-13 17:28:28 -07:00
|
|
|
cmake --build build
|
|
|
|
cmake --install build
|
2022-09-22 13:48:36 -06:00
|
|
|
|
|
|
|
# Use new llvm-config to generate a pkg-config file.
|
|
|
|
PATH="$1/usr/bin:$PATH"
|
|
|
|
mkdir -p "$1/usr/lib/pkgconfig"
|
|
|
|
sed -e "s|$1||" -e 's|/usr/include|\${includedir}|' \
|
|
|
|
> "$1/usr/lib/pkgconfig/llvm.pc" <<EOF
|
|
|
|
prefix=/usr
|
|
|
|
exec_prefix=\${prefix}
|
|
|
|
libdir=\${exec_prefix}/lib
|
|
|
|
includedir=\${prefix}/include
|
|
|
|
has_rtti=$(llvm-config --has-rtti)
|
|
|
|
|
|
|
|
Name: LLVM
|
|
|
|
Description: LLVM compiler infrastructure
|
|
|
|
URL: https://llvm.org
|
|
|
|
Version: $(llvm-config --version)
|
|
|
|
Requires:
|
|
|
|
Requires.private: zlib
|
|
|
|
Libs: -L\${libdir} $(llvm-config --libs)
|
|
|
|
Libs.private: -lstdc++ $(llvm-config --libs --link-static)
|
|
|
|
Cflags: $(llvm-config --cflags)
|
|
|
|
EOF
|