From 754ccf89a732fc3da6e9bc62ebd6b28686ff3d26 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <otavio@ossystems.com.br>
Date: Wed, 29 Aug 2018 22:10:30 -0300
Subject: [PATCH 6/6] use PKG_CHECK_VAR for defining WAYLAND_PROTOCOLS_DATADIR
Organization: O.S. Systems Software LTDA.

This allows to override the wayland-protocols pkgdatadir with the
WAYLAND_PROTOCOLS_DATADIR from environment.

pkgconfig would return an absolute path in
/usr/share/wayland-protocols
for the pkgdatadir value, which is not suitable for cross-compiling.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 40cac36ac2..728bbdcbc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1823,7 +1823,7 @@ for plat in $platforms; do
         PKG_CHECK_MODULES([WAYLAND_CLIENT], [wayland-client >= $WAYLAND_REQUIRED])
         PKG_CHECK_MODULES([WAYLAND_SERVER], [wayland-server >= $WAYLAND_REQUIRED])
         PKG_CHECK_MODULES([WAYLAND_PROTOCOLS], [wayland-protocols >= $WAYLAND_PROTOCOLS_REQUIRED])
-        WAYLAND_PROTOCOLS_DATADIR=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`
+        PKG_CHECK_VAR([WAYLAND_PROTOCOLS_DATADIR], [wayland-protocols >= $WAYLAND_PROTOCOLS_REQUIRED], pkgdatadir)
 
         AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner], [:])
 
-- 
2.18.0

