diff --git a/configure.ac b/configure.ac index 290721891..d8d88e2b1 100644 --- a/configure.ac +++ b/configure.ac @@ -2391,6 +2391,10 @@ if test "x$XWAYLAND" = xyes; then AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],, [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH]) + PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner >= 1.14.91], + AC_SUBST(SCANNER_ARG, 'private-code'), + AC_SUBST(SCANNER_ARG, 'code')) + AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`) fi diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am index 3378a6656..0291afee7 100644 --- a/hw/xwayland/Makefile.am +++ b/hw/xwayland/Makefile.am @@ -79,36 +79,36 @@ relink: $(AM_V_at)rm -f Xwayland$(EXEEXT) && $(MAKE) Xwayland$(EXEEXT) relative-pointer-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ relative-pointer-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/relative-pointer/relative-pointer-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ pointer-constraints-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ pointer-constraints-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ tablet-unstable-v2-protocol.c: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ tablet-unstable-v2-client-protocol.h: $(WAYLAND_PROTOCOLS_DATADIR)/unstable/tablet/tablet-unstable-v2.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ xwayland-keyboard-grab-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ xwayland-keyboard-grab-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ xdg-output-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xdg-output/xdg-output-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ xdg-output-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xdg-output/xdg-output-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ linux-dmabuf-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ linux-dmabuf-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ %-protocol.c : %.xml - $(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@ + $(AM_V_GEN)$(WAYLAND_SCANNER) @SCANNER_ARG@ < $< > $@ %-client-protocol.h : %.xml $(AM_V_GEN)$(WAYLAND_SCANNER) client-header < $< > $@ diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build index 17f52b4ba..69a5c819a 100644 --- a/hw/xwayland/meson.build +++ b/hw/xwayland/meson.build @@ -27,9 +27,16 @@ client_header = generator(scanner, output : '@BASENAME@-client-protocol.h', arguments : ['client-header', '@INPUT@', '@OUTPUT@'] ) + +if scanner_dep.version().version_compare('>= 1.14.91') + scanner_argument = 'private-code' +else + scanner_argument = 'code' +endif + code = generator(scanner, output : '@BASENAME@-protocol.c', - arguments : ['code', '@INPUT@', '@OUTPUT@'] + arguments : [scanner_argument, '@INPUT@', '@OUTPUT@'] ) srcs += client_header.process(relative_xml) srcs += client_header.process(pointer_xml)