-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add gnu make 4.2.1 #84
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.13 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.13 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
10.13 |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This script appears to be identical to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There can indeed be 1 or 2 such scripts (not sure of the ideal number yet), and there is no rush or other reason to justify not attempting to address this somewhat here! |
||
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 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good deal of ceremony over just a single line of
"$@"
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was pilfered from the gcc script, which requires
--host
and--target
arguments to./configure
, in addition to being written as the first attempt of the new variety of binaries scripts (and therefore a bit clunky and overgeneralized). I will not look into fixing that for gcc in this PR, but this indirection has no utility here, I think.