[PATCH xserver] xwayland: Silence a build warning if we can

Pekka Paalanen ppaalanen at gmail.com
Fri Apr 6 07:07:12 UTC 2018


On Thu,  5 Apr 2018 13:35:11 -0400
Adam Jackson <ajax at redhat.com> wrote:

> [735/786] Generating 'hw/xwayland/Xwayland at exe/relative-pointer-unstable-v1-protocol.c'.
> Using "code" is deprecated - use private-code or public-code.
> See the help page for details.
> 
> Use private-code if wayland-scanner is new enough.
> 
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
>  configure.ac            |  4 ++++
>  hw/xwayland/Makefile.am | 14 +++++++-------
>  hw/xwayland/meson.build |  9 ++++++++-
>  3 files changed, 19 insertions(+), 8 deletions(-)
> 

Hi,

I only read through the patch, and it looks quite ok to me, so:
Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

But I still have a couple of questions below.

> diff --git a/configure.ac b/configure.ac
> index 290721891d..d8d88e2b15 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'))

Are you happy with the whitespace (tabs vs. spaces) here?

Thinking of cross-compiling, is this ok or should it be more paranoid
about mismatching 'wayland-scanner' and 'wayland-scanner.pc'?

Personally I would claim that version mismatch there would be user
error, so this should be fine.


Thanks,
pq

> +
>  	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 3378a66569..0291afee79 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 17f52b4bae..69a5c819a9 100644
> --- a/hw/xwayland/meson.build
> +++ b/hw/xwayland/meson.build
> @@ -27,9 +27,16 @@ client_header = generator(scanner,
>      output : '@BASENAME at -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 at -protocol.c',
> -    arguments : ['code', '@INPUT@', '@OUTPUT@']
> +    arguments : [scanner_argument, '@INPUT@', '@OUTPUT@']
>  )
>  srcs += client_header.process(relative_xml)
>  srcs += client_header.process(pointer_xml)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180406/dfcb9e90/attachment.sig>


More information about the xorg-devel mailing list