configure: get correct paths from xcb-proto when crosscompiling

Submitted by Rolf Eike Beer on July 4, 2017, 1:48 p.m.

Details

Message ID 20827014.uW2evYviLO@devpool21
State New
Series "configure: get correct paths from xcb-proto when crosscompiling"
Headers show

Commit Message

Rolf Eike Beer July 4, 2017, 1:48 p.m.
From e1f9ebb603999158317f7b80dd05ba9b7970de22 Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eb@emlix.com>
Date: Tue, 4 Jul 2017 15:35:41 +0200
Subject: [PATCH] configure: get correct paths from xcb-proto when
 crosscompiling

When PKG_CONFIG_SYSROOT_DIR is set library and include paths queried from
pkg-config are automatically rewritten to be relative to the given path. This
does not apply to any variable queried explicitely using "--variable=". Add the
prefix by hand to get the correct paths when cross compiling.

This seems to affect e.g. yocto, too, as they ship a similar patch for years:
https://github.com/djdeath/yocto-iot/blob/master/meta/recipes-graphics/xcb/libxcb/xcbincludedir.patch

Signed-off-by: Rolf Eike Beer <eb@emlix.com>
---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/configure.ac b/configure.ac
index a6ec8c1..0b2dc5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@  AC_SUBST(NEEDED)
 
 # Find the xcb-proto protocol descriptions
 AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
-XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
+XCBPROTO_XCBINCLUDEDIR=${PKG_CONFIG_SYSROOT_DIR}`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
 AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
 AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
 
@@ -82,7 +82,7 @@  AC_SUBST(XCBPROTO_VERSION)
 
 # Find the xcbgen Python package
 AC_MSG_CHECKING(XCBPROTO_XCBPYTHONDIR)
-XCBPROTO_XCBPYTHONDIR=`$PKG_CONFIG --variable=pythondir xcb-proto`
+XCBPROTO_XCBPYTHONDIR=${PKG_CONFIG_SYSROOT_DIR}`$PKG_CONFIG --variable=pythondir xcb-proto`
 AC_MSG_RESULT($XCBPROTO_XCBPYTHONDIR)
 AC_SUBST(XCBPROTO_XCBPYTHONDIR)