diff options
author | Egor Ananyin <ananinegor@gmail.com> | 2021-06-10 20:38:00 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-10 20:21:08 +0100 |
commit | 023df8e596aab8ad054a4fb8921c0a4890a78ac1 (patch) | |
tree | 859cf8f231b656dc4dc18d2898979d239c85e8ef /Ports/llvm/package.sh | |
parent | 794cf8eef47ca4f8d20ee94c18c6dce664d34c78 (diff) | |
download | serenity-023df8e596aab8ad054a4fb8921c0a4890a78ac1.zip |
Ports: Add LLVM port
Diffstat (limited to 'Ports/llvm/package.sh')
-rwxr-xr-x | Ports/llvm/package.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Ports/llvm/package.sh b/Ports/llvm/package.sh new file mode 100755 index 0000000000..e9c1db9873 --- /dev/null +++ b/Ports/llvm/package.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=llvm +useconfigure=true +version=12.0.0 +workdir=llvm-project-llvmorg-${version} +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" +files="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${version}.zip llvm.zip f77723b70a5d4ab14899feda87d6cf601612165899abb2f6c7b670e517f45e2d" +auth_type=sha256 + +pre_patch() { + host_env + mkdir -p llvm-host + cmake ${workdir}/llvm \ + -B llvm-host \ + -DLLVM_ENABLE_PROJECTS=clang + make -C llvm-host -j $(nproc) llvm-tblgen clang-tblgen + target_env +} + +configure() { + mkdir -p llvm-build + cmake ${workdir}/llvm \ + -B llvm-build $configopts \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DLLVM_TARGETS_TO_BUILD=X86 \ + -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \ + -DLLVM_TABLEGEN=$(pwd)/llvm-host/bin/llvm-tblgen \ + -DCMAKE_CROSSCOMPILING=True \ + -DLLVM_DEFAULT_TARGET_TRIPLE=i386-none-gnueabi \ + -DLLVM_TARGET_ARCH=X86 \ + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DCLANG_TABLEGEN=$(pwd)/llvm-host/bin/clang-tblgen +} + +build() { + make -C llvm-build -j $(nproc) --no-print-directory +} + +install() { + make -C llvm-build -j $(nproc) --no-print-directory install +} |