[Mesa-dev] [PATCH 3/6] configure.ac: Use PKG_CHECK_VAR for wayland-scanner.

Frank Binns frank.binns at imgtec.com
Tue Mar 7 19:22:16 UTC 2017


On 07/03/17 17:57, Emil Velikov wrote:
> On 7 March 2017 at 17:29, Frank Binns <frank.binns at 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.

> 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/

Thanks
Frank

> On the weston case... I simply did want want to annoy people, they
> seemed rather attached [1] to having a 'target' wayland-scanner... ;-)
>
> -Emil
>
> [1] https://patchwork.freedesktop.org/patch/42511/



More information about the mesa-dev mailing list