[PATCH weston] autotools: Don't use wayland-scanner.m4
Kristian Høgsberg
hoegsberg at gmail.com
Mon Aug 19 15:49:06 PDT 2013
On Fri, Aug 16, 2013 at 04:16:54PM +0200, Daiki Ueno wrote:
> ---
> As Kristian pointed in:
> <http://lists.freedesktop.org/archives/wayland-devel/2013-August/010509.html>
> wayland-scanner.m4 is not so beneficial compared to copying a few
> lines of autoconf/makefile snippets around. After this,
> wayland-scanner.{pc,m4,mk} could be dropped from wayland.
>
> clients/Makefile.am | 8 +++++++-
> configure.ac | 5 ++---
> src/Makefile.am | 8 +++++++-
> src/xwayland/Makefile.am | 8 +++++++-
> tests/Makefile.am | 11 ++++++++++-
> 5 files changed, 33 insertions(+), 7 deletions(-)
>
> diff --git a/clients/Makefile.am b/clients/Makefile.am
> index 1f7d9dc..afd93b3 100644
> --- a/clients/Makefile.am
> +++ b/clients/Makefile.am
> @@ -254,7 +254,13 @@ endif
>
> endif
>
> - at wayland_scanner_rules@
> +wayland_protocoldir = $(top_srcdir)/protocol
> +
> +%-protocol.c : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) code < $< > $@
> +
> +%-client-protocol.h : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) client-header < $< > $@
>
> if HAVE_POPPLER
> poppler_programs = weston-view
> diff --git a/configure.ac b/configure.ac
> index fab0b48..e305ab0 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -423,9 +423,8 @@ if test "x$have_lcms" = xyes; then
> fi
> AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
>
> -m4_ifndef([WAYLAND_SCANNER_RULES],
> - [m4_fatal([WAYLAND_SCANNER_RULES not found. Point ACLOCAL to wayland-scanner.m4 before running autoconf/autogen])])
> -WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol'])
> +AC_PATH_PROG([wayland_scanner], [wayland-scanner],
> + [AC_MSG_ERROR("wayland-scanner is needed to compile weston")])
>
> AC_CONFIG_FILES([Makefile
> shared/Makefile
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 929de31..3f3b4c4 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -314,4 +314,10 @@ BUILT_SOURCES = \
>
> CLEANFILES = $(BUILT_SOURCES)
>
> - at wayland_scanner_rules@
> +wayland_protocoldir = $(top_srcdir)/protocol
> +
> +%-protocol.c : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) code < $< > $@
> +
> +%-server-protocol.h : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) server-header < $< > $@
> diff --git a/src/xwayland/Makefile.am b/src/xwayland/Makefile.am
> index 82ad53d..68cbabb 100644
> --- a/src/xwayland/Makefile.am
> +++ b/src/xwayland/Makefile.am
> @@ -35,4 +35,10 @@ BUILT_SOURCES = \
>
> CLEANFILES = $(BUILT_SOURCES)
>
> - at wayland_scanner_rules@
> +wayland_protocoldir = $(top_srcdir)/protocol
> +
> +%-protocol.c : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) code < $< > $@
> +
> +%-server-protocol.h : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) server-header < $< > $@
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index d4aa909..7d1d928 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -139,4 +139,13 @@ BUILT_SOURCES = \
>
> CLEANFILES = $(BUILT_SOURCES)
>
> - at wayland_scanner_rules@
> +wayland_protocoldir = $(top_srcdir)/protocol
> +
> +%-protocol.c : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) code < $< > $@
> +
> +%-server-protocol.h : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) server-header < $< > $@
> +
> +%-client-protocol.h : $(wayland_protocoldir)/%.xml
> + $(AM_V_GEN)$(wayland_scanner) client-header < $< > $@
Maybe we could put this snippet in $(top_srcdir) and just include it
from the various sub-Makefiles.ams?
Kristian
> --
> 1.8.3.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list