Double-checking the correct way to find wayland-scanner

Jussi Kukkonen jussi.kukkonen at intel.com
Thu May 18 10:59:25 UTC 2017


Hi,

I'd like to fix/standardize how several wayland using projects do
wayland-scanner lookups (because many of them require patching when
cross-compiling in Yocto) and wanted to double check that I'm arguing for
the right thing...

The problem cases for us are like this mesa example:

> PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],
>         WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner
wayland-scanner`,
>         WAYLAND_SCANNER='')
> if test "x$WAYLAND_SCANNER" = x; then
>     AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
> fi

This is a problem if pkg-config returns finds a wayland-scanner but it is
not the wayland-scanner we want to use (in Yocto case the path will be
target wayland-scanner path).

Weston on the other hand handles this in an order that's fine for Yocto:

> AC_PATH_PROG([wayland_scanner], [wayland-scanner])
> if test x$wayland_scanner = x; then
>         PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
>         wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner
wayland-scanner`
> fi

I can imagine that this order might be problematic for some use cases (?),
but at least the AC_PATH_PROG value can be overridden.

My proposal is to try to standardize on Weston style with the addition of
    AC_ARG_VAR([wayland_scanner], [The wayland-scanner executable])
To make it clear "wayland_scanner" can be overridden -- this is essentially
what wayland-protocols does.

Thoughts?

Jussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170518/2d258350/attachment.html>


More information about the wayland-devel mailing list