GNOME Bugzilla – Bug 671515
Use of AC_PATH_PROG(NM, ...) in configure.ac hinders cross compilation
Last modified: 2014-07-20 06:14:56 UTC
Use of AC_PATH_PROG() to configure 'nm' in particular does not play nicely with cross compiling distributions. AC_PATH_PROG is not cross compilation aware, and needs to be manually patched out when the host's native tools either do not support the cross compiled object files, or cannot determine their type uniquely. Switching to AC_CHECK_TOOLS() for the 'nm' check will automatically check for the correct tool when cross compiling, and will not change the behavior otherwise. For instance, ./configure --host=arm-linux-gnu --build=x86_64-linux-gnu will generate code checking for arm-linux-gnu-nm, rather than just nm. A suggested substitution (used in Openembedded Core) is AC_CHECK_TOOLS(NM, [$NM nm], nm), rather than AC_PATH_PROG(NM, nm, nm).