From 89d102676d1364e5147a6c757e5c2527467c0872 Mon Sep 17 00:00:00 2001 From: Danny McClanahan <1305167+cosmicexplorer@users.noreply.github.com> Date: Sun, 21 Oct 2018 19:05:33 -0700 Subject: [PATCH] add make binary --- .../bin/make/linux/x86_64/4.2.1/build-make.sh | 58 +++++++++++++++++++ .../bin/make/linux/x86_64/4.2.1/build.sh | 5 ++ build-support/bin/make/mac/10.10 | 1 + build-support/bin/make/mac/10.11 | 1 + build-support/bin/make/mac/10.12 | 1 + .../bin/make/mac/10.13/4.2.1/build-make.sh | 58 +++++++++++++++++++ .../bin/make/mac/10.13/4.2.1/build.sh | 5 ++ 7 files changed, 129 insertions(+) create mode 100755 build-support/bin/make/linux/x86_64/4.2.1/build-make.sh create mode 100755 build-support/bin/make/linux/x86_64/4.2.1/build.sh create mode 120000 build-support/bin/make/mac/10.10 create mode 120000 build-support/bin/make/mac/10.11 create mode 120000 build-support/bin/make/mac/10.12 create mode 100755 build-support/bin/make/mac/10.13/4.2.1/build-make.sh create mode 100755 build-support/bin/make/mac/10.13/4.2.1/build.sh diff --git a/build-support/bin/make/linux/x86_64/4.2.1/build-make.sh b/build-support/bin/make/linux/x86_64/4.2.1/build-make.sh new file mode 100755 index 0000000..5e6c25d --- /dev/null +++ b/build-support/bin/make/linux/x86_64/4.2.1/build-make.sh @@ -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 diff --git a/build-support/bin/make/linux/x86_64/4.2.1/build.sh b/build-support/bin/make/linux/x86_64/4.2.1/build.sh new file mode 100755 index 0000000..813959b --- /dev/null +++ b/build-support/bin/make/linux/x86_64/4.2.1/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +readonly result="$(./build-make.sh 4.2.1)" + +cp "$result" ./make.tar.gz diff --git a/build-support/bin/make/mac/10.10 b/build-support/bin/make/mac/10.10 new file mode 120000 index 0000000..094e7b6 --- /dev/null +++ b/build-support/bin/make/mac/10.10 @@ -0,0 +1 @@ +10.13 \ No newline at end of file diff --git a/build-support/bin/make/mac/10.11 b/build-support/bin/make/mac/10.11 new file mode 120000 index 0000000..094e7b6 --- /dev/null +++ b/build-support/bin/make/mac/10.11 @@ -0,0 +1 @@ +10.13 \ No newline at end of file diff --git a/build-support/bin/make/mac/10.12 b/build-support/bin/make/mac/10.12 new file mode 120000 index 0000000..094e7b6 --- /dev/null +++ b/build-support/bin/make/mac/10.12 @@ -0,0 +1 @@ +10.13 \ No newline at end of file diff --git a/build-support/bin/make/mac/10.13/4.2.1/build-make.sh b/build-support/bin/make/mac/10.13/4.2.1/build-make.sh new file mode 100755 index 0000000..5e6c25d --- /dev/null +++ b/build-support/bin/make/mac/10.13/4.2.1/build-make.sh @@ -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 diff --git a/build-support/bin/make/mac/10.13/4.2.1/build.sh b/build-support/bin/make/mac/10.13/4.2.1/build.sh new file mode 100755 index 0000000..813959b --- /dev/null +++ b/build-support/bin/make/mac/10.13/4.2.1/build.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +readonly result="$(./build-make.sh 4.2.1)" + +cp "$result" ./make.tar.gz