[PATCH weston] configure.ac: honour the wayland-scanner.pc

Emil Velikov emil.l.velikov at gmail.com
Tue Feb 10 06:42:01 PST 2015


Currently we use the wayland-scanner executable as found with
AC_PATH_PROG, and after that check the presence of wayland-scanner.pc

Even if the latter is pointing to another wayland-scanner we silently
ignore it. Rework things to check for the relevant variable in the *.pc
file first, and then fall back to checking via AC_PATH_PROG.

XXX: Should we just drop the AC_PATH_PROG check altogether ?

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 configure.ac | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1db9f79..ee08cfc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -501,9 +501,15 @@ if test "x$have_lcms" = xyes; then
 fi
 AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
 
-AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner],
+	wayland-scanner=`$PKG_CONFIG --variable=wayland-scanner wayland-scanner,
+	wayland-scanner='')
+
 if test x$wayland_scanner = x; then
-	AC_MSG_ERROR([wayland-scanner is needed to compile weston])
+	AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+	if test x$wayland_scanner = x; then
+		AC_MSG_ERROR([wayland-scanner is needed to compile weston])
+	fi
 fi
 
 PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner)
-- 
2.2.2



More information about the wayland-devel mailing list