ocamlfind
ocamlfind copied to clipboard
Apply Shellcheck improvement suggestions
I ran shellcheck on the configure script which suggested a lot of nice improvements, mostly about quoting and making sure spaces don't break the commands.
Other interesting improvements include removing variables that are never set (thus always empty, which made it work), so removing them makes it easier to see what is happening.
Edit: I also applied the $?
suggestion since it makes the code a bit less fragile and fixed the POSIX compatibility, so it should be as portable as it was before.
FYI, I tried to change the quoting stuff (i.e. ` `
vs $()
) in the OCaml codebase many years ago and it supposedly break some systems in /bin/sh
scripts, see this comment.
6 years later, the quoting concerns for backticks are somewhat less of a concern - I think the intersection of "has a C11 compiler and can therefore build OCaml 5.x" and "has a non-Posix sh" is fortunately ∅ 😊