[PATCH 2/5] Remove wayland_protocoldir definition

Pekka Paalanen ppaalanen at gmail.com
Mon May 26 23:43:09 PDT 2014


On Mon, 19 May 2014 17:12:40 +0200
Thierry Reding <thierry.reding at gmail.com> wrote:

> From: Thierry Reding <treding at nvidia.com>
> 
> This is mostly useless and can be confusing in makefiles. The pattern
> rules defined in the makefile snippet are generic enough to allow the
> protocol sources to reside in subdirectories.
> 
> Signed-off-by: Thierry Reding <treding at nvidia.com>
> ---
>  wayland-scanner.m4 | 2 --
>  wayland-scanner.mk | 6 +++---
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/wayland-scanner.m4 b/wayland-scanner.m4
> index 4e4222ad4d2f..e7f383a4c74f 100644
> --- a/wayland-scanner.m4
> +++ b/wayland-scanner.m4
> @@ -8,6 +8,4 @@ AC_DEFUN([WAYLAND_SCANNER_RULES], [
>  
>      wayland_scanner_rules=`$PKG_CONFIG --variable=pkgdatadir wayland-scanner`/wayland-scanner.mk
>      AC_SUBST_FILE([wayland_scanner_rules])
> -
> -    AC_SUBST([wayland_protocoldir], [$1])
>  ])
> diff --git a/wayland-scanner.mk b/wayland-scanner.mk
> index 0a72062baa59..b6e0f444aaa5 100644
> --- a/wayland-scanner.mk
> +++ b/wayland-scanner.mk
> @@ -1,8 +1,8 @@
> -%-protocol.c : $(wayland_protocoldir)/%.xml
> +%-protocol.c: %.xml
>  	$(AM_V_GEN)$(wayland_scanner) code < $< > $@
>  
> -%-server-protocol.h : $(wayland_protocoldir)/%.xml
> +%-server-protocol.h: %.xml
>  	$(AM_V_GEN)$(wayland_scanner) server-header < $< > $@
>  
> -%-client-protocol.h : $(wayland_protocoldir)/%.xml
> +%-client-protocol.h: %.xml
>  	$(AM_V_GEN)$(wayland_scanner) client-header < $< > $@

I think the original purpose here was, that the .xml was not in the
same directory as where you wanted to put the generated .c and .h files.
For instance, Weston could install some .xml files to the system, and a
third party project would then generate the C code from them. Would
that still work?

And out-of-tree builds?

Another thing is, I'm not sure we can change these?

wayland-scanner.mk and wayland-scanner.m4 are installed files, and I'm
so unclear of what guarantees we have for them. They are used for build
only, so I suppose dependent projects test for the minimum libwayland
version, but I think we need to maintain backward compatibility.

OTOH, I still think that we should drop wayland-scanner.mk completely.
Can we do that? Both Weston and Mesa just open-code what
wayland-scanner.mk would have provided, because wayland-scanner.mk was
inconvenient to use.

The rest of this series pretty much depends on the decision here.

How about the following:
- keep the existing wayland-scanner.{mk,m4} as is
- add warnings to both that they will be going away after a few
  wayland releases, so that they will yell at build time
- add a new .m4 file for what you have in patch 3
- patch 3 should provide two things:
  * set WAYLAND_SCANNER to the exectable
  * set another variable to the directory of the installed .xml files?

Then after enough time passes, we could just remove
wayland-scanner.{mk,m4} as per the warning/threat.

Would that work?


Thanks,
pq


More information about the wayland-devel mailing list