From ec703836b314c419a1c463dc105234f733031535 Mon Sep 17 00:00:00 2001 From: Bernd Weimer Date: Wed, 9 Jul 2014 11:58:44 +0200 Subject: Improve dbus cross compilation Building QtDBus on Linux host for QNX target had two issues: * Configure check failed, because dbus-1 library was not linked in, if target platform doesn't support pkg-config. * Host tools were not built, because pkg-config was not used to locate dbus headers on the host. Task-number: QTBUG-37324 Change-Id: I71d8309599fd40ef2dd8c9e3b44b93a7482019f1 Reviewed-by: Rolf Eike Beer Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- configure | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/configure b/configure index d5c2b0801f..cb8d78fd3c 100755 --- a/configure +++ b/configure @@ -4584,11 +4584,19 @@ if [ "$CFG_DBUS" != "no" ]; then if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then QT_CFLAGS_DBUS=`$PKG_CONFIG --cflags dbus-1 2>/dev/null` QT_LIBS_DBUS=`$PKG_CONFIG --libs dbus-1 2>/dev/null` + else + QT_LIBS_DBUS="-ldbus-1" fi if compileTest unix/dbus "D-Bus" $QT_CFLAGS_DBUS $QT_LIBS_DBUS; then [ "$CFG_DBUS" = "auto" ] && CFG_DBUS=yes - QMakeVar set QT_CFLAGS_DBUS "$QT_CFLAGS_DBUS" QMakeVar set QT_LIBS_DBUS "$QT_LIBS_DBUS" + QMakeVar set QT_CFLAGS_DBUS "$QT_CFLAGS_DBUS" + # Try find correct host configuration for dbus tools when cross-compiling + if [ "$QT_CROSS_COMPILE" = "yes" ] && env -i PATH="$PATH" \ + pkg-config --atleast-version="$MIN_DBUS_1_VERSION" dbus-1 2>/dev/null; then + QT_CFLAGS_DBUS=`env -i PATH="$PATH" pkg-config --cflags dbus-1 2>/dev/null` + fi + QMakeVar set QT_HOST_CFLAGS_DBUS "$QT_CFLAGS_DBUS" else if [ "$CFG_DBUS" = "auto" ]; then CFG_DBUS=no -- cgit v1.2.3