Add function get_build_tools to Dh_Lib and use it
A lot of code was computing build tool names in various ways. For instance, _get_pkgconf was copied three times. The various ways are now generalized into a get_build_tools subroutine available from Dh_Lib that handles all edge cases. The various buildsystems are updated to use it. In doing so, a number of semantics change subtly:
- All uses of _get_pkgconf will now honour a PKG_CONFIG environment variable.
- The replacement of _get_pkgconf now uses a triplet-prefixed pkg-config even in the native case.
- -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER is now always passed to cmake even for native builds even when the environment variables are not defined. Thus native builds will now use triplet-prefixed compilers by default.
- The _qmake subroutines will also return triplet-prefixed qmake commands by default even in the native case.
- When exporting CC or CXX, the cmake build system was forwarding them unmodified to the defines, but absolute paths are expected there. get_build_tools will now resolve the commands passed via CC and CXX to absolute paths before passing them to cmake.
Reviewed-by: Timo Roehling roehling@debian.org