Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions build-support/bin/llvm/linux/x86_64/6.0.0/build-llvm.sh
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions build-support/bin/llvm/linux/x86_64/6.0.0/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

readonly result="$(./build-llvm.sh linux 6.0.0)"

cp "$result" ./llvm.tar.xz
1 change: 1 addition & 0 deletions build-support/bin/llvm/mac/10.10
1 change: 1 addition & 0 deletions build-support/bin/llvm/mac/10.11
1 change: 1 addition & 0 deletions build-support/bin/llvm/mac/10.12
31 changes: 31 additions & 0 deletions build-support/bin/llvm/mac/10.13/6.0.0/build-llvm.sh
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions build-support/bin/llvm/mac/10.13/6.0.0/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

readonly result="$(./build-llvm.sh osx 6.0.0)"

cp "$result" ./llvm.tar.xz
58 changes: 58 additions & 0 deletions build-support/bin/make/linux/x86_64/4.2.1/build-make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

source "$(git rev-parse --show-toplevel)/utils.v1.bash"

set_strict_mode

function fetch_extract_make_source_release {
local -r extracted_dirname="make-${MAKE_VERSION}"
local -r archive_filename="${extracted_dirname}.tar.gz"
local -r release_url="https://ftpmirror.gnu.org/gnu/make/${archive_filename}"

local -r downloaded_archive="$(curl_file_with_fail "$release_url" "$archive_filename")"
extract_for "$downloaded_archive" "$extracted_dirname"
}

function build_make_with_configure {
local -a configure_cmd_line=("$@")

"${configure_cmd_line[@]}"

make "-j${SUBPROC_MAKE_JOBS}"

make install
}

function build_make_out_of_tree {
local -r source_extracted_abs="$(fetch_extract_make_source_release)"
local -r build_dir_abs="$(mkdirp_absolute_path 'make-build')"
local -r install_dir_abs="$(mkdirp_absolute_path 'make-install')"

with_pushd >&2 "$build_dir_abs" \
build_make_with_configure \
"${source_extracted_abs}/configure" \
--prefix="$install_dir_abs"

with_pushd "$install_dir_abs" \
create_gz_package 'make'
}

## Interpret arguments and execute build.

readonly MAKE_VERSION="$1"
# Default to 2 parallel jobs if unspecified.
readonly SUBPROC_MAKE_JOBS="${SUBPROC_MAKE_JOBS:-2}"

case "$(uname)" in
Darwin)
with_pushd "$(mkdirp_absolute_path "make-${MAKE_VERSION}-osx")" \
build_make_out_of_tree
;;
Linux)
with_pushd "$(mkdirp_absolute_path "make-${MAKE_VERSION}-linux")" \
build_make_out_of_tree
;;
*)
die "make does not support building for '$(uname)'"
;;
esac
5 changes: 5 additions & 0 deletions build-support/bin/make/linux/x86_64/4.2.1/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

readonly result="$(./build-make.sh 4.2.1)"

cp "$result" ./make.tar.gz
1 change: 1 addition & 0 deletions build-support/bin/make/mac/10.10
1 change: 1 addition & 0 deletions build-support/bin/make/mac/10.11
1 change: 1 addition & 0 deletions build-support/bin/make/mac/10.12
58 changes: 58 additions & 0 deletions build-support/bin/make/mac/10.13/4.2.1/build-make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

source "$(git rev-parse --show-toplevel)/utils.v1.bash"

set_strict_mode

function fetch_extract_make_source_release {
local -r extracted_dirname="make-${MAKE_VERSION}"
local -r archive_filename="${extracted_dirname}.tar.gz"
local -r release_url="https://ftpmirror.gnu.org/gnu/make/${archive_filename}"

local -r downloaded_archive="$(curl_file_with_fail "$release_url" "$archive_filename")"
extract_for "$downloaded_archive" "$extracted_dirname"
}

function build_make_with_configure {
local -a configure_cmd_line=("$@")

"${configure_cmd_line[@]}"

make "-j${SUBPROC_MAKE_JOBS}"

make install
}

function build_make_out_of_tree {
local -r source_extracted_abs="$(fetch_extract_make_source_release)"
local -r build_dir_abs="$(mkdirp_absolute_path 'make-build')"
local -r install_dir_abs="$(mkdirp_absolute_path 'make-install')"

with_pushd >&2 "$build_dir_abs" \
build_make_with_configure \
"${source_extracted_abs}/configure" \
--prefix="$install_dir_abs"

with_pushd "$install_dir_abs" \
create_gz_package 'make'
}

## Interpret arguments and execute build.

readonly MAKE_VERSION="$1"
# Default to 2 parallel jobs if unspecified.
readonly SUBPROC_MAKE_JOBS="${SUBPROC_MAKE_JOBS:-2}"

case "$(uname)" in
Darwin)
with_pushd "$(mkdirp_absolute_path "make-${MAKE_VERSION}-osx")" \
build_make_out_of_tree
;;
Linux)
with_pushd "$(mkdirp_absolute_path "make-${MAKE_VERSION}-linux")" \
build_make_out_of_tree
;;
*)
die "make does not support building for '$(uname)'"
;;
esac
5 changes: 5 additions & 0 deletions build-support/bin/make/mac/10.13/4.2.1/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

readonly result="$(./build-make.sh 4.2.1)"

cp "$result" ./make.tar.gz