On Thu, Jan 25, 2018 at 10:10:40AM +0000, Luca Boccassi wrote: > Do you think this is something that could be fixed in upstream's > configure or makefiles? They are very receptive to patches and > improvements.
Partially, for one thing it *is* fixed upstream: The build system already separates uses of the "build" and "host" compiler (in GNU terminology) and calls them "HOSTCC" and "CC" (in Mozilla terminology). iproute2 actually honouring these variables (including PKG_CONFIG in configure) means that they put thought into this and essentially got this right. However this is not uniform across various Makefile projects. They have vastly differing ways to specify the naming of these tools. You get that uniformity once you move to autotools/cmake/qmake/meson. In my experience, the most common namings are: * Just use "normal" tool names and prepend each and every "host" tool with "${CROSS_COMPILE}". Typically the builder then sets CROSS_COMPILE=${DEB_HOST_GNU_TYPE}- and things work. * Use plain tool names (like "CC") for the host tool and then use a _FOR_BUILD variant for the build tools (e.g, "CC_FOR_BUILD"). Still changing HOSTCC to CC_FOR_BUILD is likely going to make some users unhappy as they will have to adapt. So maybe just leave it as is? Helmut