On 02/10/2015 06:42 AM, Emil Velikov wrote:
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 <[email protected]>
---
  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

I would prefer using the else clase of PKG_CHECK_MODULES rather than this strange x$foo==x stuff.

  PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner)

Looks like you left a redundant PKG_CHECK_MODULES there at the end, or you should merge whatever it does into your existing one.
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to