Fix Unix-like builds.
Further fixes.
Merge pull request #5658 from thedax/unixBuildFix

Fix Unix-like builds (e.g. Linux, Android, etc.).