[PATCH][weston] configure.ac: Add --with-wayland-scanner-path

Jussi Kukkonen jussi.kukkonen at intel.com
Tue May 23 08:05:17 UTC 2017


Modify wayland-scanner lookup: Use the path given by pkg-config
but offer an option to override the path with
"--with-wayland-scanner-path=PATH". The latter is useful for
cross-compile situations.

AC_PATH_PROG is no longer used.

Also add a AC_SUBST-call (it seems previously the pkg-config value was
never substituted into Makefiles).
---

My goal is to standardize wayland-scanner usage in a way that does
not require patching when cross-compiling in Yocto. I'm sending a
similar patch to mesa and will fix other projects if these two patches
are well received.

I did not check that wayland-scanner can actually run as pq suggested:
I don't think that's typically a problem and the error on make should
be fairly good in that case.

Thanks,
 Jussi

 configure.ac | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index db757f20..e17135a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -653,11 +653,20 @@ if test "x$enable_lcms" != "xno"; then
 fi
 AM_CONDITIONAL(HAVE_LCMS, [test "x$enable_lcms" = xyes])
 
-AC_PATH_PROG([wayland_scanner], [wayland-scanner])
-if test x$wayland_scanner = x; then
-	PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
-	wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
-fi
+AC_ARG_WITH([wayland-scanner-path],
+            [AS_HELP_STRING([--with-wayland-scanner-path=PATH],
+                            [Path to wayland-scanner (by default the path from
+                             'pkg-config --variable=wayland_scanner wayland-scanner'
+                             is used)])],
+            [wayland_scanner="$withval"],
+            [wayland_scanner="auto"])
+if test x$wayland_scanner = xauto; then
+        PKG_CHECK_MODULES([WAYLAND_SCANNER],
+                          [wayland-scanner],
+                          [wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`],
+                          [AC_MSG_ERROR([wayland-scanner was not found and --with-wayland-scanner-path was not used])])
+fi
+AC_SUBST(wayland_scanner)
 
 AC_ARG_ENABLE(systemd_notify,
               AS_HELP_STRING([--enable-systemd-notify],
-- 
2.11.0



More information about the wayland-devel mailing list