Fix build on PPC64 and on others with unusual environments
- If OPTIONS don't match the environment, pass suitable CMake
arguments; modernise the one for gpsd
- Import patches from Gentoo, already submitted upstream, for
dealing with optional dependencies
Reported by: Piotr Kubaj
Obtained from: Andreas Sturmlechner