<div dir="ltr">Hi,<br><br>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...<br><br>The problem cases for us are like this mesa example:<br><br>> PKG_CHECK_MODULES([WAYLAND_SCANNER], [wayland-scanner],<br>>         WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`,<br>>         WAYLAND_SCANNER='')<br>> if test "x$WAYLAND_SCANNER" = x; then<br>>     AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])<br>> fi<br><br>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).<br><br>Weston on the other hand handles this in an order that's fine for Yocto:<br><br>> AC_PATH_PROG([wayland_scanner], [wayland-scanner])<br>> if test x$wayland_scanner = x; then<br>>         PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])<br>>         wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`<br>> fi<br><br>I can imagine that this order might be problematic for some use cases (?), but at least the AC_PATH_PROG value can be overridden.<div><br></div><div>My proposal is to try to standardize on Weston style with the addition of<br>    AC_ARG_VAR([wayland_scanner], [The wayland-scanner executable])<div><div>To make it clear "wayland_scanner" can be overridden -- this is essentially what wayland-protocols does.</div><div><br></div><div>Thoughts?</div><div><br></div><div>Jussi<br></div></div></div></div>