AC_MSG_ERROR([cannot build egl state tracker without EGL library])
fi
-PKG_CHECK_VAR([WAYLAND_SCANNER], [wayland-scanner], [wayland_scanner])
+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
# Do per-EGL platform setups and checks
egl_platforms=`IFS=', '; echo $with_egl_platforms`