qt4: Improve moc handling
authorAndre Heinecke <aheinecke@intevation.de>
Mon, 15 Dec 2014 17:07:32 +0000 (18:07 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Mon, 15 Dec 2014 17:07:32 +0000 (18:07 +0100)
    * configure.ac: Disable pinentry-qt4 or exit if moc not found.
    * m4/qt.m4: Look for and prefer moc-qt4.
    * qt4/Makefile.am: Add moc files to nodist and clean them.

--

    Files generated by MOC vary over the used Qt versions
    (even inside a Major release). Distributing them leads to
    errors if a different qt version is installed.

    GnuPG-bug-id: 1784

configure.ac
m4/qt.m4
qt4/Makefile.am

index c2644c9..1cbd8b2 100644 (file)
@@ -335,7 +335,19 @@ fi)
 fi
 
 if test "$pinentry_qt4" != "no"; then
+
 QT_PATH_MOC
+if test "$have_moc" != "yes"; then
+    if test "$pinentry_qt4" = "yes"; then
+        AC_MSG_ERROR([[
+    ***
+    *** Qt moc is required.
+    ***]])
+    else
+        pinentry_qt4=no
+    fi
+fi
+
 PKG_CHECK_MODULES(QT4_GUI, QtGui,,
 if test "$pinentry_qt4" = "yes"; then
     AC_MSG_ERROR([[
index 42f33e1..a6b849b 100644 (file)
--- a/m4/qt.m4
+++ b/m4/qt.m4
@@ -59,7 +59,7 @@ AC_DEFUN([QT_PATH_MOC],
       qt_bindirs="$ac_qt_bindir:$qt_bindirs"
    fi
 
-   AC_PATH_PROG(MOC, moc, no, [$qt_bindirs])
+   AC_PATH_PROGS(MOC, [moc-qt4 moc], no, [$qt_bindirs])
    if test "$MOC" = no; then
     #AC_MSG_ERROR([No Qt meta object compiler (moc) found!
     #Please check whether you installed Qt correctly.
index 6dd5f25..e52169c 100644 (file)
@@ -44,16 +44,15 @@ pinentry_qt4_LDADD = $(QT4_CORE_LIBS) $(QT4_GUI_LIBS) $(libcurses) \
 BUILT_SOURCES = \
        pinentryconfirm.moc qsecurelineedit.moc pinentrydialog.moc
 
-MAINTAINERCLEANFILES = \
+CLEANFILES = \
        pinentryconfirm.moc qsecurelineedit.moc pinentrydialog.moc
 
-EXTRA_DIST += \
-        pinentryconfirm.moc qsecurelineedit.moc pinentrydialog.moc
-
 pinentry_qt4_SOURCES = pinentrydialog.h pinentrydialog.cpp \
        main.cpp secstring.h secstring.cpp qsecurelineedit.h \
        qsecurelineedit.cpp qrc_pinentry.cpp \
-       qsecurelineedit_p.h pinentryconfirm.cpp pinentryconfirm.h \
+       qsecurelineedit_p.h pinentryconfirm.cpp pinentryconfirm.h
+
+nodist_pinentry_qt4_SOURCES = \
        pinentryconfirm.moc qsecurelineedit.moc pinentrydialog.moc
 
 .h.moc: