On 7 March 2017 at 19:22, Frank Binns <frank.bi...@imgtec.com> wrote: > On 07/03/17 17:57, Emil Velikov wrote: >> >> On 7 March 2017 at 17:29, Frank Binns <frank.bi...@imgtec.com> wrote: >>> >>> Hi, >>> >>> On 06/03/17 19:06, Matt Turner wrote: >>>> >>>> Available since pkg-config-0.28 and pkgconf-0.8.10. >>>> >>>> The removal of the AC_PATH_PROG is intentional. Use pkg-config. >>> >>> >>> It doesn't seem possible to cross-compile Mesa out of the box due >>> to it using the 'host' scanner (found via pkgconfig) instead of the >>> 'build' scanner. It seems to me that it should actually try finding >>> the scanner via PATH before falling back to pkgconfig. This is what >>> Weston does, for example. >>> >> Mostly some thinking out loud, feel free to not reply. >> >> Consider the following example: >> >> You want to use GCC/Python/other tool that is a) not the system >> installed one or b) not found in the default location. >> The .pc file makes it easier to know where the tool is rather than >> guessing and/or manually setting CC=/path/to/my/local/gcc/build/gcc >> and other variables. > > > But then this can break cross-compilation. For example, if I have the > following set when running configure: > PKG_CONFIG_LIBDIR=${SYSROOT}/usr/lib/pkgconfig > PKG_CONFIG_SYSROOT_DIR=${SYSROOT} > > Now configure is going to find the scanner in ${SYROOT} and that won't > run on the 'build' machine. So to get it to use the correct scanner I > have to prefix /usr/lib/pkgconfig to PKG_CONFIG_LIBDIR. > > Now configure is going to find .pc files on the 'build' machine that > aren't necessarily in ${SYSROOT} and, as a result, the build may end > up failing. > For a second I was wondering how that can happen only to realise that I've not seen the patch/code you mentioned below. Thank you for that.
With the original (better imho) behaviour one would need PKG_CONFIG_LIBDIR=${SYSROOT}/usr/lib/pkgconfig:$path_to_system_or_third_party_host_pkgconfig PKG_CONFIG_SYSROOT_DIR=${SYSROOT} or PKG_CONFIG_PATH=${SYSROOT}/usr/lib/pkgconfig // falls back to the system default for the build/host wayland-scanner PKG_CONFIG_SYSROOT_DIR=${SYSROOT} With the current one PKG_CONFIG_LIBDIR=$path_to_non_system_host_pkgconfig:${SYSROOT}/usr/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=${SYSROOT} >> I think we can all agree that having those build for 'target' is silly >> and sub-optimal. > > > I'm not sure everyone agrees: > https://patchwork.freedesktop.org/patch/53476/ > Some of the points seem a bit odd, but yes - one might need to have the 'target' version of the tool. It's quite interesting how the original behaviour allowed that yet was deemed wrong/other... In either case, the ship has sailed so there's no point in nitpicking it imho. Thanks again, Emil _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev