[PATCH weston v2] configure.ac: use PKG_CHECK_VAR for wayland-protocols

Olivier Blin olivier.blin at softathome.com
Thu Jul 6 12:49:11 UTC 2017


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

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

The pkgdatadir is not affected by the PKG_CONFIG_SYSROOT_DIR environment
variable, since it is usually meant for directories needed at runtime,
not build time.
---
 configure.ac | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 53faee34..c2aedcd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -208,9 +208,7 @@ fi
 PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
 PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
 
-PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.8],
-		  [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
-AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
+PKG_CHECK_VAR(WAYLAND_PROTOCOLS_DATADIR, wayland-protocols >= 1.8, pkgdatadir)
 
 AC_ARG_ENABLE(wayland-compositor, [  --enable-wayland-compositor],,
 	      enable_wayland_compositor=yes)
-- 
2.13.0



More information about the wayland-devel mailing list