[PATCH v2 weston] autotools: Don't use wayland-scanner.m4
Daiki Ueno
ueno at gnu.org
Tue Aug 20 00:56:52 PDT 2013
---
Put makefile rules into $(top_srcdir)/wayland-scanner.mk and include
it from Makefile.am.
Makefile.am | 2 +-
clients/Makefile.am | 3 ++-
configure.ac | 5 ++---
src/Makefile.am | 3 ++-
src/xwayland/Makefile.am | 3 ++-
tests/Makefile.am | 3 ++-
wayland-scanner.mk | 8 ++++++++
7 files changed, 19 insertions(+), 8 deletions(-)
create mode 100644 wayland-scanner.mk
diff --git a/Makefile.am b/Makefile.am
index 88428de..e9ecc38 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,4 +6,4 @@ SUBDIRS = shared src clients data protocol tests $(wcap_subdir) man
DISTCHECK_CONFIGURE_FLAGS = --disable-setuid-install
-EXTRA_DIST = weston.ini
+EXTRA_DIST = weston.ini wayland-scanner.mk
diff --git a/clients/Makefile.am b/clients/Makefile.am
index 1f7d9dc..87b3a0e 100644
--- a/clients/Makefile.am
+++ b/clients/Makefile.am
@@ -254,7 +254,8 @@ endif
endif
- at wayland_scanner_rules@
+wayland_protocoldir = $(top_srcdir)/protocol
+include $(top_srcdir)/wayland-scanner.mk
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..80c4b87 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -314,4 +314,5 @@ BUILT_SOURCES = \
CLEANFILES = $(BUILT_SOURCES)
- at wayland_scanner_rules@
+wayland_protocoldir = $(top_srcdir)/protocol
+include $(top_srcdir)/wayland-scanner.mk
diff --git a/src/xwayland/Makefile.am b/src/xwayland/Makefile.am
index 82ad53d..d4a7988 100644
--- a/src/xwayland/Makefile.am
+++ b/src/xwayland/Makefile.am
@@ -35,4 +35,5 @@ BUILT_SOURCES = \
CLEANFILES = $(BUILT_SOURCES)
- at wayland_scanner_rules@
+wayland_protocoldir = $(top_srcdir)/protocol
+include $(top_srcdir)/wayland-scanner.mk
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d4aa909..82bf630 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -139,4 +139,5 @@ BUILT_SOURCES = \
CLEANFILES = $(BUILT_SOURCES)
- at wayland_scanner_rules@
+wayland_protocoldir = $(top_srcdir)/protocol
+include $(top_srcdir)/wayland-scanner.mk
diff --git a/wayland-scanner.mk b/wayland-scanner.mk
new file mode 100644
index 0000000..0a72062
--- /dev/null
+++ b/wayland-scanner.mk
@@ -0,0 +1,8 @@
+%-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 < $< > $@
--
1.8.3.1
More information about the wayland-devel
mailing list