From: Martin Jansa <martin.ja...@gmail.com>

$PKG_CONFIG --variable=host_bins Qt5Core
returns absolute path without the prefix to sysroot when cross compiling

Before 
https://github.com/meta-qt5/meta-qt5/commit/b716195f609de6547cfdfadfd4fd25292a6bbf09
this will return:

pkg-config --variable=host_bins Qt5Core
/usr/bin/qt5

which is bad, but is replaced with ${OE_QMAKE_PATH_EXTERNAL_HOST_BINS}
in the generated Makefile after configure as in:
https://github.com/webOS-ports/meta-webos-ports/blob/e4283e7906e3fbd2e0bcffcd317d2d1a9e2ebcd5/meta-luneos/recipes-connectivity/ofono/phonesim_1.20.bb#L22

but with empty QT_DIR_NAME the returned value is:
pkg-config --variable=host_bins Qt5Core
/usr/bin

and these 2 replaces fail, causing
make: /usr/bin/uic: Command not found

Use PKG_CHECK_VAR for host_bins which we can override with
OE_QMAKE_PATH_EXTERNAL_HOST_BINS from the environment and
the generated Mafile will be correct right away.

Signed-off-by: Martin Jansa <martin.ja...@gmail.com>
---
 configure.ac | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4eb969a..e339691 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,13 +31,18 @@ CXXFLAGS="$CXXFLAGS --std=gnu++11"
 AC_SUBST(QT_CFLAGS)
 AC_SUBST(QT_LIBS)

+AC_MSG_CHECKING(for Qt5 host_bins)
+PKG_CHECK_VAR(QMAKE_PATH_HOST_BINS, Qt5Core, host_bins)
+AC_SUBST(QMAKE_PATH_HOST_BINS)
+AC_MSG_RESULT($QMAKE_PATH_HOST_BINS)
+
 AC_MSG_CHECKING(for moc)
-MOC="`$PKG_CONFIG --variable=host_bins Qt5Core`/moc"
+MOC="$QMAKE_PATH_HOST_BINS/moc"
 AC_SUBST(MOC)
 AC_MSG_RESULT($MOC)

 AC_MSG_CHECKING(for uic)
-UIC="`$PKG_CONFIG --variable=host_bins Qt5Core`/uic"
+UIC="$QMAKE_PATH_HOST_BINS/uic"
 AC_SUBST(UIC)
 AC_MSG_RESULT($UIC)

--
2.23.0
_______________________________________________
ofono mailing list -- ofono@ofono.org
To unsubscribe send an email to ofono-le...@ofono.org

Reply via email to