Portability fixes for BSD (and some less common Linux) systems #792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this PR contains a few portability fixes made during an attempt to build libdragon's toolchain on FreeBSD.
bash cannot always be found at /bin/bash.
/usr/bin/env is commonly present on most unix systems. using it to
invoke bash is more portable, and is already used elsewhere in this
project. this is necessary on systems like NixOS and the BSDs.
the second commit adds a variable that is used to store how to invoke
GNU Make. this is necessary for systems such as the BSDs which
typically use their own make implementation that is not compatible
with the same extensions as GNU Make, and often install the GNU
one as "gmake".
for existing users, nothing changes. BSD users can now invoke with:
MAKE=gmake ./build-toolchain.sh
these are not enough to allow the toolchain to build to completion, but it does now get quite rather late into the build, rather than immediately failing.