diff --git a/build-support/bin/llvm/linux/x86_64/6.0.0/build-llvm.sh b/build-support/bin/llvm/linux/x86_64/6.0.0/build-llvm.sh new file mode 100755 index 0000000..f889011 --- /dev/null +++ b/build-support/bin/llvm/linux/x86_64/6.0.0/build-llvm.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source "$(git rev-parse --show-toplevel)/utils.v1.bash" + +set_strict_mode + +function fetch_llvm_binary_release_archive { + local -r system_id="$1" + + local -r archive_dirname="clang+llvm-${LLVM_VERSION}-x86_64-${system_id}" + local -r archive_filename="${archive_dirname}.tar.xz" + local -r release_url="https://releases.llvm.org/${LLVM_VERSION}/${archive_filename}" + + curl_file_with_fail "$release_url" "$archive_filename" +} + +readonly TARGET_PLATFORM="$1" LLVM_VERSION="$2" + +case "$TARGET_PLATFORM" in + osx) + with_pushd "$(mkdirp_absolute_path "llvm-${LLVM_VERSION}-osx")" \ + fetch_llvm_binary_release_archive 'apple-darwin' + ;; + linux) + with_pushd "$(mkdirp_absolute_path "llvm-${LLVM_VERSION}-linux")" \ + fetch_llvm_binary_release_archive 'linux-gnu-ubuntu-16.04' + ;; + *) + die "llvm does not support building for '${TARGET_PLATFORM}'" + ;; +esac diff --git a/build-support/bin/llvm/linux/x86_64/6.0.0/build.sh b/build-support/bin/llvm/linux/x86_64/6.0.0/build.sh new file mode 100755 index 0000000..b66a2bf --- /dev/null +++ b/build-support/bin/llvm/linux/x86_64/6.0.0/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +readonly result="$(./build-llvm.sh linux 6.0.0)" + +cp "$result" ./llvm.tar.xz diff --git a/build-support/bin/llvm/mac/10.10 b/build-support/bin/llvm/mac/10.10 new file mode 120000 index 0000000..094e7b6 --- /dev/null +++ b/build-support/bin/llvm/mac/10.10 @@ -0,0 +1 @@ +10.13 \ No newline at end of file diff --git a/build-support/bin/llvm/mac/10.11 b/build-support/bin/llvm/mac/10.11 new file mode 120000 index 0000000..094e7b6 --- /dev/null +++ b/build-support/bin/llvm/mac/10.11 @@ -0,0 +1 @@ +10.13 \ No newline at end of file diff --git a/build-support/bin/llvm/mac/10.12 b/build-support/bin/llvm/mac/10.12 new file mode 120000 index 0000000..094e7b6 --- /dev/null +++ b/build-support/bin/llvm/mac/10.12 @@ -0,0 +1 @@ +10.13 \ No newline at end of file diff --git a/build-support/bin/llvm/mac/10.13/6.0.0/build-llvm.sh b/build-support/bin/llvm/mac/10.13/6.0.0/build-llvm.sh new file mode 100755 index 0000000..f889011 --- /dev/null +++ b/build-support/bin/llvm/mac/10.13/6.0.0/build-llvm.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +source "$(git rev-parse --show-toplevel)/utils.v1.bash" + +set_strict_mode + +function fetch_llvm_binary_release_archive { + local -r system_id="$1" + + local -r archive_dirname="clang+llvm-${LLVM_VERSION}-x86_64-${system_id}" + local -r archive_filename="${archive_dirname}.tar.xz" + local -r release_url="https://releases.llvm.org/${LLVM_VERSION}/${archive_filename}" + + curl_file_with_fail "$release_url" "$archive_filename" +} + +readonly TARGET_PLATFORM="$1" LLVM_VERSION="$2" + +case "$TARGET_PLATFORM" in + osx) + with_pushd "$(mkdirp_absolute_path "llvm-${LLVM_VERSION}-osx")" \ + fetch_llvm_binary_release_archive 'apple-darwin' + ;; + linux) + with_pushd "$(mkdirp_absolute_path "llvm-${LLVM_VERSION}-linux")" \ + fetch_llvm_binary_release_archive 'linux-gnu-ubuntu-16.04' + ;; + *) + die "llvm does not support building for '${TARGET_PLATFORM}'" + ;; +esac diff --git a/build-support/bin/llvm/mac/10.13/6.0.0/build.sh b/build-support/bin/llvm/mac/10.13/6.0.0/build.sh new file mode 100755 index 0000000..607c005 --- /dev/null +++ b/build-support/bin/llvm/mac/10.13/6.0.0/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +readonly result="$(./build-llvm.sh osx 6.0.0)" + +cp "$result" ./llvm.tar.xz