<div dir="ltr">Bump.  Lots of mails but no concrete acceptance or rejection.<div><br></div><div>Ross</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 July 2015 at 22:51, Ross Burton <span dir="ltr"><<a href="mailto:ross.burton@intel.com" target="_blank">ross.burton@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The previous idiom for building a cross-compiled Wayland is to build once for<br>
the build host (with --enable-scanner --disable-libraries) to get a<br>
wayland-scanner binary that can then be used in a cross-compile (with<br>
--disable-scanner).  The problem with this is that the cross wayland is missing<br>
a wayland-scanner binary, which means you then can't do any Wayland development<br>
on the target.<br>
<br>
Instead, always build wayland-scanner for the target and change<br>
--enable/disable-scanner to --with/without-host-scanner.  Normal builds use the<br>
default of --without-host-scanner and run the wayland-scanner it just built, and<br>
cross-compiled builds pass --with-host-scanner to use a previously built host<br>
scanner but still get a wayland-scanner to install.<br>
<br>
(a theoretically neater solution would be to build two scanners if required (one<br>
to run and one to install), but automake makes this overly complicated)<br>
<br>
Signed-off-by: Ross Burton <<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>><br>
---<br>
 Makefile.am  |  9 +++++----<br>
 <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 34 ++++++++++++++++------------------<br>
 2 files changed, 21 insertions(+), 22 deletions(-)<br>
<br>
diff --git a/Makefile.am b/Makefile.am<br>
index 58f5595..151c54b 100644<br>
--- a/Makefile.am<br>
+++ b/Makefile.am<br>
@@ -22,16 +22,17 @@ dist_pkgdata_DATA =                         \<br>
 pkgconfigdir = $(libdir)/pkgconfig<br>
 pkgconfig_DATA =<br>
<br>
-if ENABLE_SCANNER<br>
-wayland_scanner = $(top_builddir)/wayland-scanner<br>
 bin_PROGRAMS = wayland-scanner<br>
 wayland_scanner_SOURCES = src/scanner.c<br>
 wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)<br>
 wayland_scanner_LDADD = $(EXPAT_LIBS) <a href="http://libwayland-util.la" rel="noreferrer" target="_blank">libwayland-util.la</a><br>
-$(BUILT_SOURCES) : wayland-scanner<br>
 pkgconfig_DATA += src/wayland-scanner.pc<br>
-else<br>
+<br>
+if HOST_SCANNER<br>
 wayland_scanner = wayland-scanner<br>
+else<br>
+$(BUILT_SOURCES) : wayland-scanner<br>
+wayland_scanner = $(top_builddir)/wayland-scanner<br>
 endif<br>
<br>
 libwayland_util_la_CFLAGS = $(AM_CFLAGS)<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index 3fa3cf4..61d23bf 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -59,11 +59,11 @@ AC_ARG_ENABLE([libraries],<br>
              [],<br>
              [enable_libraries=yes])<br>
<br>
-AC_ARG_ENABLE([scanner],<br>
-              [AC_HELP_STRING([--disable-scanner],<br>
-                              [Disable compilation of wayland-scanner])],<br>
-              [],<br>
-              [enable_scanner=yes])<br>
+AC_ARG_WITH([host-scanner],<br>
+            [AC_HELP_STRING([--with-host-scanner],<br>
+                            [Use a host wayland-scanner])],<br>
+            [],<br>
+            [with_host_scanner=no])<br>
<br>
 AC_ARG_ENABLE([documentation],<br>
              [AC_HELP_STRING([--disable-documentation],<br>
@@ -71,7 +71,7 @@ AC_ARG_ENABLE([documentation],<br>
              [],<br>
              [enable_documentation=yes])<br>
<br>
-AM_CONDITIONAL(ENABLE_SCANNER, test "x$enable_scanner" = xyes)<br>
+AM_CONDITIONAL(HOST_SCANNER, test "x$with_host_scanner" = xyes)<br>
<br>
 AM_CONDITIONAL(ENABLE_LIBRARIES, test "x$enable_libraries" = xyes)<br>
<br>
@@ -94,18 +94,16 @@ if test "x$enable_libraries" = "xyes"; then<br>
        AC_CHECK_HEADERS([execinfo.h])<br>
 fi<br>
<br>
-if test "x$enable_scanner" = "xyes"; then<br>
-       PKG_CHECK_MODULES(EXPAT, [expat], [],<br>
-               [AC_CHECK_HEADERS(expat.h, [],<br>
-                       [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])<br>
-                SAVE_LIBS="$LIBS"<br>
-                AC_SEARCH_LIBS(XML_ParserCreate, expat, [],<br>
-                       [AC_MSG_ERROR([Can't find expat library. Please install expat.])])<br>
-                EXPAT_LIBS="$LIBS"<br>
-                LIBS="$SAVE_LIBS"<br>
-                AC_SUBST(EXPAT_LIBS)<br>
-               ])<br>
-fi<br>
+PKG_CHECK_MODULES(EXPAT, [expat], [],<br>
+       [AC_CHECK_HEADERS(expat.h, [],<br>
+               [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])<br>
+        SAVE_LIBS="$LIBS"<br>
+        AC_SEARCH_LIBS(XML_ParserCreate, expat, [],<br>
+               [AC_MSG_ERROR([Can't find expat library. Please install expat.])])<br>
+        EXPAT_LIBS="$LIBS"<br>
+        LIBS="$SAVE_LIBS"<br>
+        AC_SUBST(EXPAT_LIBS)<br>
+       ])<br>
<br>
 AC_PATH_PROG(XSLTPROC, xsltproc)<br>
 AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.4<br>
<br>
</font></span></blockquote></div><br></div>