The bootstrap.sh script currently makes use of bash. However, in some systems it is not installed by default and if it is installed, it is not in the /bin/bash path. This PR changes the bootstrap.sh script to use the POSIX compliant /bin/sh and makes sure to only use POSIX shell syntax.
Why?
Because it makes it easier to port gprbuild to other *NIX platforms, which is where a bootstrap is generally needed.
If the shell script (either the original or the one with this modifications) is analysed with https://www.shellcheck.net/ some stylistic changes are recommended, however, I have not included them here.
Extra
Could this change be backported to V21? Master does not build with GCC 10.3.0, V21 does. V21 has the issue where some install instruction use -t, which is redundant and not POSIX compliant too. Those -t flags have been removed from master.
The bootstrap.sh script currently makes use of bash. However, in some systems it is not installed by default and if it is installed, it is not in the /bin/bash path. This PR changes the bootstrap.sh script to use the POSIX compliant /bin/sh and makes sure to only use POSIX shell syntax.
Why?
Because it makes it easier to port gprbuild to other *NIX platforms, which is where a bootstrap is generally needed.
What changed?
Use
/bin/sh
by defaultPOSIX shell does not allow for array slicing (see the error function). I have modified it to use
cut
, which is the recommended way as per https://github.com/koalaman/shellcheck/wiki/SC3057The double equals signs are also undefined in POSIX, they were changed to simple
=
, this is the recommended way as indicated in https://github.com/koalaman/shellcheck/wiki/SC3014If the shell script (either the original or the one with this modifications) is analysed with https://www.shellcheck.net/ some stylistic changes are recommended, however, I have not included them here.
Extra
Could this change be backported to V21? Master does not build with GCC 10.3.0, V21 does. V21 has the issue where some
install
instruction use-t
, which is redundant and not POSIX compliant too. Those-t
flags have been removed from master.Thank you, Fer