This PR improves the BSD compatibility of the bdb4 installer script.
I've tested this on OpenBSD 6.2 (clang) and Ubuntu 16.04 (gcc).
This needs testing on OSX at least, and on gcc/Linux to make sure that applying the patch unconditionally doesn't negatively affect gcc.
NB: this is not yet sufficient to make install_db4.sh work on FreeBSD, as we need to use yet another sha256 tool there. But it's a step in the right direction.
contrib: New clang patch for install_db4
Replace the clang patch with a new and improved version that also fixes the build issues with OpenBSD and FreeBSD's clang, and apply it unconditionally.
Thanks to @fanquake for finding the patch.
contrib: Make X=Y arguments work in install_db4
Trailing X=Y arguments are supposed to be passed through unchanged to bdb's configure. This was not the case, at least with OpenBSD 6.2's shell.
Fix this by not storing the arguments in a temporary variable but passing "$@" through directly.
contrib: FreeBSD compatibility in install_db4.sh
Unfortunately, FreeBSD uses yet another syntax for sha256.
Support FreeBSD's syntax too. Using uname is a bit of a hack but it works and I found no way to distinguish the two.