summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2015-07-01 23:04:45 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-02 23:08:40 +0100
commitdf7386e7df456d1b44f2a089f11db2673bfdfa66 (patch)
treea86dc695806cdb2eed9dc86a5caf5ee84cee0bc4
parentfa0845f2ad18896d6df3298afed7b70379306a48 (diff)
downloadpoky-df7386e7df456d1b44f2a089f11db2673bfdfa66.tar.gz
wayland: always build wayland-scanner
By passing --disable-scanner to use a native wayland-scanner binary a target wayland-scanner binary isn't built, which is a problem if you want to use it on the target or in a SDK. Instead, always build a target wayland-scanner binary, and have an option to control whether that binary or a host-provided binary is used at build time. [ YOCTO #7931 ] (From OE-Core rev: 7aeeaf287169d4d7de5349626caa93a3941c2c35) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-graphics/wayland/wayland/always-build-scanner.patch105
-rw-r--r--meta/recipes-graphics/wayland/wayland_1.8.1.bb10
2 files changed, 112 insertions, 3 deletions
diff --git a/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch b/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch
new file mode 100644
index 0000000000..5e0e6bf12a
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch
@@ -0,0 +1,105 @@
1build: always build wayland-scanner
2
3The previous idiom for building a cross-compiled Wayland is to build once for
4the build host (with --enable-scanner --disable-libraries) to get a
5wayland-scanner binary that can then be used in a cross-compile (with
6--disable-scanner). The problem with this is that the cross wayland is missing
7a wayland-scanner binary, which means you then can't do any Wayland development
8on the target.
9
10Instead, always build wayland-scanner for the target and change
11--enable/disable-scanner to --with/without-host-scanner. Normal builds use the
12default of --without-host-scanner and run the wayland-scanner it just built, and
13cross-compiled builds pass --with-host-scanner to use a previously built host
14scanner but still get a wayland-scanner to install.
15
16(a theoretically neater solution would be to build two scanners if required (one
17to run and one to install), but automake makes this overly complicated)
18
19Signed-off-by: Ross Burton <ross.burton@intel.com>
20Upstream-Status: Submitted
21
22diff --git a/Makefile.am b/Makefile.am
23index c19494f..c2d929b 100644
24--- a/Makefile.am
25+++ b/Makefile.am
26@@ -64,16 +64,17 @@ nodist_libwayland_client_la_SOURCES = \
27
28 pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
29
30-if ENABLE_SCANNER
31-wayland_scanner = $(top_builddir)/wayland-scanner
32 bin_PROGRAMS = wayland-scanner
33 wayland_scanner_SOURCES = src/scanner.c
34 wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
35 wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
36-$(BUILT_SOURCES) : wayland-scanner
37 pkgconfig_DATA += src/wayland-scanner.pc
38-else
39+
40+if HOST_SCANNER
41 wayland_scanner = wayland-scanner
42+else
43+$(BUILT_SOURCES) : wayland-scanner
44+wayland_scanner = $(top_builddir)/wayland-scanner
45 endif
46
47 protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
48diff --git a/configure.ac b/configure.ac
49index c2a804e..de0b02f 100644
50--- a/configure.ac
51+++ b/configure.ac
52@@ -65,11 +65,11 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
53 [[#include <time.h>]])
54 AC_CHECK_HEADERS([execinfo.h])
55
56-AC_ARG_ENABLE([scanner],
57- [AC_HELP_STRING([--disable-scanner],
58- [Disable compilation of wayland-scanner])],
59- [],
60- [enable_scanner=yes])
61+AC_ARG_WITH([host-scanner],
62+ [AC_HELP_STRING([--with-host-scanner],
63+ [Use a host wayland-scanner])],
64+ [],
65+ [with_host_scanner=no])
66
67 AC_ARG_ENABLE([documentation],
68 [AC_HELP_STRING([--disable-documentation],
69@@ -77,25 +77,23 @@ AC_ARG_ENABLE([documentation],
70 [],
71 [enable_documentation=yes])
72
73-AM_CONDITIONAL(ENABLE_SCANNER, test "x$enable_scanner" = xyes)
74+AM_CONDITIONAL(HOST_SCANNER, test "x$with_host_scanner" = xyes)
75
76 AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
77 [ ICONDIR=$withval],
78 [ ICONDIR=${datadir}/icons])
79 AC_SUBST([ICONDIR])
80
81-if test "x$enable_scanner" = "xyes"; then
82- PKG_CHECK_MODULES(EXPAT, [expat], [],
83- [AC_CHECK_HEADERS(expat.h, [],
84- [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
85- SAVE_LIBS="$LIBS"
86- AC_SEARCH_LIBS(XML_ParserCreate, expat, [],
87- [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
88- EXPAT_LIBS="$LIBS"
89- LIBS="$SAVE_LIBS"
90- AC_SUBST(EXPAT_LIBS)
91- ])
92-fi
93+PKG_CHECK_MODULES(EXPAT, [expat], [],
94+ [AC_CHECK_HEADERS(expat.h, [],
95+ [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
96+ SAVE_LIBS="$LIBS"
97+ AC_SEARCH_LIBS(XML_ParserCreate, expat, [],
98+ [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
99+ EXPAT_LIBS="$LIBS"
100+ LIBS="$SAVE_LIBS"
101+ AC_SUBST(EXPAT_LIBS)
102+ ])
103
104 AC_PATH_PROG(XSLTPROC, xsltproc)
105 AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
diff --git a/meta/recipes-graphics/wayland/wayland_1.8.1.bb b/meta/recipes-graphics/wayland/wayland_1.8.1.bb
index 5b367453cc..ac631af1fb 100644
--- a/meta/recipes-graphics/wayland/wayland_1.8.1.bb
+++ b/meta/recipes-graphics/wayland/wayland_1.8.1.bb
@@ -10,14 +10,15 @@ LICENSE = "MIT"
10LIC_FILES_CHKSUM = "file://COPYING;md5=1d4476a7d98dd5691c53d4d43a510c72 \ 10LIC_FILES_CHKSUM = "file://COPYING;md5=1d4476a7d98dd5691c53d4d43a510c72 \
11 file://src/wayland-server.c;endline=21;md5=079ae21dbf98ada52ec23744851b0a5c" 11 file://src/wayland-server.c;endline=21;md5=079ae21dbf98ada52ec23744851b0a5c"
12 12
13SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz" 13SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
14 file://always-build-scanner.patch"
14SRC_URI[md5sum] = "6e877877c3e04cfb865cfcd0733c9ab1" 15SRC_URI[md5sum] = "6e877877c3e04cfb865cfcd0733c9ab1"
15SRC_URI[sha256sum] = "f17c938d1c24fd0a10f650a623a2775d329db3168b5732e498b08388ec776fc8" 16SRC_URI[sha256sum] = "f17c938d1c24fd0a10f650a623a2775d329db3168b5732e498b08388ec776fc8"
16 17
17SRC_URI_append_class-native = " \ 18SRC_URI_append_class-native = " \
18 file://disable-macro-checks-not-used-for-scanner.patch \ 19 file://disable-macro-checks-not-used-for-scanner.patch \
19 " 20 "
20EXTRA_OECONF_class-native = "--disable-documentation --enable-scanner" 21EXTRA_OECONF_class-native = "--disable-documentation"
21 22
22inherit autotools pkgconfig 23inherit autotools pkgconfig
23 24
@@ -26,7 +27,7 @@ BBCLASSEXTEND = "native"
26 27
27DEPENDS = "expat libffi wayland-native" 28DEPENDS = "expat libffi wayland-native"
28 29
29EXTRA_OECONF = "--disable-documentation --disable-scanner" 30EXTRA_OECONF = "--disable-documentation --with-host-scanner"
30 31
31# Wayland installs a M4 macro for other projects to use, which uses the target 32# Wayland installs a M4 macro for other projects to use, which uses the target
32# pkg-config to find files. Replace pkg-config with pkg-config-native. 33# pkg-config to find files. Replace pkg-config with pkg-config-native.
@@ -40,3 +41,6 @@ sysroot_stage_all_append_class-target () {
40 rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4 41 rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4
41 cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/ 42 cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/
42} 43}
44
45FILES_${PN} = "${libdir}/*${SOLIBS}"
46FILES_${PN}-dev += "${bindir} ${datadir}/wayland"