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 --- tools/configure/configureapp.cpp | 14 +++++++++++--- tools/configure/configureapp.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index b7565093f1..63d9f2804e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1008,6 +1008,8 @@ void Configure::parseCmdLine() sybaseLibs = configCmdLine.at(i); } else if (configCmdLine.at(i).startsWith("DBUS_PATH=")) { dbusPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1)); + } else if (configCmdLine.at(i).startsWith("DBUS_HOST_PATH=")) { + dbusHostPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1)); } else if (configCmdLine.at(i).startsWith("MYSQL_PATH=")) { mysqlPath = QDir::fromNativeSeparators(configCmdLine.at(i).section("=", 1)); } else if (configCmdLine.at(i).startsWith("ZLIB_LIBS=")) { @@ -2938,9 +2940,15 @@ void Configure::generateOutputVars() qmakeVars += QString("OPENSSL_LIBS += -L%1/lib").arg(opensslPath); } } - if (dictionary[ "DBUS" ] != "no" && !dbusPath.isEmpty()) { - qmakeVars += QString("QT_CFLAGS_DBUS = -I%1/include").arg(dbusPath); - qmakeVars += QString("QT_LIBS_DBUS = -L%1/lib").arg(dbusPath); + if (dictionary[ "DBUS" ] != "no") { + if (!dbusPath.isEmpty()) { + qmakeVars += QString("QT_CFLAGS_DBUS = -I%1/include").arg(dbusPath); + qmakeVars += QString("QT_LIBS_DBUS = -L%1/lib").arg(dbusPath); + if (dbusHostPath.isEmpty()) + qmakeVars += QString("QT_HOST_CFLAGS_DBUS = -I%1/include").arg(dbusPath); + } + if (!dbusHostPath.isEmpty()) + qmakeVars += QString("QT_HOST_CFLAGS_DBUS = -I%1/include").arg(dbusHostPath); } if (dictionary[ "SQL_MYSQL" ] != "no" && !mysqlPath.isEmpty()) { qmakeVars += QString("QT_CFLAGS_MYSQL = -I%1/include").arg(mysqlPath); diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 98e4912eaa..5f118ddd39 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -140,6 +140,7 @@ private: QString opensslLibsRelease; QString opensslPath; QString dbusPath; + QString dbusHostPath; QString mysqlPath; QString psqlLibs; QString zlibLibs; -- cgit v1.2.3