After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 691583 - Qt isn't being seen by configure.ac
Qt isn't being seen by configure.ac
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
: 691584 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-01-12 00:59 UTC by John D. Coleman
Modified: 2013-05-14 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description John D. Coleman 2013-01-12 00:59:03 UTC
Qt isn't being seen by the configure.ac script because it looks for a Qt.pc file.
As of Qt-4.8.2, Qt doesn't install a Qt.pc file. At least on my machine using Qt's git repository.
{QtCore, QtDBus, QtNetwork}.pc files ARE present.
Comment 1 André Klapper 2013-01-12 10:42:41 UTC
*** Bug 691584 has been marked as a duplicate of this bug. ***
Comment 2 Pavel Simerda 2013-05-04 22:07:48 UTC
A patch from someone interested in Qt/NetworkManager integration would be most welcome.
Comment 3 Pavel Simerda 2013-05-11 23:24:33 UTC
Should be simple:

-PKG_CHECK_MODULES(QT, [Qt >= 4 QtCore QtDBus QtNetwork], [have_qt=yes],[have_qt=no])
+PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no])

Would that work? I really don't know much about Qt.
Comment 4 Dan Williams 2013-05-13 18:46:45 UTC
/usr/lib64/pkgconfig/Qt.pc gets installed on Fedora by:

qt-devel-4.8.4-17.fc18.x86_64

I also am not too familiar with the setup that Qt development may require, so this may be a Fedora-specific addition to allow parallel install of both qt3 and qt4.

NM uses Qt.pc to check for the Qt4 bin dir, via:

configure.ac:   QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
configure.ac:   AC_CHECK_PROGS(MOC, [moc-qt4 moc],, [$QT4_BINDIR:$PATH])

and then used to determine the path of 'moc'.

If we only want to use QtCore, then we need to handle that too, with something like:

diff --git a/configure.ac b/configure.ac
index 19f9278..2a5a872 100644
--- a/configure.ac
+++ b/configure.ac
@@ -229,7 +229,7 @@ AC_SUBST(GUDEV_LIBS)
 GOBJECT_INTROSPECTION_CHECK([0.9.6])
 
 # Qt4
-PKG_CHECK_MODULES(QT, [Qt >= 4 QtCore QtDBus QtNetwork], [have_qt=yes],[have_qt=no])
+PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no])
 AC_ARG_ENABLE(qt, AS_HELP_STRING([--enable-qt], [enable Qt examples]),
                      [enable_qt=${enableval}], [enable_qt=${have_qt}])
 if (test "${enable_qt}" = "yes"); then
@@ -239,7 +239,7 @@ if (test "${enable_qt}" = "yes"); then
        AC_SUBST(QT_CFLAGS)
        AC_SUBST(QT_LIBS)
        # Check for moc-qt4 and if not found then moc
-       QT4_BINDIR=`$PKG_CONFIG Qt --variable bindir`
+       QT4_BINDIR=`$PKG_CONFIG QtCore --variable moc_location`
        AC_CHECK_PROGS(MOC, [moc-qt4 moc],, [$QT4_BINDIR:$PATH])
 fi
 AM_CONDITIONAL(WITH_QT, test "${enable_qt}" = "yes")
Comment 5 Than Ngo 2013-05-14 09:06:08 UTC
Qt.pc is not part of upstream Qt but an Fedora-specific addition, i'm not sure if this file is included in other distribution. To make it working in other distribution i recommend to use QtCore to check Qt

for example:
MOC=`pkg-config QtCore --variable=moc_location`

The above patch looks fine.

Than
Comment 6 Dan Williams 2013-05-14 19:50:29 UTC
Ok, pushed my patch from comment 4.